StackOverflowFilters icon indicating copy to clipboard operation
StackOverflowFilters copied to clipboard

working very slowly

Open svonjoi opened this issue 3 years ago • 1 comments

Thanks for publishing this :)

it works slowly, if put the css content directly, works much faster. But still not clean cus first loads default css and the change is visible in each page.. Any ideas?

(function() {
    'use strict';
    const style = document.createElement('style');
    style.textContent = `css...........`;
    document.head.appendChild(style);
    document.body.classList.add("theme-custom", "theme-bookface");
})();

svonjoi avatar Apr 10 '22 12:04 svonjoi

Add @run-at document-start to the header. Also I assume you are only adding the custom theme CSS to your script, and not the entire document? That would be only the rules starting with body.theme-custom.theme-bookface.

Pulling a document from archive.org was certainly the easiest way to do this as a userscript, but nowhere near the best.

miken32 avatar May 04 '22 18:05 miken32