1 | export declare function disableWebextDetectPageCache(): void;
|
2 | /** Indicates whether the code is being run on http(s):// pages (it could be in a content script or regular web context) */
|
3 | export declare const isWebPage: () => boolean;
|
4 | /** Indicates whether you're in extension contexts that have access to the chrome API */
|
5 | export declare const isExtensionContext: () => boolean;
|
6 | /** Indicates whether you're in a sandboxed page (-extension:// URL protocol, but no chrome.* API access) */
|
7 | export declare const isSandboxedPage: () => boolean;
|
8 | /** Indicates whether you're in a content script. Note that the MAIN world is not considered a content script. */
|
9 | export declare const isContentScript: () => boolean;
|
10 | /** Indicates whether you're in a background context */
|
11 | export declare const isBackground: () => boolean;
|
12 | /** Indicates whether you're in a background page */
|
13 | export declare const isBackgroundPage: () => boolean;
|
14 | /** Indicates whether you're in a background worker */
|
15 | export declare const isBackgroundWorker: () => boolean;
|
16 | /** Indicates whether you're in a persistent background page (as opposed to an Event Page or Background Worker, both of which can be unloaded by the browser) */
|
17 | export declare const isPersistentBackgroundPage: () => boolean;
|
18 | /** Indicates whether you're in an options page. This only works if the current page’s URL matches the one specified in the extension's `manifest.json` */
|
19 | export declare const isOptionsPage: () => boolean;
|
20 | /** Indicates whether you're in a side panel. This only works if the current page’s URL matches the one specified in the extension's `manifest.json` */
|
21 | export declare const isSidePanel: () => boolean;
|
22 | export declare const isActionPopup: () => boolean;
|
23 | /** Indicates whether you're in the main dev tools page, the one specified in the extension's `manifest.json` `devtools_page` field. */
|
24 | export declare const isMainDevToolsPage: () => boolean;
|
25 | /** @deprecated Use `isMainDevToolsPage` instead */
|
26 | export declare const isDevToolsPage: () => boolean;
|
27 | /** Indicates whether you're in the dev tools page. Unlike `isDevToolsPage`, this works in any page that has the `chrome.devTools` API */
|
28 | export declare const isDevTools: () => boolean;
|
29 | /** Indicates whether you're in a document created via chrome.offscreen */
|
30 | export declare const isOffscreenDocument: () => boolean;
|
31 | /** Loosely detect Firefox via user agent */
|
32 | export declare const isFirefox: () => boolean;
|
33 | /** Loosely detect Chrome via user agent (might also include Chromium and forks like Opera) */
|
34 | export declare const isChrome: () => boolean;
|
35 | /** Loosely detect Safari via user agent */
|
36 | export declare const isSafari: () => boolean;
|
37 | /** Loosely detect Mobile Safari via user agent */
|
38 | export declare const isMobileSafari: () => boolean;
|
39 | declare const contextChecks: {
|
40 | readonly contentScript: () => boolean;
|
41 | readonly background: () => boolean;
|
42 | readonly options: () => boolean;
|
43 | readonly sidePanel: () => boolean;
|
44 | readonly actionPopup: () => boolean;
|
45 | readonly devTools: () => boolean;
|
46 | readonly devToolsPage: () => boolean;
|
47 | readonly offscreenDocument: () => boolean;
|
48 | readonly extension: () => boolean;
|
49 | readonly sandbox: () => boolean;
|
50 | readonly web: () => boolean;
|
51 | };
|
52 | export type ContextName = keyof typeof contextChecks;
|
53 | export declare const contextNames: ContextName[];
|
54 | /** Returns the first matching context among those defined in `ContextName`, depending on the current context. Returns "unknown" if no match is found. */
|
55 | export declare function getContextName(): ContextName | 'unknown';
|
56 | export {};
|