0

I'm trying to insert some css and JS with an extension to prevent a DOM element from being painted onto the screen

I have tried webNavigation.onCommitted event and injecting css/js as well as contentScripts.register (w/ polyfill for chrome) with runAt: "document_start"

My code is definitely running, just too slow and the DOM element in question flashes into and out of existence.

Thank you

David Furlong
  • 1,343
  • 1
  • 12
  • 15
  • 1
    This is definitely a problem that needs a proper [MCVE](/help/mcve) because usually it just works, here's a [random example](/a/39618852). I suggest switching to the native content_scripts declaration instead of polyfills or use chrome.declarativeContent directly with RequestContentScript action which works in stable Chrome despite the warning in the documentation. – wOxxOm Nov 08 '20 at 19:16
  • I just did a test and - a 1 line id selector contentscript css caused no flash - a 10 line nested children selector contentscript css caused a flash that makes intuitive sense if the selector doesn't match until more DOM elements are added onto the page. – David Furlong Nov 08 '20 at 21:48

0 Answers0