Shoyru
02-21-2019, 09:09 PM
Hi!
I want to be able to change my theme to something more tailored to myself (getting rid of borders on certain classes, changing background colors, etc etc) but I seem to be running into some issues getting my script to run successfully.
Huge warning though: I barely understand Javascript and a lot of things I write are frankenscripts from other scripts people write
I like w35l3y's "use any theme" script, but the 'blink' of the old theme before loading the replacement is... annoying. And I'd like it to be more accessible for me to change things from time to time, and looking at that code I feel lost, LOL.
I've been trying to set CSS rules with Run-at document-start but I guess the actual CSS loading after my script is overwriting it? I don't actually know the problem.
// ==UserScript==
// name Neopets Theme Fixes
[Only registered and activated users can see links]
// Description little adjustments to make Neopets suck to look at less
[Only registered and activated users can see links]
[Only registered and activated users can see links]
// Run-at document-start
// ==/UserScript==
function addStyleString(str) {
var node = document.createElement('style');
node.innerHTML = str;
document.body.appendChild(node);
}
addStyleString('.sidebarModule { border:0px !important; }');
addStyleString('.sidebarTable { border:0px !important; }');
addStyleString('.sidebarHeader { border:0px !important; }');
Like, this doesn't work at all. It DOES work, however, if I set it as document-end, but that causes a blink as I see the original CSS load first...
tl;dr is there a way to edit the way Neopets looks without waiting for the entire page to load first
I want to be able to change my theme to something more tailored to myself (getting rid of borders on certain classes, changing background colors, etc etc) but I seem to be running into some issues getting my script to run successfully.
Huge warning though: I barely understand Javascript and a lot of things I write are frankenscripts from other scripts people write
I like w35l3y's "use any theme" script, but the 'blink' of the old theme before loading the replacement is... annoying. And I'd like it to be more accessible for me to change things from time to time, and looking at that code I feel lost, LOL.
I've been trying to set CSS rules with Run-at document-start but I guess the actual CSS loading after my script is overwriting it? I don't actually know the problem.
// ==UserScript==
// name Neopets Theme Fixes
[Only registered and activated users can see links]
// Description little adjustments to make Neopets suck to look at less
[Only registered and activated users can see links]
[Only registered and activated users can see links]
// Run-at document-start
// ==/UserScript==
function addStyleString(str) {
var node = document.createElement('style');
node.innerHTML = str;
document.body.appendChild(node);
}
addStyleString('.sidebarModule { border:0px !important; }');
addStyleString('.sidebarTable { border:0px !important; }');
addStyleString('.sidebarHeader { border:0px !important; }');
Like, this doesn't work at all. It DOES work, however, if I set it as document-end, but that causes a blink as I see the original CSS load first...
tl;dr is there a way to edit the way Neopets looks without waiting for the entire page to load first