Skip to content

Commit 9b749d1

Browse files
committed
Replace deprecated webextension-polyfill-ts
1 parent 5d1c6e0 commit 9b749d1

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"webext-patterns": "^1.3.0",
3333
"webext-polyfill-kinda": "^1.0.2",
3434
"webext-tools": "^1.1.4",
35-
"webextension-polyfill-ts": "^0.26.0"
35+
"webextension-polyfill": "^0.10.0"
3636
},
3737
"devDependencies": {
3838
"@ianvs/prettier-plugin-sort-imports": "4.1.0",
@@ -43,6 +43,7 @@
4343
"@types/react": "18.2.20",
4444
"@types/react-dom": "18.2.7",
4545
"@types/validator": "^13.11.1",
46+
"@types/webextension-polyfill": "^0.10.7",
4647
"@typescript-eslint/eslint-plugin": "^6.7.0",
4748
"@typescript-eslint/parser": "^6.7.0",
4849
"autoprefixer": "^10.4.15",

pnpm-lock.yaml

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/background.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { browser } from "webextension-polyfill-ts";
1+
import browser from "webextension-polyfill";
22
import 'webext-dynamic-content-scripts';
33
import addDomainPermissionToggle from "webext-domain-permission-toggle";
44

src/popup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useCallback, useEffect, useState, type FormEvent } from "react";
2-
import { browser } from "webextension-polyfill-ts";
2+
import browser from "webextension-polyfill";
33
import "./popup.css";
44

55
import { Storage } from "@plasmohq/storage";

src/utils/permissions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { browser } from "webextension-polyfill-ts";
1+
import browser from "webextension-polyfill";
22
import { ALL_ORIGINS_WILDCARD } from "~constants";
33

44
export const canAccessAllSites = async () => {
@@ -7,4 +7,4 @@ export const canAccessAllSites = async () => {
77

88
export const canAccessOrigin = async (origin: string) => {
99
return await browser.permissions.contains({ origins: [origin] });
10-
}
10+
}

0 commit comments

Comments
 (0)