MCPcopy Create free account
hub / github.com/darkreader/darkreader / onReadyStateChange

Function onReadyStateChange

src/inject/utils/dom.ts:246–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

244
245if (!isDOMReady()) {
246 const onReadyStateChange = () => {
247 if (isDOMReady()) {
248 readyStateListeners.forEach((listener) => listener());
249 readyStateListeners.clear();
250 if (isReadyStateComplete()) {
251 document.removeEventListener('readystatechange', onReadyStateChange);
252 readyStateCompleteListeners.forEach((listener) => listener());
253 readyStateCompleteListeners.clear();
254 }
255 }
256 };
257
258 // readystatechange event is not cancellable and does not bubble
259 document.addEventListener('readystatechange', onReadyStateChange);

Callers

nothing calls this directly

Calls 4

isDOMReadyFunction · 0.85
listenerFunction · 0.85
isReadyStateCompleteFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…