MCPcopy Create free account
hub / github.com/anilkumarum/mark-clipper / injectFuncScript

Function injectFuncScript

background/util.js:80–92  ·  view source on GitHub ↗
(func, ...args)

Source from the content-addressed store, hash-verified

78
79/**@param {(...args: any[]) => any} func*/
80export async function injectFuncScript(func, ...args) {
81 const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
82 try {
83 const results = await chrome.scripting.executeScript({
84 target: { tabId: tab.id },
85 func: func,
86 args: args,
87 });
88 return results[0].result;
89 } catch (error) {
90 console.error(error);
91 }
92}
93
94export async function reportBug(error) {
95 const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });

Callers 1

getPageTitleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected