execute any javascript from any browser tab on any browser tabs
what you get in all devtools consoles:
async function tabgod(
tabFilterFunc: (tab: chrome.tabs.Tab) => boolean,
exeFunc: () => unknown
): Promise<unknown[]> {
//
}
example:
await tabgod(
(tab) => tab.url.includes("example.org"),
() => (document.querySelector("h1").innerText = "tabgod")
)
- clone repo
- goto your-chromium-based-browser://extensions/
- example: arc://extensions/
- make sure to have 'Developer mode' enabled
- 'Load unpacked' choose path to ./dist of repo
- choose execution targets by writing a filter function that will include/excluce tabs based on defined criteria
- write any js to execute in world of targeted tabs
await tabgod(
(tab) => {
return tab.url.includes("example.org")
},
() => {
document.body.style.background = "pink"
}
)