Fixed readyStateCompleteListeners never flushing when initialized after DOM ready - #15571
Fixed readyStateCompleteListeners never flushing when initialized after DOM ready#15571KamilDev wants to merge 1 commit into
Conversation
|
Unfortunately this will have negative effect on websites that load slowly (or when the internet connection is slow), as it postpones certain mechanisms until the state is complete (all style sheets and images finished loading). Particularly, this check is used to remove the fallback style, which is inserted to prevent white flashes. Is your SVG dynamically generated? Dark Reader is supposed to watch for DOM and inline style changes, but maybe there's a bug. Also this SVG analysis is not perfect, maybe switching it off completely will work better for you. E.g. by supplying a "fix" argument like |
Fixes #15570
The readystatechange listener in dom.ts was only registered when the module initialized before readyState "interactive". When the API is enabled from a deferred page script, initialization happens at "interactive", so
readyStateCompleteListeners(deferred SVG fill overrides, image loads) never ran. Register the listener while readyState is not yet "complete" instead. The handler already deals with both flush stages, and nothing changes for the extension, which initializes at document_start.