Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/chrome

Package Overview
Dependencies
Maintainers
1
Versions
262
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/chrome

TypeScript definitions for Chrome extension development

  • 0.0.26-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
534K
decreased by-40.43%
Maintainers
1
Weekly downloads
 
Created

What is @types/chrome?

@types/chrome provides TypeScript definitions for the Chrome extension APIs, allowing developers to write Chrome extensions with type safety and autocompletion in TypeScript.

What are @types/chrome's main functionalities?

Tabs API

The Tabs API allows you to interact with the browser's tab system. This example demonstrates how to create a new tab and log the details of the created tab.

chrome.tabs.create({ url: 'https://www.example.com' }, (tab) => { console.log('New tab created:', tab); });

Storage API

The Storage API provides a way to store, retrieve, and track changes to user data. This example shows how to set a value in the storage.

chrome.storage.sync.set({ key: 'value' }, () => { console.log('Value is set to 'value''); });

Runtime API

The Runtime API allows you to manage your extension's lifecycle events. This example demonstrates how to listen for the installation event of the extension.

chrome.runtime.onInstalled.addListener(() => { console.log('Extension installed'); });

Alarms API

The Alarms API allows you to schedule code to run at a specific time in the future. This example shows how to create an alarm and listen for when it triggers.

chrome.alarms.create('myAlarm', { delayInMinutes: 1 }); chrome.alarms.onAlarm.addListener((alarm) => { console.log('Alarm triggered:', alarm); });

Notifications API

The Notifications API allows you to create and manage notifications. This example demonstrates how to create a notification and log its ID.

chrome.notifications.create('notificationId', { type: 'basic', iconUrl: 'icon.png', title: 'Notification Title', message: 'Notification message' }, (notificationId) => { console.log('Notification created:', notificationId); });

Other packages similar to @types/chrome

FAQs

Package last updated on 03 Jul 2016

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