browser-extension-utils 0.5.0 → 0.5.2

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/lib/dom-utils.ts +3 -2
  2. package/package.json +16 -6
package/lib/dom-utils.ts CHANGED
@@ -228,8 +228,9 @@ const tt = (globalThis as any).trustedTypes
228
228
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
229
229
  const escapeHTMLPolicy =
230
230
  tt !== undefined && typeof tt.createPolicy === 'function'
231
- ? // eslint-disable-next-line @typescript-eslint/no-unsafe-call
232
- tt.createPolicy('beuEscapePolicy', {
231
+ ? // Change to 'dompurify' - https://greasyfork.org/zh-CN/scripts/464541-links-helper/discussions/322299
232
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
233
+ tt.createPolicy('dompurify', {
233
234
  createHTML: (string: string) => string,
234
235
  })
235
236
  : undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-extension-utils",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Utilities for developing browser extensions and userscripts",
5
5
  "type": "module",
6
6
  "main": "./lib/index.ts",
@@ -9,6 +9,16 @@
9
9
  "./userscript": "./lib/userscript.ts",
10
10
  "./request-idle-callback-polyfill": "./lib/request-idle-callback-polyfill.ts"
11
11
  },
12
+ "typesVersions": {
13
+ "*": {
14
+ "userscript": [
15
+ "./lib/userscript.ts"
16
+ ],
17
+ "request-idle-callback-polyfill": [
18
+ "./lib/request-idle-callback-polyfill.ts"
19
+ ]
20
+ }
21
+ },
12
22
  "scripts": {
13
23
  "p": "prettier --write .",
14
24
  "xo": "xo",
@@ -35,13 +45,13 @@
35
45
  },
36
46
  "homepage": "https://github.com/utags/browser-extension-utils#readme",
37
47
  "devDependencies": {
38
- "@types/chrome": "^0.1.36",
39
- "@vitest/coverage-v8": "^4.0.18",
40
- "@vitest/ui": "^4.0.18",
41
- "happy-dom": "^20.5.0",
48
+ "@types/chrome": "^0.1.38",
49
+ "@vitest/coverage-v8": "^4.1.0",
50
+ "@vitest/ui": "^4.1.0",
51
+ "happy-dom": "^20.8.4",
42
52
  "prettier": "^3.8.1",
43
53
  "typescript": "^5.9.3",
44
- "vitest": "^4.0.18",
54
+ "vitest": "^4.1.0",
45
55
  "xo": "^1.2.3"
46
56
  },
47
57
  "files": [