Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat(chrome-ext): enable use of the CSS Custom Highlights API for Firefox (#2607)

Elijah Potter96a1408c3c9f
diff --git a/packages/chrome-plugin/package.json b/packages/chrome-plugin/package.json
index 634eaf571..9a9e5db93 100644
--- a/packages/chrome-plugin/package.json
+++ b/packages/chrome-plugin/package.json
@@ -26,7 +26,7 @@
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.26",
- "@playwright/test": "^1.57.0",
+ "@playwright/test": "^1.58.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@types/chrome": "^0.0.246",
"@types/lodash-es": "^4.17.12",
diff --git a/packages/chrome-plugin/src/manifest.ts b/packages/chrome-plugin/src/manifest.ts
index fb81d04f1..c1a200465 100644
--- a/packages/chrome-plugin/src/manifest.ts
+++ b/packages/chrome-plugin/src/manifest.ts
@@ -50,7 +50,7 @@ export default defineManifest({
browser_specific_settings: {
gecko: {
- strict_min_version: '135.0',
+ strict_min_version: '146.0',
},
},
background: {
diff --git a/packages/harper.js/package.json b/packages/harper.js/package.json
index 3c851d460..f257e076e 100644
--- a/packages/harper.js/package.json
+++ b/packages/harper.js/package.json
@@ -33,7 +33,7 @@
"marked": "^16.4.1",
"p-lazy": "^5.0.0",
"p-memoize": "^7.1.1",
- "playwright": "^1.49.1",
+ "playwright": "^1.58.0",
"type-fest": "^4.37.0",
"typescript": "catalog:",
"vite": "^6.1.0",
diff --git a/packages/lint-framework/package.json b/packages/lint-framework/package.json
index 1e8d4e853..858a14258 100644
--- a/packages/lint-framework/package.json
+++ b/packages/lint-framework/package.json
@@ -23,7 +23,6 @@
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^7.1.0",
"@fortawesome/free-solid-svg-icons": "^7.1.0",
- "bowser": "^2.12.1",
"colorjs.io": "^0.5.2",
"virtual-dom": "^2.1.1"
},
diff --git a/packages/lint-framework/src/lint/Highlights.ts b/packages/lint-framework/src/lint/Highlights.ts
index 11d908bda..ad23ede04 100644
--- a/packages/lint-framework/src/lint/Highlights.ts
+++ b/packages/lint-framework/src/lint/Highlights.ts
@@ -1,4 +1,3 @@
-import Bowser from 'bowser';
import type { VNode } from 'virtual-dom';
import h from 'virtual-dom/h';
import type { LintBox } from './Box';
@@ -300,7 +299,7 @@ function isContainingBlock(el: Element): boolean {
return false;
}
-export function supportsCustomHighlights(ua = navigator.userAgent) {
+export function supportsCustomHighlights() {
const root = globalThis.document?.documentElement;
const disableFlag =
root?.getAttribute?.('data-harper-disable-css-highlights') === 'true' ||
@@ -312,9 +311,6 @@ export function supportsCustomHighlights(ua = navigator.userAgent) {
if (isAutomated) {
return false;
}
- const parser = Bowser.getParser(ua);
- const isFirefox = parser.getBrowserName(true) === 'firefox';
- if (isFirefox) return false;
if (!('CSS' in window) || typeof CSS.supports !== 'function') return false;
const supportsSelector = CSS.supports('selector(::highlight(__x))');
const reg = CSS?.highlights as any;
diff --git a/packages/obsidian-plugin/package.json b/packages/obsidian-plugin/package.json
index b0756dbbe..675b4c9e2 100644
--- a/packages/obsidian-plugin/package.json
+++ b/packages/obsidian-plugin/package.json
@@ -4,7 +4,7 @@
"version": "1.5.1",
"main": "main.js",
"devDependencies": {
- "@playwright/test": "^1.57.0",
+ "@playwright/test": "^1.58.0",
"@rollup/plugin-node-resolve": "^16.0.0",
"@types/lodash-es": "^4.17.12",
"@vitest/browser": "^4.0.16",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0f860e631..2d0a0f1ac 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -69,8 +69,8 @@ importers:
specifier: ^2.0.0-beta.26
version: 2.0.0-beta.32
'@playwright/test':
- specifier: ^1.57.0
- version: 1.57.0
+ specifier: ^1.58.0
+ version: 1.58.0
'@sveltejs/vite-plugin-svelte':
specifier: ^4.0.0
@@ -100,7 +100,7 @@ importers:
version: 14.1.1
playwright-webextext:
specifier: ^0.0.4
- version: 0.0.4(@playwright/[email protected])([email protected])
+ version: 0.0.4(@playwright/[email protected])([email protected])
prettier:
specifier: ^3.1.0
version: 3.5.3
@@ -191,7 +191,7 @@ importers:
'@vitest/browser-playwright':
specifier: ^4.0.16
'@vitest/ui':
specifier: 4.0.16
version: 4.0.16([email protected])
@@ -208,8 +208,8 @@ importers:
specifier: ^7.1.1
version: 7.1.1
playwright:
- specifier: ^1.49.1
- version: 1.57.0
+ specifier: ^1.58.0
+ version: 1.58.0
type-fest:
specifier: ^4.37.0
version: 4.37.0
@@ -243,9 +243,6 @@ importers:
'@fortawesome/free-solid-svg-icons':
specifier: ^7.1.0
version: 7.1.0
- bowser:
- specifier: ^2.12.1
- version: 2.12.1
colorjs.io:
specifier: ^0.5.2
version: 0.5.2
@@ -327,8 +324,8 @@ importers:
version: 2.8.1
devDependencies:
'@playwright/test':
- specifier: ^1.57.0
- version: 1.57.0
+ specifier: ^1.58.0
+ version: 1.58.0
'@rollup/plugin-node-resolve':
specifier: ^16.0.0
version: 16.0.1([email protected])
@@ -340,7 +337,7 @@ importers:
'@vitest/browser-playwright':
specifier: ^4.0.16
obsidian:
specifier: ^1.7.2
version: 1.8.7(@codemirror/[email protected])(@codemirror/[email protected])
@@ -523,7 +520,7 @@ importers:
devDependencies:
'@wordpress/scripts':
specifier: ^30.9.0
'@wp-now/wp-now':
specifier: ^0.1.74
version: 0.1.74
@@ -2774,8 +2771,8 @@ packages:
resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
- '@playwright/[email protected]':
- resolution: {integrity: sha512-6TyEnHgd6SArQO8UO2OMTxshln3QMWBtPGrOCgs3wVEmQmwyuNtB10IZMfmYDE0riwNR1cu4q+pPcxMVtaG3TA==}
+ '@playwright/[email protected]':
+ resolution: {integrity: sha512-fWza+Lpbj6SkQKCrU6si4iu+fD2dD3gxNHFhUPxsfXBPhnv3rRSQVd0NtBUT9Z/RhF/boCBcuUaMUSTRTopjZg==}
engines: {node: '>=18'}
hasBin: true
@@ -5371,9 +5368,6 @@ packages:
resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
- resolution: {integrity: sha512-z4rE2Gxh7tvshQ4hluIT7XcFrgLIQaw9X3A+kTTRdovCz5PMukm/0QC/BKSYPj3omF5Qfypn9O/c5kgpmvYUCw==}
-
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
@@ -9543,8 +9537,8 @@ packages:
resolution: {integrity: sha512-wmJwA+8ihJixSoHKxZJRBQG1oY8Yr9pGLzRmSsNms0iNWyHHAlZCa7mmKiFR10YPZuz/2k169JiS/inOjBCZ2A==}
- resolution: {integrity: sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==}
+ resolution: {integrity: sha512-aaoB1RWrdNi3//rOeKuMiS65UCcgOVljU46At6eFcOFPFHWtd2weHRRow6z/n+Lec0Lvu0k9ZPKJSjPugikirw==}
engines: {node: '>=18'}
hasBin: true
@@ -9560,8 +9554,8 @@ packages:
playwright:
optional: true
- resolution: {integrity: sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==}
+ resolution: {integrity: sha512-2SVA0sbPktiIY/MCOPX8e86ehA/e+tDNq+e5Y8qjKYti2Z/JG7xnronT/TXTIkKbYGWlCbuucZ6dziEgkoEjQQ==}
engines: {node: '>=18'}
hasBin: true
@@ -14960,7 +14954,7 @@ snapshots:
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/set-array': 1.2.1
- '@jridgewell/sourcemap-codec': 1.5.0
+ '@jridgewell/sourcemap-codec': 1.5.5
'@jridgewell/trace-mapping': 0.3.25
'@jridgewell/[email protected]':
@@ -14984,7 +14978,7 @@ snapshots:
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/resolve-uri': 3.1.2
- '@jridgewell/sourcemap-codec': 1.5.0
+ '@jridgewell/sourcemap-codec': 1.5.5
dependencies:
@@ -15251,9 +15245,9 @@ snapshots:
'@pkgr/[email protected]': {}
- '@playwright/[email protected]':
+ '@playwright/[email protected]':
dependencies:
- playwright: 1.57.0
+ playwright: 1.58.0
dependencies:
@@ -16993,11 +16987,11 @@ snapshots:
tinyglobby: 0.2.15
dependencies:
- playwright: 1.57.0
+ playwright: 1.58.0
tinyrainbow: 3.0.3
transitivePeerDependencies:
@@ -17716,9 +17710,9 @@ snapshots:
'@babel/runtime': 7.25.7
'@wordpress/deprecated': 4.20.0
- '@wordpress/[email protected](@playwright/[email protected])':
+ '@wordpress/[email protected](@playwright/[email protected])':
dependencies:
- '@playwright/test': 1.57.0
+ '@playwright/test': 1.58.0
change-case: 4.1.2
form-data: 4.0.2
get-port: 5.1.1
@@ -18197,16 +18191,16 @@ snapshots:
react: 18.3.1
route-recognizer: 0.3.4
dependencies:
'@babel/core': 7.25.7
- '@playwright/test': 1.57.0
+ '@playwright/test': 1.58.0
'@pmmmwh/react-refresh-webpack-plugin': 0.5.15(@types/[email protected])([email protected])([email protected])([email protected])([email protected])
'@svgr/webpack': 8.1.0([email protected])
'@wordpress/babel-preset-default': 8.20.0
'@wordpress/browserslist-config': 6.20.0
'@wordpress/dependency-extraction-webpack-plugin': 6.20.0([email protected])
- '@wordpress/e2e-test-utils-playwright': 1.20.0(@playwright/[email protected])
+ '@wordpress/e2e-test-utils-playwright': 1.20.0(@playwright/[email protected])
'@wordpress/jest-preset-default': 12.20.0(@babel/[email protected])([email protected](@types/[email protected])([email protected]))
'@wordpress/npm-package-json-lint-config': 5.20.0([email protected]([email protected]))
@@ -19017,8 +19011,6 @@ snapshots:
-
dependencies:
balanced-match: 1.0.2
@@ -23971,16 +23963,16 @@ snapshots:
exsolve: 1.0.4
pathe: 2.0.3
optionalDependencies:
- '@playwright/test': 1.57.0
- playwright: 1.57.0
+ '@playwright/test': 1.58.0
+ playwright: 1.58.0
dependencies:
- playwright-core: 1.57.0
+ playwright-core: 1.58.0
optionalDependencies:
fsevents: 2.3.2
@@ -26451,7 +26443,7 @@ snapshots:
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 22.13.10
'@vitest/ui': 4.0.16([email protected])
jsdom: 20.0.3
transitivePeerDependencies: