abstiles / deluminate

An extension for Google Chrome (and Chromium) that inverts the luminance of websites.
BSD 2-Clause "Simplified" License
217 stars 43 forks source link

[Feature Request] Add filtering more specific than domain level #418

Open tannenzaepfle opened 7 years ago

tannenzaepfle commented 7 years ago

What version of Chrome are you using?

57.0.2987.98

What version of Deluminate do you have installed?

0.7.4

What Operating System are you using?

Windows 7

What is the problem?

My company's site has a wiki (*.example.com/wiki) that should use "delumine-all" filtering, but other pages on the domain should use "smart" inverting. Neither page looks good under the other's setting, but because they share the same domain I have to keep changing or just stare at bright boxes.

Can you link to a web page that has the problem?

Gliffy diagrams on JIRA.

I'd just like to have a filter that runs on "[*.]website.com/subsection/" which takes precedence over the settings for "[*.]website.com", but I can't manually update the text in the settings box either. Maybe that would be a good option, so I can back up and restore deluminate settings from a text file.

Which Deluminate modes have the problem?

Rojikku commented 7 years ago

Agreed, this would be a neat feature. Firewall rules use a list-order to determine priority. Suggesting, if implemented, you use something similar. In his case, he would put the /subsection above the without, and it would work with maximum effect and minimal effort.

Rojikku commented 7 years ago

So I referenced another issue there. The theory behind the solution to both of these isn't complicated, but the implementation looks difficult. Essentially you have it so that the settings page would look like: ".deviantart.com/": "delumine-noimg", "www.example.com": "delumine-smart", "www.youtube.com": "noinvert-dim5", "www.youtube.com/watch": "delumine-noimg", This is obviously just an example. However the way loading works is it does absolute comparison, not "close enough" comparison. It also takes wildcards literally. Meaning that the above, which is actually copied straight off my settings page because I edited it directly (Yeah I can do that correctly), doesn't actually work. Though if I want to add a trailing / to the youtube, that part works, but if you go to any other page you'll end up on the default scheme, which I think is worse than the current version. The ability to separate things by port number is nice, though, I have that working. I want to see if I can get further. If I give up I can at least put a pull request for the port thing. Anyway, back on topic, essentially the current system has several functions: siteFromURL getSiteScheme setSiteScheme

These three are great for the current system, but to change it to one that does these features, it has to be conceptually different. siteFromURL essentially gets a regular, long URL, and cuts it down to just, for example, github.com. getSiteScheme takes github.com and tries to find it in the list, and if it does, it gets the scheme associated with it. If it doesn't exist in the list, it uses the default. setSiteScheme takes github.com, from the same siteFromURL function, and writes in the scheme for github.com in the storage. All that data is in storage, which is how I edited it. Anyway, for the system to support the features, siteFromURL needs to be split into a read and write feature. The write feature would be exactly the same as the current one, no issues there. This would work with setSiteScheme perfectly. The read design would have to be completely different, though. You'd first edit the settings to be like my example above, with .deviantart.com/ or whichever. It would then have to actually interpret those wildcards, and select the most appropriate match when there is overlap. I'm still looking at the code to see if I can figure it out, so we will see.. Perhaps my insight isn't very useful, but I already wrote it up, so I'd hate to delete it.

Rojikku commented 7 years ago

A patch is temporarily at https://github.com/Rojikku/deluminate-1 until the pull gets accepted, or abstiles writes his own implementation. Instructions are on the pull referenced above for your specific issue.

Wizek commented 7 years ago

I'd like this feature too. Would be especially useful on sites like google which like to put subsites at subpaths and not subdomains.