@types/chrome 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chrome/README.md +1 -1
- chrome/index.d.ts +159 -156
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Wed, 03 Sep 2025 07:03:15 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
|
14
14
|
# Credits
|
chrome/index.d.ts
CHANGED
@@ -2086,7 +2086,12 @@ declare namespace chrome {
|
|
2086
2086
|
*/
|
2087
2087
|
export namespace cookies {
|
2088
2088
|
/** A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' corresponds to a cookie set with 'SameSite=None', 'lax' to 'SameSite=Lax', and 'strict' to 'SameSite=Strict'. 'unspecified' corresponds to a cookie set without the SameSite attribute. **/
|
2089
|
-
export
|
2089
|
+
export enum SameSiteStatus {
|
2090
|
+
NO_RESTRICTION = "no_restriction",
|
2091
|
+
LAX = "lax",
|
2092
|
+
STRICT = "strict",
|
2093
|
+
UNSPECIFIED = "unspecified",
|
2094
|
+
}
|
2090
2095
|
|
2091
2096
|
/** Represents information about an HTTP cookie. */
|
2092
2097
|
export interface Cookie {
|
@@ -2107,8 +2112,8 @@ declare namespace chrome {
|
|
2107
2112
|
session: boolean;
|
2108
2113
|
/** True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie). */
|
2109
2114
|
hostOnly: boolean;
|
2110
|
-
/**
|
2111
|
-
expirationDate?: number
|
2115
|
+
/** The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies. */
|
2116
|
+
expirationDate?: number;
|
2112
2117
|
/** The path of the cookie. */
|
2113
2118
|
path: string;
|
2114
2119
|
/** True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). */
|
@@ -2119,10 +2124,13 @@ declare namespace chrome {
|
|
2119
2124
|
* The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests).
|
2120
2125
|
* @since Chrome 51
|
2121
2126
|
*/
|
2122
|
-
sameSite: SameSiteStatus
|
2127
|
+
sameSite: `${SameSiteStatus}`;
|
2123
2128
|
}
|
2124
2129
|
|
2125
|
-
/**
|
2130
|
+
/**
|
2131
|
+
* Represents a partitioned cookie's partition key.
|
2132
|
+
* @since Chrome 119
|
2133
|
+
*/
|
2126
2134
|
export interface CookiePartitionKey {
|
2127
2135
|
/**
|
2128
2136
|
* Indicates if the cookie was set in a cross-cross site context. This prevents a top-level site embedded in a cross-site context from accessing cookies set by the top-level site in a same-site context.
|
@@ -2142,31 +2150,31 @@ declare namespace chrome {
|
|
2142
2150
|
}
|
2143
2151
|
|
2144
2152
|
export interface GetAllDetails {
|
2145
|
-
/**
|
2153
|
+
/** Restricts the retrieved cookies to those whose domains match or are subdomains of this one. */
|
2146
2154
|
domain?: string | undefined;
|
2147
|
-
/**
|
2155
|
+
/** Filters the cookies by name. */
|
2148
2156
|
name?: string | undefined;
|
2149
2157
|
/**
|
2150
2158
|
* The partition key for reading or modifying cookies with the Partitioned attribute.
|
2151
2159
|
* @since Chrome 119
|
2152
2160
|
*/
|
2153
2161
|
partitionKey?: CookiePartitionKey | undefined;
|
2154
|
-
/**
|
2162
|
+
/** Restricts the retrieved cookies to those that would match the given URL. */
|
2155
2163
|
url?: string | undefined;
|
2156
|
-
/**
|
2164
|
+
/** The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. */
|
2157
2165
|
storeId?: string | undefined;
|
2158
|
-
/**
|
2166
|
+
/** Filters out session vs. persistent cookies. */
|
2159
2167
|
session?: boolean | undefined;
|
2160
|
-
/**
|
2168
|
+
/** Restricts the retrieved cookies to those whose path exactly matches this string. */
|
2161
2169
|
path?: string | undefined;
|
2162
|
-
/**
|
2170
|
+
/** Filters the cookies by their Secure property. */
|
2163
2171
|
secure?: boolean | undefined;
|
2164
2172
|
}
|
2165
2173
|
|
2166
2174
|
export interface SetDetails {
|
2167
|
-
/**
|
2175
|
+
/** The domain of the cookie. If omitted, the cookie becomes a host-only cookie. */
|
2168
2176
|
domain?: string | undefined;
|
2169
|
-
/**
|
2177
|
+
/** The name of the cookie. Empty by default if omitted. */
|
2170
2178
|
name?: string | undefined;
|
2171
2179
|
/**
|
2172
2180
|
* The partition key for reading or modifying cookies with the Partitioned attribute.
|
@@ -2175,26 +2183,29 @@ declare namespace chrome {
|
|
2175
2183
|
partitionKey?: CookiePartitionKey | undefined;
|
2176
2184
|
/** The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. */
|
2177
2185
|
url: string;
|
2178
|
-
/**
|
2186
|
+
/** The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store. */
|
2179
2187
|
storeId?: string | undefined;
|
2180
|
-
/**
|
2188
|
+
/** The value of the cookie. Empty by default if omitted. */
|
2181
2189
|
value?: string | undefined;
|
2182
|
-
/**
|
2190
|
+
/** The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. */
|
2183
2191
|
expirationDate?: number | undefined;
|
2184
|
-
/**
|
2192
|
+
/** The path of the cookie. Defaults to the path portion of the url parameter. */
|
2185
2193
|
path?: string | undefined;
|
2186
|
-
/**
|
2194
|
+
/** Whether the cookie should be marked as HttpOnly. Defaults to false. */
|
2187
2195
|
httpOnly?: boolean | undefined;
|
2188
|
-
/**
|
2196
|
+
/** Whether the cookie should be marked as Secure. Defaults to false. */
|
2189
2197
|
secure?: boolean | undefined;
|
2190
2198
|
/**
|
2191
|
-
*
|
2199
|
+
* The cookie's same-site status. Defaults to "unspecified", i.e., if omitted, the cookie is set without specifying a SameSite attribute.
|
2192
2200
|
* @since Chrome 51
|
2193
2201
|
*/
|
2194
|
-
sameSite?: SameSiteStatus | undefined;
|
2202
|
+
sameSite?: `${SameSiteStatus}` | undefined;
|
2195
2203
|
}
|
2196
2204
|
|
2197
|
-
/**
|
2205
|
+
/**
|
2206
|
+
* Details to identify the cookie.
|
2207
|
+
* @since Chrome 88
|
2208
|
+
*/
|
2198
2209
|
export interface CookieDetails {
|
2199
2210
|
/** The name of the cookie to access. */
|
2200
2211
|
name: string;
|
@@ -2214,11 +2225,8 @@ declare namespace chrome {
|
|
2214
2225
|
cookie: Cookie;
|
2215
2226
|
/** True if a cookie was removed. */
|
2216
2227
|
removed: boolean;
|
2217
|
-
/**
|
2218
|
-
|
2219
|
-
* The underlying reason behind the cookie's change.
|
2220
|
-
*/
|
2221
|
-
cause: string;
|
2228
|
+
/** The underlying reason behind the cookie's change. */
|
2229
|
+
cause: `${OnChangedCause}`;
|
2222
2230
|
}
|
2223
2231
|
|
2224
2232
|
/**
|
@@ -2227,30 +2235,37 @@ declare namespace chrome {
|
|
2227
2235
|
*/
|
2228
2236
|
export interface FrameDetails {
|
2229
2237
|
/** The unique identifier for the document. If the frameId and/or tabId are provided they will be validated to match the document found by provided document ID. */
|
2230
|
-
documentId?: string;
|
2238
|
+
documentId?: string | undefined;
|
2231
2239
|
/** The unique identifier for the frame within the tab. */
|
2232
|
-
frameId?: number;
|
2240
|
+
frameId?: number | undefined;
|
2233
2241
|
/* The unique identifier for the tab containing the frame. */
|
2234
|
-
tabId?: number;
|
2242
|
+
tabId?: number | undefined;
|
2235
2243
|
}
|
2236
2244
|
|
2237
|
-
export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {}
|
2238
|
-
|
2239
2245
|
/**
|
2240
|
-
*
|
2241
|
-
*
|
2246
|
+
* The underlying reason behind the cookie's change. If a cookie was inserted, or removed via an explicit call to "chrome.cookies.remove", "cause" will be "explicit". If a cookie was automatically removed due to expiry, "cause" will be "expired". If a cookie was removed due to being overwritten with an already-expired expiration date, "cause" will be set to "expired_overwrite". If a cookie was automatically removed due to garbage collection, "cause" will be "evicted". If a cookie was automatically removed due to a "set" call that overwrote it, "cause" will be "overwrite". Plan your response accordingly.
|
2247
|
+
* @since Chrome 44
|
2242
2248
|
*/
|
2243
|
-
export
|
2249
|
+
export enum OnChangedCause {
|
2250
|
+
EVICTED = "evicted",
|
2251
|
+
EXPIRED = "expired",
|
2252
|
+
EXPLICIT = "explicit",
|
2253
|
+
EXPIRED_OVERWRITE = "expired_overwrite",
|
2254
|
+
OVERWRITE = "overwrite",
|
2255
|
+
}
|
2244
2256
|
|
2245
2257
|
/**
|
2246
2258
|
* Lists all existing cookie stores.
|
2247
|
-
*
|
2259
|
+
*
|
2260
|
+
* Can return its result via Promise in Manifest V3 or later.
|
2248
2261
|
*/
|
2249
2262
|
export function getAllCookieStores(): Promise<CookieStore[]>;
|
2263
|
+
export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void;
|
2250
2264
|
|
2251
2265
|
/**
|
2252
2266
|
* The partition key for the frame indicated.
|
2253
|
-
*
|
2267
|
+
*
|
2268
|
+
* Can return its result via Promise in Manifest V3 or later.
|
2254
2269
|
* @since Chrome 132
|
2255
2270
|
*/
|
2256
2271
|
export function getPartitionKey(details: FrameDetails): Promise<{ partitionKey: CookiePartitionKey }>;
|
@@ -2260,62 +2275,41 @@ declare namespace chrome {
|
|
2260
2275
|
): void;
|
2261
2276
|
|
2262
2277
|
/**
|
2263
|
-
* Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
|
2264
|
-
* @param details Information to
|
2265
|
-
*
|
2266
|
-
|
2267
|
-
export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
|
2268
|
-
|
2269
|
-
/**
|
2270
|
-
* Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
|
2271
|
-
* @param details Information to filter the cookies being retrieved.
|
2272
|
-
* @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
|
2278
|
+
* Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first. This method only retrieves cookies for domains that the extension has host permissions to
|
2279
|
+
* @param details Information to identify the cookie to remove.
|
2280
|
+
*
|
2281
|
+
* Can return its result via Promise in Manifest V3 or later.
|
2273
2282
|
*/
|
2274
2283
|
export function getAll(details: GetAllDetails): Promise<Cookie[]>;
|
2284
|
+
export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
|
2275
2285
|
|
2276
2286
|
/**
|
2277
2287
|
* Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
|
2278
2288
|
* @param details Details about the cookie being set.
|
2279
|
-
*
|
2289
|
+
*
|
2290
|
+
* Can return its result via Promise in Manifest V3 or later.
|
2280
2291
|
*/
|
2281
2292
|
export function set(details: SetDetails): Promise<Cookie | null>;
|
2282
|
-
|
2283
|
-
/**
|
2284
|
-
* Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
|
2285
|
-
* @param details Details about the cookie being set.
|
2286
|
-
* Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set.
|
2287
|
-
*/
|
2288
2293
|
export function set(details: SetDetails, callback: (cookie: Cookie | null) => void): void;
|
2289
2294
|
|
2290
2295
|
/**
|
2291
2296
|
* Deletes a cookie by name.
|
2292
|
-
*
|
2293
|
-
*
|
2297
|
+
*
|
2298
|
+
* Can return its result via Promise in Manifest V3 or later.
|
2294
2299
|
*/
|
2295
2300
|
export function remove(details: CookieDetails): Promise<CookieDetails>;
|
2296
|
-
|
2297
|
-
/**
|
2298
|
-
* Deletes a cookie by name.
|
2299
|
-
* @param details Information to identify the cookie to remove.
|
2300
|
-
*/
|
2301
2301
|
export function remove(details: CookieDetails, callback?: (details: CookieDetails) => void): void;
|
2302
2302
|
|
2303
2303
|
/**
|
2304
2304
|
* Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
|
2305
|
-
*
|
2306
|
-
*
|
2307
|
-
*/
|
2308
|
-
export function get(details: CookieDetails, callback: (cookie: Cookie | null) => void): void;
|
2309
|
-
|
2310
|
-
/**
|
2311
|
-
* Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
|
2312
|
-
* @param details Details to identify the cookie being retrieved.
|
2313
|
-
* @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
|
2305
|
+
*
|
2306
|
+
* Can return its result via Promise in Manifest V3 or later.
|
2314
2307
|
*/
|
2315
2308
|
export function get(details: CookieDetails): Promise<Cookie | null>;
|
2309
|
+
export function get(details: CookieDetails, callback: (cookie: Cookie | null) => void): void;
|
2316
2310
|
|
2317
2311
|
/** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */
|
2318
|
-
export
|
2312
|
+
export const onChanged: events.Event<(changeInfo: CookieChangeInfo) => void>;
|
2319
2313
|
}
|
2320
2314
|
|
2321
2315
|
////////////////////
|
@@ -2623,31 +2617,39 @@ declare namespace chrome {
|
|
2623
2617
|
* Permissions: "desktopCapture"
|
2624
2618
|
*/
|
2625
2619
|
export namespace desktopCapture {
|
2626
|
-
/**
|
2620
|
+
/** Enum used to define set of desktop media sources used in {@link chooseDesktopMedia}. */
|
2621
|
+
export enum DesktopCaptureSourceType {
|
2622
|
+
SCREEN = "screen",
|
2623
|
+
WINDOW = "window",
|
2624
|
+
TAB = "tab",
|
2625
|
+
AUDIO = "audio",
|
2626
|
+
}
|
2627
|
+
|
2628
|
+
/**
|
2629
|
+
* Contains properties that describe the stream.
|
2630
|
+
* @since Chrome 57
|
2631
|
+
*/
|
2627
2632
|
export interface StreamOptions {
|
2628
2633
|
/** True if "audio" is included in parameter sources, and the end user does not uncheck the "Share audio" checkbox. Otherwise false, and in this case, one should not ask for audio stream through getUserMedia call. */
|
2629
2634
|
canRequestAudioTrack: boolean;
|
2630
2635
|
}
|
2631
2636
|
/**
|
2632
2637
|
* Shows desktop media picker UI with the specified set of sources.
|
2633
|
-
* @param sources Set of sources that should be shown to the user.
|
2634
|
-
*
|
2638
|
+
* @param sources Set of sources that should be shown to the user. The sources order in the set decides the tab order in the picker.
|
2639
|
+
* @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches `tab.url`. The tab's origin must be a secure origin, e.g. HTTPS.
|
2640
|
+
* @param callback streamId: An opaque string that can be passed to `getUserMedia()` API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty `streamId`. The created `streamId` can be used only once and expires after a few seconds when it is not used.
|
2641
|
+
* @return An id that can be passed to cancelChooseDesktopMedia() in case the prompt need to be canceled.
|
2635
2642
|
*/
|
2636
2643
|
export function chooseDesktopMedia(
|
2637
|
-
sources:
|
2644
|
+
sources: `${DesktopCaptureSourceType}`[],
|
2638
2645
|
callback: (streamId: string, options: StreamOptions) => void,
|
2639
2646
|
): number;
|
2640
|
-
/**
|
2641
|
-
* Shows desktop media picker UI with the specified set of sources.
|
2642
|
-
* @param sources Set of sources that should be shown to the user.
|
2643
|
-
* @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url.
|
2644
|
-
* Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
|
2645
|
-
*/
|
2646
2647
|
export function chooseDesktopMedia(
|
2647
|
-
sources:
|
2648
|
-
targetTab:
|
2648
|
+
sources: `${DesktopCaptureSourceType}`[],
|
2649
|
+
targetTab: tabs.Tab | undefined,
|
2649
2650
|
callback: (streamId: string, options: StreamOptions) => void,
|
2650
2651
|
): number;
|
2652
|
+
|
2651
2653
|
/**
|
2652
2654
|
* Hides desktop media picker dialog shown by chooseDesktopMedia().
|
2653
2655
|
* @param desktopMediaRequestId Id returned by chooseDesktopMedia()
|
@@ -2668,15 +2670,12 @@ declare namespace chrome {
|
|
2668
2670
|
export interface Resource {
|
2669
2671
|
/** The URL of the resource. */
|
2670
2672
|
url: string;
|
2671
|
-
/**
|
2672
|
-
* Gets the content of the resource.
|
2673
|
-
* @param callback A function that receives resource content when the request completes.
|
2674
|
-
*/
|
2673
|
+
/** Gets the content of the resource. */
|
2675
2674
|
getContent(
|
2676
2675
|
callback: (
|
2677
|
-
/** Content of the resource (potentially encoded) */
|
2676
|
+
/** Content of the resource (potentially encoded). */
|
2678
2677
|
content: string,
|
2679
|
-
/** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. */
|
2678
|
+
/** Empty if the content is not encoded, encoding name otherwise. Currently, only base64 is supported. */
|
2680
2679
|
encoding: string,
|
2681
2680
|
) => void,
|
2682
2681
|
): void;
|
@@ -2684,33 +2683,24 @@ declare namespace chrome {
|
|
2684
2683
|
* Sets the content of the resource.
|
2685
2684
|
* @param content New content of the resource. Only resources with the text type are currently supported.
|
2686
2685
|
* @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource.
|
2687
|
-
* @param callback A function called upon request completion.
|
2688
2686
|
*/
|
2689
2687
|
setContent(
|
2690
2688
|
content: string,
|
2691
2689
|
commit: boolean,
|
2692
2690
|
callback?: (
|
2693
|
-
/**
|
2694
|
-
* Set to undefined if the resource content was set successfully; describes error otherwise.
|
2695
|
-
*/
|
2691
|
+
/** Set to undefined if the resource content was set successfully; describes error otherwise. */
|
2696
2692
|
error?: object,
|
2697
2693
|
) => void,
|
2698
2694
|
): void;
|
2699
2695
|
}
|
2700
2696
|
|
2701
2697
|
export interface ReloadOptions {
|
2702
|
-
/**
|
2698
|
+
/** If specified, the string will override the value of the `User-Agent` HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the `navigator.userAgent` property that's returned to any scripts that are running within the inspected page. */
|
2703
2699
|
userAgent?: string | undefined;
|
2704
|
-
/**
|
2700
|
+
/** When true, the loader will bypass the cache for all inspected page resources loaded before the `load` event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */
|
2705
2701
|
ignoreCache?: boolean | undefined;
|
2706
|
-
/**
|
2702
|
+
/** If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R. */
|
2707
2703
|
injectedScript?: string | undefined;
|
2708
|
-
/**
|
2709
|
-
* Optional.
|
2710
|
-
* If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function.
|
2711
|
-
* @deprecated Deprecated since Chrome 41. Please avoid using this parameter, it will be removed soon.
|
2712
|
-
*/
|
2713
|
-
preprocessorScript?: string | undefined;
|
2714
2704
|
}
|
2715
2705
|
|
2716
2706
|
export interface EvaluationExceptionInfo {
|
@@ -2728,59 +2718,48 @@ declare namespace chrome {
|
|
2728
2718
|
value: string;
|
2729
2719
|
}
|
2730
2720
|
|
2731
|
-
|
2732
|
-
|
2733
|
-
export interface ResourceContentCommittedEvent
|
2734
|
-
extends chrome.events.Event<(resource: Resource, content: string) => void>
|
2735
|
-
{}
|
2736
|
-
|
2737
|
-
/** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */
|
2738
|
-
export var tabId: number;
|
2721
|
+
/** The ID of the tab being inspected. This ID may be used with {@link chrome.tabs} API. */
|
2722
|
+
export const tabId: number;
|
2739
2723
|
|
2740
2724
|
/** Reloads the inspected page. */
|
2741
2725
|
export function reload(reloadOptions?: ReloadOptions): void;
|
2726
|
+
|
2742
2727
|
/**
|
2743
|
-
* Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined
|
2728
|
+
* Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the `result` parameter of the callback is `undefined`. In the case of a DevTools-side error, the `isException` parameter is non-null and has `isError` set to true and `code` set to an error code. In the case of a JavaScript error, `isException` is set to true and `value` is set to the string value of thrown object.
|
2729
|
+
*
|
2744
2730
|
* @param expression An expression to evaluate.
|
2731
|
+
* @param options The options parameter can contain one or more options.
|
2745
2732
|
* @param callback A function called when evaluation completes.
|
2746
|
-
* Parameter result: The result of evaluation.
|
2747
|
-
* Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
|
2748
2733
|
*/
|
2749
|
-
export function eval<T>(
|
2734
|
+
export function eval<T = { [key: string]: unknown }>(
|
2750
2735
|
expression: string,
|
2751
2736
|
callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void,
|
2752
2737
|
): void;
|
2753
|
-
|
2754
|
-
* Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object.
|
2755
|
-
* @param expression An expression to evaluate.
|
2756
|
-
* @param options The options parameter can contain one or more options.
|
2757
|
-
* @param callback A function called when evaluation completes.
|
2758
|
-
* Parameter result: The result of evaluation.
|
2759
|
-
* Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
|
2760
|
-
*/
|
2761
|
-
export function eval<T>(
|
2738
|
+
export function eval<T = { [key: string]: unknown }>(
|
2762
2739
|
expression: string,
|
2763
|
-
options
|
2740
|
+
options: EvalOptions | undefined,
|
2764
2741
|
callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void,
|
2765
2742
|
): void;
|
2766
|
-
|
2767
|
-
|
2768
|
-
* @param callback A function that receives the list of resources when the request completes.
|
2769
|
-
*/
|
2743
|
+
|
2744
|
+
/** Retrieves the list of resources from the inspected page. */
|
2770
2745
|
export function getResources(callback: (resources: Resource[]) => void): void;
|
2771
2746
|
|
2772
2747
|
/** Fired when a new resource is added to the inspected page. */
|
2773
|
-
export
|
2748
|
+
export const onResourceAdded: events.Event<(resource: Resource) => void>;
|
2749
|
+
|
2774
2750
|
/** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */
|
2775
|
-
export
|
2751
|
+
export const onResourceContentCommitted: events.Event<(resource: Resource, content: string) => void>;
|
2776
2752
|
|
2777
2753
|
export interface EvalOptions {
|
2778
2754
|
/** If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page. */
|
2779
2755
|
frameURL?: string | undefined;
|
2780
|
-
/** Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the isError field set to true and the code field set to E_NOTFOUND
|
2756
|
+
/** Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the `isError` field set to true and the `code` field set to `E_NOTFOUND`. */
|
2781
2757
|
useContentScriptContext?: boolean | undefined;
|
2782
|
-
/**
|
2783
|
-
|
2758
|
+
/**
|
2759
|
+
* Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, scriptExecutionContext overrides the 'true' setting on useContentScriptContext.
|
2760
|
+
* @since Chrome 107
|
2761
|
+
*/
|
2762
|
+
scriptExecutionContext?: string | undefined;
|
2784
2763
|
}
|
2785
2764
|
}
|
2786
2765
|
|
@@ -4196,44 +4175,47 @@ declare namespace chrome {
|
|
4196
4175
|
*/
|
4197
4176
|
export namespace enterprise.deviceAttributes {
|
4198
4177
|
/**
|
4199
|
-
*
|
4200
|
-
*
|
4178
|
+
* Fetches the value of the device identifier of the directory API, that is generated by the server and identifies the cloud record of the device for querying in the cloud directory API. If the current user is not affiliated, returns an empty string.
|
4179
|
+
*
|
4180
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
4201
4181
|
*/
|
4182
|
+
export function getDirectoryDeviceId(): Promise<string>;
|
4202
4183
|
export function getDirectoryDeviceId(callback: (deviceId: string) => void): void;
|
4184
|
+
|
4203
4185
|
/**
|
4186
|
+
* Fetches the device's serial number. Please note the purpose of this API is to administrate the device (e.g. generating Certificate Sign Requests for device-wide certificates). This API may not be used for tracking devices without the consent of the device's administrator. If the current user is not affiliated, returns an empty string.
|
4187
|
+
*
|
4188
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
4204
4189
|
* @since Chrome 66
|
4205
|
-
* @description
|
4206
|
-
* Fetches the device's serial number.
|
4207
|
-
* Please note the purpose of this API is to administrate the device
|
4208
|
-
* (e.g. generating Certificate Sign Requests for device-wide certificates).
|
4209
|
-
* This API may not be used for tracking devices without the consent of the device's administrator.
|
4210
|
-
* If the current user is not affiliated, returns an empty string.
|
4211
|
-
* @param callback Called with the serial number of the device.
|
4212
4190
|
*/
|
4191
|
+
export function getDeviceSerialNumber(): Promise<string>;
|
4213
4192
|
export function getDeviceSerialNumber(callback: (serialNumber: string) => void): void;
|
4193
|
+
|
4214
4194
|
/**
|
4195
|
+
* Fetches the administrator-annotated Asset Id. If the current user is not affiliated or no Asset Id has been set by the administrator, returns an empty string.
|
4196
|
+
*
|
4197
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
4215
4198
|
* @since Chrome 66
|
4216
|
-
* @description
|
4217
|
-
* Fetches the administrator-annotated Asset Id.
|
4218
|
-
* If the current user is not affiliated or no Asset Id has been set by the administrator, returns an empty string.
|
4219
|
-
* @param callback Called with the Asset ID of the device.
|
4220
4199
|
*/
|
4200
|
+
export function getDeviceAssetId(): Promise<string>;
|
4221
4201
|
export function getDeviceAssetId(callback: (assetId: string) => void): void;
|
4202
|
+
|
4222
4203
|
/**
|
4204
|
+
* Fetches the administrator-annotated Location. If the current user is not affiliated or no Annotated Location has been set by the administrator, returns an empty string.
|
4205
|
+
*
|
4206
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
4223
4207
|
* @since Chrome 66
|
4224
|
-
* @description
|
4225
|
-
* Fetches the administrator-annotated Location.
|
4226
|
-
* If the current user is not affiliated or no Annotated Location has been set by the administrator, returns an empty string.
|
4227
|
-
* @param callback Called with the Annotated Location of the device.
|
4228
4208
|
*/
|
4209
|
+
export function getDeviceAnnotatedLocation(): Promise<string>;
|
4229
4210
|
export function getDeviceAnnotatedLocation(callback: (annotatedLocation: string) => void): void;
|
4211
|
+
|
4230
4212
|
/**
|
4213
|
+
* Fetches the device's hostname as set by DeviceHostnameTemplate policy. If the current user is not affiliated or no hostname has been set by the enterprise policy, returns an empty string.
|
4214
|
+
*
|
4215
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
4231
4216
|
* @since Chrome 82
|
4232
|
-
* @description
|
4233
|
-
* Fetches the device's hostname as set by DeviceHostnameTemplate policy.
|
4234
|
-
* If the current user is not affiliated or no hostname has been set by the enterprise policy, returns an empty string.
|
4235
|
-
* @param callback Called with the hostname of the device.
|
4236
4217
|
*/
|
4218
|
+
export function getDeviceHostname(): Promise<string>;
|
4237
4219
|
export function getDeviceHostname(callback: (hostname: string) => void): void;
|
4238
4220
|
}
|
4239
4221
|
|
@@ -4262,6 +4244,24 @@ declare namespace chrome {
|
|
4262
4244
|
export function getHardwarePlatformInfo(callback: (info: HardwarePlatformInfo) => void): void;
|
4263
4245
|
}
|
4264
4246
|
|
4247
|
+
////////////////////
|
4248
|
+
// Enterprise Login
|
4249
|
+
////////////////////
|
4250
|
+
/**
|
4251
|
+
* Use the `chrome.enterprise.login` API to exit Managed Guest sessions. Note: This API is only available to extensions installed by enterprise policy in ChromeOS Managed Guest sessions.
|
4252
|
+
*
|
4253
|
+
* Permissions: "enterprise.login"
|
4254
|
+
*
|
4255
|
+
* Note: Only available to policy installed extensions.
|
4256
|
+
* @platform ChromeOS only
|
4257
|
+
* @since Chrome 139
|
4258
|
+
*/
|
4259
|
+
export namespace enterprise.login {
|
4260
|
+
/** Exits the current managed guest session. */
|
4261
|
+
export function exitCurrentManagedGuestSession(): Promise<void>;
|
4262
|
+
export function exitCurrentManagedGuestSession(callback: () => void): void;
|
4263
|
+
}
|
4264
|
+
|
4265
4265
|
////////////////////
|
4266
4266
|
// Enterprise Networking Attributes
|
4267
4267
|
////////////////////
|
@@ -8571,6 +8571,8 @@ declare namespace chrome {
|
|
8571
8571
|
MIPS = "mips",
|
8572
8572
|
/** Specifies the processer architecture as mips64. */
|
8573
8573
|
MIPS64 = "mips64",
|
8574
|
+
/** Specifies the processer architecture as riscv64. */
|
8575
|
+
RISCV64 = "riscv64",
|
8574
8576
|
}
|
8575
8577
|
|
8576
8578
|
/**
|
@@ -8737,7 +8739,7 @@ declare namespace chrome {
|
|
8737
8739
|
/** The machine's processor architecture. */
|
8738
8740
|
arch: `${PlatformArch}`;
|
8739
8741
|
/** The native client architecture. This may be different from arch on some platforms. */
|
8740
|
-
nacl_arch
|
8742
|
+
nacl_arch?: `${PlatformNaclArch}`;
|
8741
8743
|
}
|
8742
8744
|
|
8743
8745
|
/** An object which allows two way communication with other pages. */
|
@@ -8826,6 +8828,7 @@ declare namespace chrome {
|
|
8826
8828
|
| "downloads.ui"
|
8827
8829
|
| "enterprise.deviceAttributes"
|
8828
8830
|
| "enterprise.hardwarePlatform"
|
8831
|
+
| "enterprise.login"
|
8829
8832
|
| "enterprise.networkingAttributes"
|
8830
8833
|
| "enterprise.platformKeys"
|
8831
8834
|
| "experimental"
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.5",
|
4
4
|
"description": "TypeScript definitions for chrome",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -94,6 +94,6 @@
|
|
94
94
|
"@types/har-format": "*"
|
95
95
|
},
|
96
96
|
"peerDependencies": {},
|
97
|
-
"typesPublisherContentHash": "
|
97
|
+
"typesPublisherContentHash": "e1fac3378e3f586d03c2f3829b254da0467a69917acf1c6921ddc3c4a76a1ebc",
|
98
98
|
"typeScriptVersion": "5.2"
|
99
99
|
}
|