Skip to content

Customize remote websites. This extension injects your Javascript- or CSS-based modifications on every visit. Also supports URL rewriting using regular expressions.

License

Notifications You must be signed in to change notification settings

andre-st/chrome-injectjs

Repository files navigation

Tiny Javascript Injector for Google Chrome, v0.8.3

Maintenance

Customize someone else's site when it's missing display options or features. What's new?

There are prettier code injection extensions, e.g., Dmitry Novikov's "User Javascript and CSS". However, you give "sqdevil@yandex.ru", "junkycoder" etc. full control over everything you read on the web. You could also try userscript managers such as Violentmonkey or Tampermonkey, with scripts from Greasyfork or OpenUserJS.

Chrome content scripts can modify websites, e.g. political content, and exfiltrate private information. So I made my own extension, which is small and easy to inspect if you consider using it.

This extension also helps replace smaller Chrome extensions such as Rubén Martínez's "Goodreads Ratings for Amazon" by adding an equivalent function to the mixins script. The fewer strangers fiddling with my browser, the better.

Program Features and Screenshots

  • supports URL redirections (replaces Einar Egilsson's Redirector extension)

  • no automatic updates (unlike this or this adware buy-out), see Installation section

  • tiny, kept to the bare minimum = little maintenance

  • easy to inspect if you consider using it -- no 3rd party libs, nothing minified, small files

  • apart from Tab for indentation, Ctrl+S for saving, Ctrl+Space for simple autocompletion and a few helper functions such as getUrl() and saveUrl(), it lacks any comfort and visual beauty: no syntax highlighting or validation (no Ace editor, jslint, ...); the browser console, however, proved sufficient for debugging

  • inject CSS or Javascript, for example:

  • flexible and easy to extend due to its script-based configuration (rather than having a complex UI that tries to be as flexible as a programming language just use a programming language); you can add comments everywhere, too

    Screenshot

  • your mixin scripts run in the context of the target website

    • so you can not just access its DOM, but its Javascript variables and functions too
    • the targeted website cannot easily hijack your extension
    • everything outside mixin() runs in the context of the extension, with other privileges
  • export/import = copy/paste the content of the text area

Installation

  1. not available in Chrome's Web Store
  2. you cannot easily install CRX-files permanently from other sites
  3. clone Git repository or save as Zip-file
  4. Chrome > Settings > Extensions > [x] Developer mode (upper right corner)
  5. Chrome > Settings > Extensions > click Load unpacked extension
  6. browse to the source directory of the downloaded, unarchived release and confirm

Feedback

Use GitHub or see AUTHORS.md file