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

Function onCodeSet

src/injected/web/index.js:131–146  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

129});
130
131function onCodeSet(fn) {
132 const item = toRun[fn.name];
133 const el = document::getCurrentScript();
134 const { gm, wrapper = global, grantless } = makeGmApiWrapper(item);
135 if (grantless) grantlessUsage[item.id] = grantless;
136 // Deleting now to prevent interception via DOMNodeRemoved on el::remove()
137 delete window[item.key.win];
138 if (process.env.DEBUG) {
139 log('info', [bridge.mode], item.displayName);
140 }
141 if (el) {
142 el::remove();
143 }
144 bridge.post('Run', item.id);
145 wrapper::fn(gm, logging.error);
146}

Callers

nothing calls this directly

Calls 2

logFunction · 0.50
removeFunction · 0.50

Tested by

no test coverage detected