MCPcopy
hub / github.com/Tampermonkey/tampermonkey / cleanRequireCache

Function cleanRequireCache

src/background.js:410–431  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

408};
409
410var cleanRequireCache = function() {
411 if (V || CV) console.log("cache: check");
412 var t = (new Date()).getTime() - cacheValidPeriod;
413 var d = [];
414 for (var k in requireCache) {
415 if (!requireCache.hasOwnProperty(k)) continue;
416 var i = requireCache[k];
417 if (i && i.ts) {
418 if (i.ts < t) {
419 d.push(k);
420 }
421 }
422 }
423
424 for (var k in d) {
425 if (!d.hasOwnProperty(k)) continue;
426 delete requireCache[d[k]];
427 if (V || CV) console.log("cache: remove '" + d[k] + "'");
428 }
429
430 window.setTimeout(cleanRequireCache, cacheCheckPeriod);
431};
432
433cleanRequireCache();
434

Callers 1

background.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…