MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / prepareScripts

Function prepareScripts

src/background/utils/preinject.js:468–486  ·  view source on GitHub ↗
(env)

Source from the content-addressed store, hash-verified

466}
467
468function prepareScripts(env) {
469 env[PROMISE] = null; // let GC have it
470 const scripts = env[SCRIPTS];
471 for (let i = 0, script, key, id; i < scripts.length; i++) {
472 script = scripts[i];
473 id = script.id;
474 if (!script[__CODE]) {
475 id = script.props.id;
476 key = S_SCRIPT_PRE + id;
477 script = cache.get(key) || cache.put(key, prepareScript(script, env));
478 scripts[i] = script;
479 }
480 if (script[INJECT_INTO] !== CONTENT) {
481 env[PAGE] = true; // for registerScriptDataFF
482 }
483 script[VALUES] = env[S_VALUE][id] || null;
484 }
485 return scripts;
486}
487
488/**
489 * @param {VMScript} script

Callers 2

InjectionFeedbackFunction · 0.85
prepareBagFunction · 0.85

Calls 2

prepareScriptFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected