@rshaker/context-detect
Version:
Messaging support for inter-context communication
14 lines (13 loc) • 729 B
TypeScript
export declare function getBrowserName(): string;
export declare enum BrowserContextType {
BACKGROUND_WORKER = "background-worker",
DEDICATED_WORKER = "dedicated-worker",
SHARED_WORKER = "shared-worker",
POPUP = "popup",
EXTENSION_PAGE = "extension-page",
ISOLATED_WORLD = "isolated-world",
MAIN_WORLD = "main-world",
UNKNOWN = "unknown"
}
export type BrowserContext = BrowserContextType.BACKGROUND_WORKER | BrowserContextType.DEDICATED_WORKER | BrowserContextType.SHARED_WORKER | BrowserContextType.POPUP | BrowserContextType.EXTENSION_PAGE | BrowserContextType.ISOLATED_WORLD | BrowserContextType.MAIN_WORLD | BrowserContextType.UNKNOWN;
export declare function detectContext(): BrowserContext;