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

Function getCurrentValue

src/inject/dynamic-theme/stylesheet-proxy.ts:233–238  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231 overrideProperty(Document, 'styleSheets', {
232 get: (native) => function () {
233 const getCurrentValue = () => {
234 const docSheets: StyleSheetList = native.call(this);
235 const filteredSheets = [...docSheets].filter((styleSheet) => styleSheet.ownerNode && !isDRSheet(styleSheet));
236 (filteredSheets as unknown as StyleSheetList).item = (item: number) => filteredSheets[item];
237 return Object.setPrototypeOf(filteredSheets, StyleSheetList.prototype);
238 };
239
240 let elements = getCurrentValue();
241 const styleSheetListBehavior: ProxyHandler<StyleSheetList> = {

Callers 1

injectProxyFunction · 0.85

Calls 1

isDRSheetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…