MCPcopy Index your code
hub / github.com/darkreader/darkreader / setupNodePositionWatcher

Function setupNodePositionWatcher

src/inject/dynamic-theme/index.ts:82–85  ·  view source on GitHub ↗
(node: Node, alias: string, callback?: () => void)

Source from the content-addressed store, hash-verified

80const nodePositionWatchers = new Map<string, ReturnType<typeof watchForNodePosition>>();
81
82function setupNodePositionWatcher(node: Node, alias: string, callback?: () => void) {
83 nodePositionWatchers.has(alias) && nodePositionWatchers.get(alias)!.stop();
84 nodePositionWatchers.set(alias, watchForNodePosition(node, 'head', callback));
85}
86
87function stopStylePositionWatchers() {
88 forEach(nodePositionWatchers.values(), (watcher) => watcher.stop());

Callers 1

injectStaticStyleFunction · 0.85

Calls 5

watchForNodePositionFunction · 0.90
stopMethod · 0.65
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected