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

Function UpdateValue

src/background/utils/values.js:39–54  ·  view source on GitHub ↗
(what, src)

Source from the content-addressed store, hash-verified

37
38addPublicCommands({
39 UpdateValue(what, src) {
40 for (const id in what) {
41 const values = objectGet(openers, [id, src.tab.id, getFrameDocIdFromSrc(src)]);
42 // preventing the weird case of message arriving after the page navigated
43 if (!values) return;
44 const hub = nest(toSend, id);
45 const data = what[id];
46 for (const key in data) {
47 const raw = data[key];
48 if (raw) values[key] = raw; else delete values[key];
49 hub[key] = raw || null;
50 }
51 toCommit[S_VALUE_PRE + id] = values;
52 }
53 toCommitPending ??= setTimeout(commit);
54 },
55});
56
57export function clearValueOpener(tabId, frameId) {

Callers

nothing calls this directly

Calls 3

objectGetFunction · 0.90
getFrameDocIdFromSrcFunction · 0.90
nestFunction · 0.90

Tested by

no test coverage detected