New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/webextension-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/webextension-polyfill

TypeScript definitions for webextension-polyfill

  • 0.10.0
  • ts4.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
122K
decreased by-17.78%
Maintainers
1
Weekly downloads
 
Created

What is @types/webextension-polyfill?

@types/webextension-polyfill provides TypeScript type definitions for the webextension-polyfill library, which is a cross-browser polyfill for the WebExtension API. This allows developers to write browser extensions using a consistent API across different browsers, such as Chrome, Firefox, and Edge.

What are @types/webextension-polyfill's main functionalities?

Browser API

This feature allows you to interact with the browser's tabs. The code sample demonstrates how to create a new tab with a specified URL and log the ID of the created tab.

browser.tabs.create({ url: 'https://example.com' }).then((tab) => console.log(`Created tab: ${tab.id}`));

Storage API

This feature provides access to the browser's storage system. The code sample shows how to save data to the local storage and log a confirmation message once the data is saved.

browser.storage.local.set({ key: 'value' }).then(() => console.log('Data saved'));

Runtime API

This feature allows you to handle messages sent to the extension. The code sample demonstrates how to set up a listener for incoming messages and log the received message.

browser.runtime.onMessage.addListener((message) => { console.log(`Received message: ${message}`); });

Other packages similar to @types/webextension-polyfill

FAQs

Package last updated on 12 Jan 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc