MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / detectCanClick

Function detectCanClick

scripts/helpers/scriptDetection.js:44–53  ·  view source on GitHub ↗
(script)

Source from the content-addressed store, hash-verified

42 * Detect if script has onClick capability
43 */
44export function detectCanClick(script) {
45 for (let context of CONTEXTS) {
46 for (let fn of injectAllFramesFns(["onClick"])) {
47 if (typeof script[context]?.[fn] === "function") {
48 return true;
49 }
50 }
51 }
52 return false;
53}
54
55/**
56 * Detect if script can auto-run

Callers 1

canClickFunction · 0.90

Calls 1

injectAllFramesFnsFunction · 0.85

Tested by

no test coverage detected