InjectCode

A Chrome extension for developers who have to deal with sites to which they don't have code side access to. Easily store and inject JavaScript snippets into pages, enhance usability or manipulate data in several open tabs at once.

Version 1.0.0

  • create, edit, delete, sort, name and enable/disable your scripts
  • syntax highlighter and autosave
  • scripts are stored locally and persist throughout sessions
  • run a specific script or all that are marked as active
  • change scope to run scripts on the current or on all open tabs
  • scripts are injected into the pages after document.ready
  • includes jQuery
  • added global function openTab(url) to open a new tab within your script (avoid recursion)
  • added global XhrMonitor object for working with ajax pages

Version 1.1.0

  • added global InjectCode object which is exported into the content pages (allowing to use attached methods in the Chrome console)

Demo video: http://youtu.be/Q0lKLIemP-0.
Source is availalbe at: https://github.com/jaakkytt/InjectCode.
In Chrome web store: https://chrome.google.com/webstore/detail/injectcode/flhghpihapijancfhnicbnjifdodohpi.

Under the hood the project uses jQuery & jQuery UI, CodeMirror and Knockout.

At some later date I will:

  • add a callback parameter to openTab to be fired in the new tab as it opens
  • add the functionality to.. and accommodate a UI distinction between pre and post doc ready scripts

P.S. Would love to hear about any feature ideas or feedback.

Meta

Posted at 11.01.2015 in Projects

Last modified at 01.04.2015

Tagged with: chrome , extension , utility , developer tools , javascript

Discussion

Fabrizio Reply

Fabrizio March 19, 2015

How can I call my custom functions defined into the extension scripts from the console?

Jaak Kütt

Jaak Kütt March 20, 2015

Hi Fabrizio,

The short answer is - currently you can't.

As the documentation on Chrome extensions says "...scripts execute in a special environment called an isolated world..."

There is a (hacky) workaround to that limitation but it has to be built into the extension (I'll try to get to that within a few days) and after that you'd have a global export object onto which you could attach your functions (and other variables?) and access them in the console via that object.

Aaronstent Reply

Aaronstent May 01, 2017

Hello. And Bye.

Leave a Reply

Authenticate with:        Terms, Privacy & TL;DR
*
*