Socket
Book a DemoInstallSign in
Socket

chrome-tab-identifier

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-tab-identifier

Simple utility to fetch the current tab id inside a content-script.

0.0.1
latest
npmnpm
Version published
Weekly downloads
2
-60%
Maintainers
1
Weekly downloads
 
Created
Source

chrome-tab-identifier

Simple utility to fetch the current tab id inside a content-script.

Install

npm install --save chrome-tab-identifier

Usage

On your event page:

import { TabIdentifier } from "chrome-tab-identifier";

const tabIdentifier = new TabIdentifier();

Then, on your content script:

import { TabIdentifierClient } from "chrome-tab-identifier";

const tabIdClient = new TabIdentifierClient();

tabIdClient.getTabId().then(tabId => {});

Advanced Usage

By default, this package will use a message with the type property set to "__TAB_ID__". If you need to use your own type for whatever reason, you can just pass it as the first argument to both the identifier and the client:

new TabIdentifier("custom-type");
// ...
new TabIdentifierClient("custom-type");

Please note: If you do this and don't use the same string in both the identifier and client, then this won't work.

FAQs

Package last updated on 17 Jan 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.