
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
webext-agent
Advanced tools
The webext-agent is a browser extension that enables remote access to WebExtensions APIs. It helps you for automating browser integration and testing.
Install by npm:
$ npm install --save webext-agent # npm
$ yarn add webext-agent # yarn
$ pnpx webext-agent install # pnpm
The webext-agent access the browser via native messaging. It requires a native messaging manifest to be installed to the local. The webext-agent does not install the manifest automatically due to the security reason. You can install it manually by the following command:
$ webext-agent install --addon-ids my-addon1@example.com,my-addon2@example.com,...
Create a new agent add-on:
$ webext-agent create-addon \
--additional-permissions tabs \
--addon-id my-addon@example.com
/tmp/my-agent-addon
and load it via about:config on your Firefox browser.
The agent server starts and you can access APIs by the following JavaScript/TypeScript:
const { connect } = require("webext-agent");
(async () => {
const browser = await connect("my-addon@example.com");
const tabs = await browser.tabs.query({});
tabs.forEach((tab) => {
console.log("[%d] %s - %s", tab.id, tab.title, tab.url)
})
})();
Install a native messaging manifest to the local
$ webext-agent install --addon-ids my-addon1@example.com,my-addon2@example.com,...
Uninstall the installed native messaging manifest from the local.
$ webext-agent uninstall
Check if the native message manifest is installed.
$ webext-agent install
Create a new agent add-on.
$ webext-agent create-addon \
--additional-permissions <permission1>,<permission2>,... \
--addon-id <addon-id> \
[--base-addon <base-addon>] \
<destination>
You can mix-in an agent add-on with your add-ons by --base-addon option.
This is useful to debug or access the internal storage on your add-on.
webext-agent also provides programmatic APIs.
destination Destination directory to create an agent add-on.options
additionalPermissions Additional permissions to be added to the add-on.import { createAgentAddon } from "webext-agent";
const addon = await createAgentAddon("/tmp/my-agent-addon");
console.log(addon.getRoot());
baseAddon The directory location containing a base add-on.destination Destination directory to create an agent add-on.options
additionalPermissions Additional permissions to be added to the add-on.addonId An id of the Addonimport { createMixedInAgentAddon } from "webext-agent";
const addon = await createMixedInAgentAddon("path/to/your/addon", "/tmp/my-new-addon");
console.log(addon.getRoot());
address The address and port the client connect to, address:port in a string, or in a object containing address in a string and port in a number.import { connect } from "webext-agent";
const browser = await connect("127.0.0.1:12345");
const tabs = await browser.tabs.query({});
console.log(tabs);
MIT
FAQs
An agent to enable remote WebExtensions APIs for browsers
We found that webext-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.