FranklinDM / Swarth

Modifies web pages to use a dark color scheme or based on the user's preferences
Mozilla Public License 2.0
2 stars 0 forks source link

Under "Manage configured pages", selecting "Simple stylesheet" instead behaves as "Color inversion" #1

Closed NintendoManiac64 closed 2 years ago

NintendoManiac64 commented 2 years ago

[verified with a fresh & new unmodified copy of Pale Moon Portable v29.4.4]

Simply put, under "Manage configured pages", if you select "Simple stylesheet" for a given website domain, it will instead behave as if you selected "Color inversion"

 

This is particularly problematic on pixiv.net where the artist's works page requires using "Simple stylesheet" (using "Color inversion" makes the text of visited links invisible) but an individual artwork page requires using "Color inversion" (using "Simple stylesheet" makes the actual artwork invisible).

Worse still is that this extension doesn't seem to be able to handle treating "pixiv.net/en/users" and "pixiv.net/en/artwork" with different stylesheet settings (if I add both, one of them just straight-up ignores the individual setting and instead just uses the global stylesheet setting)

For reference, both pages are technically functional with "Stylesheet processor" but it causes you to be blinded by the light. And another art website, deviantart.com only works correctly with "Stylesheet processor"

 

requires "Simple stylesheet" - Example pixiv.net artist's works page: [anime warning] https://www.pixiv.net/en/users/1079073/artworks

requires "Color inversion" - Example pixiv.net individual artwork page: [anime warning] https://www.pixiv.net/en/artworks/93980571

requires "Stylesheet processor" - Example deviantart.com gallery page: [anime warning] https://www.deviantart.com/gigamessy/gallery/all

fofajardo commented 2 years ago

Thanks for reporting. It seems like I forgot to call parseInt to convert the value of the method ID which is in string when everything else in the extension expects that the method ID is a number/integer value. Please check if the latest release (v1.0.3) fixes this issue.

NintendoManiac64 commented 2 years ago

v1.0.3 seems to fix everything including being able to separately set "pixiv.net/en/users" and "pixiv.net/en/artworks" with two different settings.

I do have a question though about the per-site configuration though - other than making two separate configurations, is there a way that the user can set up a URL so that both "pixiv.net/artists" and "pixiv.net/en/artists" are treated the same? For instance, is there something like a wildcard that then can be used in-place of any amount of characters, e.g. "pixiv.net*artists" which would then apply to both "pixiv.net/artists" and "pixiv.net/en/artists"?

 

EDIT: I just realized though that, from a "pixiv.net/en/users" page, if you left-click on an artwork that does not have multiple images (such as the example I previously linked to), swarth will still be using the stylesheet setting assigned to "pixiv.net/en/users" rather than switching over to "pixiv.net/en/artworks"

Outside of straight-up tweaking the extension so that one can use the "Stylesheet processor" option on pixiv.net without it blinding you, I'm not entirely sure if this is something solvable as pixiv seems to be doing that fancy-pants javascript loading thing when left-clicking on an artwork vs if you were to open it in a new tab.

(that being said, I do in fact almost always open an artwork page on pixiv in a new tab which is how I didn't even notice this in the first place)

 

EDIT 2: I dug out my pixiv account login information and, when logged in, it turns out they actually have an account-level "dark mode" toggle switch that does in fact seem to work with the "Stylesheet processor" setting without issue as well as without blinding you (...mostly, there seems to be a momentary white flash in the header area of the "pixiv.net/en/users" page)

So make of that what you will.

fofajardo commented 2 years ago
NintendoManiac64 commented 2 years ago

The inconsistency in the scope used for sites that change the location via JS (as noted in your first edit) should be fixed in the latest release (v1.0.4).

Yup, it works now.

 

You may also opt to use Retain page style for sites that have their own implementation of dark mode.

The issue is that, like Github, pixiv's dark mode uses quite a solid blue color for visited links that gets "crushed" out of existence by the likes of f.lux and/or RedShift. In fact I only just figured out that this is why I thought that the "inverted" color scheme was causing visited links to be invisible - in reality the color was so much of a solid blue that f.lux was basically turning it into grey or black, making the text unreadable.

So to put it simply, using the stylesheet processor allows me to use my custom unvisited and visited link colors.