Giter VIP home page Giter VIP logo

devidw / tabgod Goto Github PK

View Code? Open in Web Editor NEW
150.0 3.0 6.0 1.89 MB

execute any javascript on any chromium tabs - cross-tab parallel execution

Home Page: https://chromewebstore.google.com/detail/hllgifenolhiihoihflfghkfaefpjdbg

License: The Unlicense

TypeScript 100.00%
browser-extension chrome-devtools-extension chrome-extension devtool devtools devtools-extension extension-chrome tabs-management

tabgod's Introduction

execute any javascript on any chromium tabs

  • adds options page with tabgod() function
async function tabgod(
  tabFilterFunc: (tab: chrome.tabs.Tab, ...args: unknown[]) => boolean,
  exeFunc: (...args: unknown[]) => unknown,
  options?: {
    tabFilterArgs?: unknown[];
    exeArgs?: unknown[];
    evalAdd?: string;
  },
): Promise<{ tabId: number; result: unknown }[]> {
  //
}

examples

having chatgpt and pi talk to each other

demo.mp4

searching same query on multiple search engines

usage

  1. open extensions options page
  2. open devtools console
  3. use provided tabgod() function
    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
tabgod(
  (tab) => tab.url.includes("example.org"),
  () => document.body.style.background = "pink",
);

notes on first release

  • initial idea was to make tabgod function available in all devtools consoles for easy and direct access for developers right from every console
  • the implementation added tabgod to the global window object
  • however this introduced a serious security issue, since this has made the function available to websites also, allowing them to interact with other tabs, destroying the idea of secure tab origins
  • thanks to danielsmc pointing it out
  • this has been immediately addressed by moving the function only to the options page of the extension, and not accepting external connections in the service worker

tabgod's People

Contributors

devidw avatar erjanmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tabgod's Issues

Fundamental Security Issue

Defining window.tabgod() doesn't just mean you can call it from devtools. It means that any JavaScript running on the page can call it. This, of course, completely destroys the same-origin policy that is central to browser security. If this is somehow the intended behavior, there should be a very prominent warning not to install this except in specialized development environments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.