MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / dispatchCmd

Function dispatchCmd

example/tests/gm_value_test.js:1073–1090  ·  view source on GitHub ↗
(targetId, cmd)

Source from the content-addressed store, hash-verified

1071
1072 /* ── dispatchCmd ───────────────────────────────────────── */
1073 function dispatchCmd(targetId, cmd) {
1074 if (targetId === 'main') {
1075 window._gmtest_mainDispatch(cmd);
1076 return;
1077 }
1078
1079 const win = iframeWindows[targetId];
1080
1081 if (win) {
1082 sendCmd(win, cmd, {});
1083 } else {
1084 appendLog(targetId, {
1085 t: nowTime(),
1086 msg: '⚠️ iframe not ready yet — try again',
1087 type: 'warn',
1088 });
1089 }
1090 }
1091
1092 /* ── UI helpers ─────────────────────────────────────────── */
1093 function appendLog(fid, entry) {

Callers 1

gm_value_test.jsFile · 0.85

Calls 3

sendCmdFunction · 0.85
appendLogFunction · 0.85
nowTimeFunction · 0.85

Tested by

no test coverage detected