chrx

CommonJS modules for developing Chrome Extensions

chrx

chrx is a collection of CommonJS modules for developing Chrome Extensions. The chrome.* APIs provided in Chrome are powerful, but their complexity can make simple tasks rather difficult. This project is an attempt to collect some common abstractions and distribute them via npm.

tabs

window

Gets the active tab in the active window.

chrx.tabs.getActive(function(errtab){})
  • protocol

Executes content scripts in a tab.

chrx.tabs.executeScripts({
    tab: tab,
    scripts: ['underscore.js', 'jquery.js']
}, function(errtab){})
  • tab (required)
  • scripts (required)
  • runAt

Executes content scripts in the active tab.

chrx.tabs.executeScriptsInActive({
    scripts: ['underscore.js', 'jquery.js']
}, function(errtab){})
  • scripts (required)
  • runAt

Gets the active window.

chrx.window.getActive(function(errwin){})

MIT License, see LICENSE for details.