@wxt-dev/browser 0.1.36 → 0.1.37

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wxt-dev/browser",
3
3
  "description": "Provides a cross-browser API for using extension APIs and types based on @types/chrome",
4
- "version": "0.1.36",
4
+ "version": "0.1.37",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
7
7
  "types": "src/index.d.ts",
@@ -19,11 +19,11 @@
19
19
  "src"
20
20
  ],
21
21
  "devDependencies": {
22
- "@types/chrome": "0.1.36",
23
- "fs-extra": "^11.3.1",
24
- "nano-spawn": "^1.0.2",
25
- "typescript": "^5.9.2",
26
- "vitest": "^4.0.16"
22
+ "@types/chrome": "0.1.37",
23
+ "fs-extra": "^11.3.3",
24
+ "nano-spawn": "^2.0.0",
25
+ "typescript": "^5.9.3",
26
+ "vitest": "^4.0.18"
27
27
  },
28
28
  "dependencies": {
29
29
  "@types/filesystem": "*",
@@ -5,19 +5,19 @@ import { browser, type Browser } from '../index';
5
5
  describe('browser', () => {
6
6
  describe('types', () => {
7
7
  it('should provide types via the Browser import', () => {
8
- expectTypeOf<Browser.runtime.MessageSender>().toMatchTypeOf<chrome.runtime.MessageSender>();
9
- expectTypeOf<Browser.storage.AreaName>().toMatchTypeOf<chrome.storage.AreaName>();
10
- expectTypeOf<Browser.i18n.LanguageDetectionResult>().toMatchTypeOf<chrome.i18n.LanguageDetectionResult>();
8
+ expectTypeOf<Browser.runtime.MessageSender>().toEqualTypeOf<chrome.runtime.MessageSender>();
9
+ expectTypeOf<Browser.storage.AreaName>().toEqualTypeOf<chrome.storage.AreaName>();
10
+ expectTypeOf<Browser.i18n.LanguageDetectionResult>().toEqualTypeOf<chrome.i18n.LanguageDetectionResult>();
11
11
  });
12
12
 
13
13
  it('should provide values via the browser import', () => {
14
- expectTypeOf(browser.runtime.id).toMatchTypeOf<string>();
14
+ expectTypeOf(browser.runtime.id).toEqualTypeOf<string>();
15
15
  expectTypeOf(
16
16
  browser.storage.local,
17
- ).toMatchTypeOf<Browser.storage.StorageArea>();
17
+ ).toEqualTypeOf<Browser.storage.LocalStorageArea>();
18
18
  expectTypeOf(
19
- browser.i18n.detectLanguage('Hello, world!'),
20
- ).resolves.toMatchTypeOf<chrome.i18n.LanguageDetectionResult>();
19
+ browser.i18n.detectLanguage,
20
+ ).returns.resolves.toEqualTypeOf<chrome.i18n.LanguageDetectionResult>();
21
21
  });
22
22
  });
23
23
  });
@@ -694,9 +694,16 @@ export namespace Browser {
694
694
 
695
695
  /** @deprecated Bookmark write operations are no longer limited by Chrome. */
696
696
  export const MAX_WRITE_OPERATIONS_PER_HOUR: 1000000;
697
+
697
698
  /** @deprecated Bookmark write operations are no longer limited by Chrome. */
698
699
  export const MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: 1000000;
699
700
 
701
+ /**
702
+ * The `id` associated with the root level node.
703
+ * @since Chrome 145
704
+ */
705
+ export const ROOT_NODE_ID = "0";
706
+
700
707
  /**
701
708
  * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
702
709
  *
@@ -11049,6 +11056,11 @@ export namespace Browser {
11049
11056
  height?: number | undefined;
11050
11057
  /** The session ID used to uniquely identify a tab obtained from the {@link sessions} API. */
11051
11058
  sessionId?: string | undefined;
11059
+ /**
11060
+ * The ID of the Split View that the tab belongs to.
11061
+ * @since Chrome 145
11062
+ */
11063
+ splitViewId?: number | undefined;
11052
11064
  /**
11053
11065
  * The ID of the group that the tab belongs to.
11054
11066
  * @since Chrome 88
@@ -11120,6 +11132,12 @@ export namespace Browser {
11120
11132
  */
11121
11133
  export const MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND = 2;
11122
11134
 
11135
+ /**
11136
+ * An ID that represents the absence of a split tab.
11137
+ * @since Chrome 145
11138
+ */
11139
+ export const SPLIT_VIEW_ID_NONE: -1;
11140
+
11123
11141
  /**
11124
11142
  * An ID that represents the absence of a browser tab.
11125
11143
  * @since Chrome 46
@@ -14085,6 +14103,30 @@ export namespace Browser {
14085
14103
  responseHeaders?: HeaderInfo[];
14086
14104
  }
14087
14105
 
14106
+ /** @since Chrome 145 */
14107
+ export enum RuleConditionKeys {
14108
+ URL_FILTER = "urlFilter",
14109
+ REGEX_FILTER = "regexFilter",
14110
+ IS_URL_FILTER_CASE_SENSITIVE = "isUrlFilterCaseSensitive",
14111
+ INITIATOR_DOMAINS = "initiatorDomains",
14112
+ EXCLUDED_INITIATOR_DOMAINS = "excludedInitiatorDomains",
14113
+ REQUEST_DOMAINS = "requestDomains",
14114
+ EXCLUDED_REQUEST_DOMAINS = "excludedRequestDomains",
14115
+ TOP_DOMAINS = "topDomains",
14116
+ EXCLUDED_TOP_DOMAINS = "excludedTopDomains",
14117
+ DOMAINS = "domains",
14118
+ EXCLUDED_DOMAINS = "excludedDomains",
14119
+ RESOURCE_TYPES = "resourceTypes",
14120
+ EXCLUDED_RESOURCE_TYPES = "excludedResourceTypes",
14121
+ REQUEST_METHODS = "requestMethods",
14122
+ EXCLUDED_REQUEST_METHODS = "excludedRequestMethods",
14123
+ DOMAIN_TYPE = "domainType",
14124
+ TAB_IDS = "tabIds",
14125
+ EXCLUDED_TAB_IDS = "excludedTabIds",
14126
+ RESPONSE_HEADERS = "responseHeaders",
14127
+ EXCLUDED_RESPONSE_HEADERS = "excludedResponseHeaders",
14128
+ }
14129
+
14088
14130
  export interface MatchedRule {
14089
14131
  /** A matching rule's ID. */
14090
14132
  ruleId: number;
@@ -14305,6 +14347,11 @@ export namespace Browser {
14305
14347
  responseHeaders?: { [name: string]: unknown };
14306
14348
  /** The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. Default is -1, meaning that the request isn't related to a tab. */
14307
14349
  tabId?: number;
14350
+ /**
14351
+ * The associated top-level frame URL (if any) for the request.
14352
+ * @since Chrome 145
14353
+ */
14354
+ topUrl?: string;
14308
14355
  /** The resource type of the hypothetical request. */
14309
14356
  type: `${ResourceType}`;
14310
14357
  /** The URL of the hypothetical request. */