/tabgod

execute any javascript from any browser tab on any browser tabs

Primary LanguageTypeScriptThe UnlicenseUnlicense


tabgod

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")
)

installation

  • 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

usage

  1. choose execution targets by writing a filter function that will include/excluce tabs based on defined criteria
  2. write any js to execute in world of targeted tabs
await tabgod(
  (tab) => {
    return tab.url.includes("example.org")
  },
  () => {
    document.body.style.background = "pink"
  }
)