@wxt-dev/browser 0.2.6 → 0.2.7

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/gen/index.d.ts +40 -1
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.2.6",
4
+ "version": "0.2.7",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
7
7
  "types": "src/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "src"
26
26
  ],
27
27
  "devDependencies": {
28
- "@types/chrome": "0.2.6",
28
+ "@types/chrome": "0.2.7",
29
29
  "@types/node": "^22",
30
30
  "typescript": "^6.0.3",
31
31
  "vitest": "^4.1.10"
@@ -4744,6 +4744,25 @@ export namespace Browser {
4744
4744
  */
4745
4745
  type CSSOrigin = "author" | "user";
4746
4746
 
4747
+ /**
4748
+ * Details of the CSS to remove. Either the code or the file property must be set, but both may not be set at the same time.
4749
+ * @since Chrome 87
4750
+ */
4751
+ interface DeleteInjectionDetails {
4752
+ /** If allFrames is `true`, implies that the CSS should be removed from all frames of current page. By default, it's `false` and is only removed from the top frame. If `true` and `frameId` is set, then the code is removed from the selected frame and all of its child frames. */
4753
+ allFrames?: boolean;
4754
+ /** CSS code to remove. */
4755
+ code?: string;
4756
+ /** The origin of the CSS to remove. Defaults to `"author"`. */
4757
+ cssOrigin?: CSSOrigin;
4758
+ /** CSS file to remove. */
4759
+ file?: string;
4760
+ /** The frame from where the CSS should be removed. Defaults to 0 (the top-level frame). */
4761
+ frameId?: number;
4762
+ /** If matchAboutBlank is true, then the code is also removed from about:blank and about:srcdoc frames if your extension has access to its parent document. By default it is `false`. */
4763
+ matchAboutBlank?: boolean;
4764
+ }
4765
+
4747
4766
  /**
4748
4767
  * The document lifecycle of the frame.
4749
4768
  * @since Chrome 106
@@ -11892,7 +11911,7 @@ export namespace Browser {
11892
11911
  * MV2 only
11893
11912
  * @param tabId The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
11894
11913
  * @param details Details of the CSS text to insert. Either the code or the file property must be set, but both may not be set at the same time.
11895
- * @deprecated since Chrome 99. Replaced by {@link scripting.insertCSS} in Manifest V3.
11914
+ * @deprecated since Chrome 91. Replaced by {@link scripting.insertCSS} in Manifest V3.
11896
11915
  */
11897
11916
  function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
11898
11917
  function insertCSS(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise<void>;
@@ -11903,6 +11922,26 @@ export namespace Browser {
11903
11922
  callback: () => void,
11904
11923
  ): void;
11905
11924
 
11925
+ /**
11926
+ * Removes from a page CSS that was previously injected by a call to {@link tabs.insertCSS}.
11927
+ *
11928
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
11929
+ *
11930
+ * MV2 only
11931
+ * @param tabId The ID of the tab from which to remove the CSS; defaults to the active tab of the current window.
11932
+ * @param details Details of the CSS text to remove. Either the code or the file property must be set, but both may not be set at the same time.
11933
+ * @since Chrome 87
11934
+ * @deprecated since Chrome 91. Replaced by {@link scripting.removeCSS} in Manifest V3.
11935
+ */
11936
+ function removeCSS(details: extensionTypes.DeleteInjectionDetails): Promise<void>;
11937
+ function removeCSS(tabId: number | undefined, details: extensionTypes.DeleteInjectionDetails): Promise<void>;
11938
+ function removeCSS(details: extensionTypes.DeleteInjectionDetails, callback: () => void): void;
11939
+ function removeCSS(
11940
+ tabId: number | undefined,
11941
+ details: extensionTypes.DeleteInjectionDetails,
11942
+ callback: () => void,
11943
+ ): void;
11944
+
11906
11945
  /**
11907
11946
  * Highlights the given tabs and focuses on the first of group. Will appear to do nothing if the specified tab is currently active.
11908
11947
  *