UNPKG

webext-active-tab

Version:

WebExtension module: Track `activeTab` permission; automatically inject content scripts

27 lines (26 loc) 1.04 kB
import { StorageItemMap } from 'webext-storage'; type TabId = number; type Origin = string; export type ActiveTab = { id: TabId; origin: Origin; }; /** * The list is not guaranteed to be up to date. The activeTab permission might be lost before it's detected. */ export declare const possiblyActiveTabs: StorageItemMap<string, string | undefined> | Map<string, string>; declare function startActiveTabTracking(): void; declare function stopActiveTabTracking(): void; export declare const PRIVATE: { startActiveTabTracking: typeof startActiveTabTracking; stopActiveTabTracking: typeof stopActiveTabTracking; }; export declare const onActiveTab: { addListener(callback: (tab: ActiveTab) => void): void; removeListener: (callback: import("simple-event-target").SimpleEventListener<ActiveTab>) => void; }; export declare const onActiveTabLost: { addListener(callback: (tabId: TabId) => void): void; removeListener: (callback: import("simple-event-target").SimpleEventListener<number>) => void; }; export {};