🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

webext-tools

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webext-tools

Utility functions for Web Extensions

latest
Source
npmnpm
Version
4.1.0
Version published
Weekly downloads
10K
-13.77%
Maintainers
1
Weekly downloads
 
Created
Source

webext-tools npm version

Utility functions for Web Extensions

  • Browsers: Chrome, Firefox, and Safari
  • Manifest: v3

Sponsored by PixieBrix :tada:

Install

npm install webext-tools

Or download the standalone bundle to include in your manifest.json.

Usage

This package exports various utilities. Each tool has its own entry point, so you only import what you need:

import doesTabExist from 'webext-tools/does-tab-exist.js';
import getExtensionUrl from 'webext-tools/get-extension-url.js';
  • doesTabExist - Checks whether a tab exists.
  • getExtensionUrl - Generates a URL object for a resource bundled with the extension.
  • getTabUrl - Get a tab or frame’s URL even with limited permissions.
  • queryTabsByUrl - Get the IDs of tabs matching URL patterns.
  • setActionPopup - Sets the popup URL (or removes the popup) depending on the current tab.
  • createContextMenu - Creates context menus without pain.
  • devToolsEval - Wrapper around the DevTools eval function that throws proper errors.
  • addOptionsContextMenu was moved to webext-bugs.
  • webext-events - High-level events and utilities for events in Web Extensions.
  • webext-base-css - Extremely minimal stylesheet/setup for Web Extensions’ options pages (also dark mode)
  • webext-options-sync - Helps you manage and autosave your extension's options.
  • webext-detect - Detects where the current browser extension code is being run.
  • More…

License

MIT © Federico Brigante

Keywords

extension

FAQs

Package last updated on 11 Jul 2026

Did you know?

Socket

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.

Install

Related posts