Recently Wikia/Fandom has released a new design for their site that looks absolutely dreadful and they're slowly forcing it as the default skin for all of their wikis. Users can still log in and select the Oasis skin but this only changes the appearance of the site as long as they're logged in. The moment the user logs out, or if they're just looking at a wiki with no need to sign in, they're stuck using the new design. This can easily be remedied by adding ?useskin=oasis to the end of a Wikia page's URL, but it has to be done every time you go to a new page.
I need a script for Violentmonkey/Tampermonkey that will automatically add ?useskin=oasis to the end of all wikia URLs so that I can use the Oasis skin even while I'm not logged in.
I've tried modifying the old Youtube Polymer Disable script as it performed a similar action but it didn't work. And I've tried this, which adds ?useskin=oasis to the url but keeps adding it repeatedly and reloading the page.
// ==UserScript==
// @name Oasis Wikia
// @match *://*.fandom.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
var oldUrlPath = window.location.pathname;
*/
if ( ! /\?useskin=oasis$/.test (oldUrlPath) ) {
var newURL = window.location.protocol + "//"
+ window.location.host
+ oldUrlPath + "?useskin=oasis"
+ window.location.search
+ window.location.hash
;
/*-- replace() puts the good page in the history instead of the
bad page.
*/
window.location.replace (newURL);
}