sixem / legacy-wikipedia

A browser addon that forces the old layout of Wikipedia
https://addons.mozilla.org/en-US/firefox/addon/legacy-wikipedia/
MIT License
4 stars 0 forks source link

Support for other Wikipedia Themes? #2

Open MintMain21 opened 1 year ago

MintMain21 commented 1 year ago

Besides Vector, there are a few other "skins" that can be forced onto Wikipedia in a similar fashion to Vector.

https://en.wikipedia.org/w/index.php?title=Wikipedia:Skin

The option to toggle between these would be nice.

sixem commented 1 year ago

Very cool idea! I wasn't aware of this, but this would be a great feature, I agree. I'll see if I can add this as soon as possible.

sixem commented 1 year ago

This update has been pushed to both Chrome and Firefox now.

I've only tested it myself, so I'll leave this issue open for a little bit just in case there are any problems.

MintMain21 commented 1 year ago

When going from one Wikipedia Page to another, there is a "formatless" version of the Wikipedia page that briefly appears while the theme loads.

This is because the extension needs to append the desired URL Parameters to load the correct theme.

There is a way to append URL Parameters to Wikipedia links on Wikipedia pages (as opposed to just appending to Wikipedia links as they load in the window) that overcomes this issues.

I have a userscript that offers this exact functionality if you want an example.

sixem commented 1 year ago

When going from one Wikipedia Page to another, there is a "formatless" version of the Wikipedia page that briefly appears while the theme loads.

This is because the extension needs to append the desired URL Parameters to load the correct theme.

There is a way to append URL Parameters to Wikipedia links on Wikipedia pages (as opposed to just appending to Wikipedia links as they load in the window) that overcomes this issues.

I have a userscript that offers this exact functionality if you want an example.

Yeah, I was thinking of doing something like this before, but the addon should now be intercepting the navigation during the webNavigation.onBeforeNavigate event, which should apply and update the tab with the GET parameter before the page even loads at all. I can't seem to replicate this behavior where the page is briefly unformatted, personally. Any ideas?

MintMain21 commented 1 year ago

What browser do you primarily use? Chrome?

I use Firefox. Beta currently.

sixem commented 1 year ago

What browser do you primarily use? Chrome?

I use Firefox. Beta currently.

Firefox, but I've tested it on Chrome too, both on desktop and in virtual environments, and I've yet to see the GET parameter not being applied before the page is loaded with this new version. The only exception is when searches are being made, where I had to add a flag because the onBeforeNavigate method doesn't work well with 302 redirections, and in those cases it'll just apply it during onCommitted instead (after the search has been completed and redirected), which naturally isn't as instant.

I can notice a small flicker that lasts for a few milliseconds, but I think that's due to the tabs.update call, and that's very, very brief. Is this what you mean?

MintMain21 commented 10 months ago

Another bug I've noticed is that when going back a page, the future page history is lost when hide GET parameters is enabled.

(Also, the flicker doesn't seem to be a thing anymore).