From 36ac71d423f10153e6c9af7b37fdf2300daa8f86 Mon Sep 17 00:00:00 2001 From: MarvNC Date: Thu, 26 Oct 2023 13:21:56 -0700 Subject: Replace references to Yomichan Import --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1f25c057..f985980e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Yomitan provides advanced features not available in other browser-based dictiona - On-demand audio playback for select dictionary definitions. - Kanji stroke order diagrams are just a click away for most characters. - Custom search page for easily executing custom search queries. -- Support for multiple dictionary formats including [EPWING](https://ja.wikipedia.org/wiki/EPWING) via the [Yomichan Import](https://foosoft.net/projects/yomichan-import) tool. +- Support for multiple dictionary formats including [EPWING](https://ja.wikipedia.org/wiki/EPWING) via the [Yomitan Import](https://github.com/themoeway/yomitan-import) tool. - Automatic note creation for the [Anki](https://apps.ankiweb.net/) flashcard program via the [AnkiConnect](https://foosoft.net/projects/anki-connect) plugin. - Clean, modern code makes it easy for developers to [contribute](https://github.com/themoeway/yomitan/blob/master/CONTRIBUTING.md) new features. @@ -39,6 +39,8 @@ Yomitan provides advanced features not available in other browser-based dictiona - [Installation](#installation) - [Migrating from Yomichan](#migrating-from-yomichan) + - [Exporting Data](#exporting-data) + - [Custom Templates](#custom-templates) - [Dictionaries](#dictionaries) - [Basic Usage](#basic-usage) - [Importing Dictionaries](#importing-dictionaries) @@ -109,8 +111,7 @@ form (e.g. `{{set "key" "value"}}`). The default templates and helper documentat There are several free Japanese dictionaries available for Yomitan, with two of them having glossaries available in different languages. You must download and import the dictionaries you wish to use in order to enable Yomitan -definition lookups. If you have proprietary EPWING dictionaries that you would like to use, check the [Yomichan -Import](https://foosoft.net/projects/yomichan-import) page to learn how to convert and import them into Yomitan. +definition lookups. If you have proprietary EPWING dictionaries that you would like to use, check the [Yomitan Import](https://github.com/themoeway/yomitan-import) page to learn how to convert and import them into Yomitan. Be aware that the non-English dictionaries contain fewer entries than their English counterparts. Even if your primary language is not English, you may consider also importing the English version for better coverage. @@ -205,8 +206,8 @@ similar to the ones pictured below. These dictionaries are often sought after by and excellent coverage of the Japanese language. Unfortunately, as most of the dictionaries released in this format are proprietary, they are unable to be bundled with -Yomitan. Instead, you will need to procure these dictionaries yourself and import them using [Yomichan -Import](https://foosoft.net/projects/yomichan-import). Check the project page for additional details. +Yomitan. Instead, you will need to procure these dictionaries yourself and import them using [Yomitan +Import](https://github.com/themoeway/yomitan-import). Check the project page for additional details. ![Pocket EPWING dictionaries](img/epwing-devices.jpg) -- cgit v1.2.3 From dc8a175a0d069701e394e9fa083106eba2693679 Mon Sep 17 00:00:00 2001 From: MarvNC Date: Thu, 26 Oct 2023 13:27:03 -0700 Subject: Linebreak readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f985980e..39e9fe71 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,8 @@ form (e.g. `{{set "key" "value"}}`). The default templates and helper documentat There are several free Japanese dictionaries available for Yomitan, with two of them having glossaries available in different languages. You must download and import the dictionaries you wish to use in order to enable Yomitan -definition lookups. If you have proprietary EPWING dictionaries that you would like to use, check the [Yomitan Import](https://github.com/themoeway/yomitan-import) page to learn how to convert and import them into Yomitan. +definition lookups. If you have proprietary EPWING dictionaries that you would like to use, check the [Yomitan +Import](https://github.com/themoeway/yomitan-import) page to learn how to convert and import them into Yomitan. Be aware that the non-English dictionaries contain fewer entries than their English counterparts. Even if your primary language is not English, you may consider also importing the English version for better coverage. -- cgit v1.2.3 From 9c003ec233136690c4efcee15341352400ce145d Mon Sep 17 00:00:00 2001 From: praschke Date: Sun, 29 Oct 2023 16:08:53 +0000 Subject: remove webRequest from chrome for real --- dev/data/manifest-variants.json | 10 +++++++++- docs/permissions.md | 15 +++++---------- ext/js/background/request-builder.js | 2 +- ext/permissions.html | 16 ++-------------- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json index c9e7cd03..858dba65 100644 --- a/dev/data/manifest-variants.json +++ b/dev/data/manifest-variants.json @@ -81,7 +81,6 @@ "clipboardWrite", "unlimitedStorage", "declarativeNetRequest", - "webRequest", "scripting", "offscreen" ], @@ -249,6 +248,15 @@ "nativeMessaging" ] }, + { + "action": "add", + "path": [ + "permissions" + ], + "items": [ + "webRequest" + ] + }, { "action": "add", "path": [ diff --git a/docs/permissions.md b/docs/permissions.md index 57f9f0b2..3fdf72d8 100644 --- a/docs/permissions.md +++ b/docs/permissions.md @@ -9,13 +9,8 @@ `unlimitedStorage` is used to help prevent web browsers from unexpectedly deleting dictionary data. -* `webRequest`
- Yomichan uses this permission to collect audio or create Anki notes using - [AnkiConnect](https://ankiweb.net/shared/info/2055492159). - It is also required to surface error information from failed requests. - -* `webRequestBlocking` _(Firefox only)_
- Yomichan uses this permission to ensure certain requests have valid and secure headers. +* `webRequest` and `webRequestBlocking` _(Firefox only)_
+ Yomichan uses these permissions to ensure certain requests have valid and secure headers. This sometimes involves removing or changing the `Origin` request header, as this can be used to fingerprint browser configuration. @@ -24,11 +19,11 @@ This sometimes involves removing or changing the `Origin` request header, as this can be used to fingerprint browser configuration. -* `scripting` _(Manifest V3 only)_
- Yomichan will sometimes need to inject stylesheets into webpages in order to +* `scripting`
+ Yomichan needs to inject content scripts and stylesheets into webpages in order to properly display the search popup. -* `offscreen` __(Chrome only)_
+* `offscreen` _(Chrome only)_
Yomitan uses this permission to create a secondary backend document that has DOM access, given that Manifest v3 service workers do not. Service workers can then reach out to out to this document in order to complete actions that require access to DOM APIs, such as any that require clipboard access. diff --git a/ext/js/background/request-builder.js b/ext/js/background/request-builder.js index 663e242b..bf770964 100644 --- a/ext/js/background/request-builder.js +++ b/ext/js/background/request-builder.js @@ -313,7 +313,7 @@ class RequestBuilder { await this._updateDynamicRules({addRules}); try { - return await this._fetchInternal(url, init, null); + return await fetch(url, init); } finally { await this._tryUpdateDynamicRules({removeRuleIds: [id]}); } diff --git a/ext/permissions.html b/ext/permissions.html index 9ede7d27..4aaef3c1 100644 --- a/ext/permissions.html +++ b/ext/permissions.html @@ -47,24 +47,12 @@ -
-
-
webRequest
-
-

- Yomitan uses this permission to collect audio or create Anki notes using - AnkiConnect. - It is also required to surface error information from failed requests. -

-
-
-
-
webRequestBlocking
+
webRequest and webRequestBlocking

- Yomitan uses this permission to ensure certain requests have valid and secure headers. + Yomitan uses these permissions to ensure certain requests have valid and secure headers. This sometimes involves removing or changing the Origin request header, as this can be used to fingerprint browser configuration.

-- cgit v1.2.3 From 0adf9cef27de2641718116b91a0c7426aac6814e Mon Sep 17 00:00:00 2001 From: praschke Date: Sun, 29 Oct 2023 20:50:45 +0000 Subject: fix: _getDynamicRules() returns a promise dynamic rules were never cleared, as the promise is not iterable as expected. --- ext/js/background/request-builder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/js/background/request-builder.js b/ext/js/background/request-builder.js index bf770964..03088fac 100644 --- a/ext/js/background/request-builder.js +++ b/ext/js/background/request-builder.js @@ -263,7 +263,7 @@ class RequestBuilder { async _clearDynamicRules() { if (!isObject(chrome.declarativeNetRequest)) { return; } - const rules = this._getDynamicRules(); + const rules = await this._getDynamicRules(); if (rules.length === 0) { return; } -- cgit v1.2.3 From ba8eec942c60cc8b676408efd99e3fbbb9670c06 Mon Sep 17 00:00:00 2001 From: praschke Date: Sun, 29 Oct 2023 20:59:05 +0000 Subject: fix: session rules should be used instead of dynamic rules session rules are less persistent than dynamic rules, and the intention of RequestBuilder is to only have rules active for the lifetime of specific requests. --- ext/js/background/request-builder.js | 50 +++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/ext/js/background/request-builder.js b/ext/js/background/request-builder.js index 03088fac..32c4a788 100644 --- a/ext/js/background/request-builder.js +++ b/ext/js/background/request-builder.js @@ -42,6 +42,7 @@ class RequestBuilder { async prepare() { try { await this._clearDynamicRules(); + await this._clearSessionRules(); } catch (e) { // NOP } @@ -260,6 +261,21 @@ class RequestBuilder { } } + async _clearSessionRules() { + if (!isObject(chrome.declarativeNetRequest)) { return; } + + const rules = await this._getSessionRules(); + + if (rules.length === 0) { return; } + + const removeRuleIds = []; + for (const {id} of rules) { + removeRuleIds.push(id); + } + + await this._updateSessionRules({removeRuleIds}); + } + async _clearDynamicRules() { if (!isObject(chrome.declarativeNetRequest)) { return; } @@ -311,17 +327,43 @@ class RequestBuilder { } }]; - await this._updateDynamicRules({addRules}); + await this._updateSessionRules({addRules}); try { return await fetch(url, init); } finally { - await this._tryUpdateDynamicRules({removeRuleIds: [id]}); + await this._tryUpdateSessionRules({removeRuleIds: [id]}); } } finally { this._ruleIds.delete(id); } } + _getSessionRules() { + return new Promise((resolve, reject) => { + chrome.declarativeNetRequest.getSessionRules((result) => { + const e = chrome.runtime.lastError; + if (e) { + reject(new Error(e.message)); + } else { + resolve(result); + } + }); + }); + } + + _updateSessionRules(options) { + return new Promise((resolve, reject) => { + chrome.declarativeNetRequest.updateSessionRules(options, () => { + const e = chrome.runtime.lastError; + if (e) { + reject(new Error(e.message)); + } else { + resolve(); + } + }); + }); + } + _getDynamicRules() { return new Promise((resolve, reject) => { chrome.declarativeNetRequest.getDynamicRules((result) => { @@ -348,9 +390,9 @@ class RequestBuilder { }); } - async _tryUpdateDynamicRules(options) { + async _tryUpdateSessionRules(options) { try { - await this._updateDynamicRules(options); + await this._updateSessionRules(options); return true; } catch (e) { return false; -- cgit v1.2.3 From e61a69fb9ed8ad1dc94b4695d9b9052f4a533a52 Mon Sep 17 00:00:00 2001 From: praschke Date: Sun, 29 Oct 2023 21:20:29 +0000 Subject: remove webRequest and webRequestBlocking firefox was previously unable to use declarativeNetRequest, as some browser state (ExtensionDNRStore) wasn't correctly initialized wrt yomitan's use of the DNR API. this bug manifested as an unexpected error on calls to updateDynamicRules(), specifically after the browser has been restarted. switching to the use of session rules instead of dynamic rules fixes this bug. i have tested audio info requests (custom JSON, JPod Alternate, Jisho) that exhibited the bug after browser restart on version 115 and 118, and the audio plays instead of the request failing. webRequest can now be entirely removed. --- dev/data/manifest-variants.json | 25 --- docs/permissions.md | 7 +- ext/js/background/request-builder.js | 306 ++++++++--------------------------- ext/permissions.html | 33 +--- 4 files changed, 74 insertions(+), 297 deletions(-) diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json index 858dba65..4d4ec301 100644 --- a/dev/data/manifest-variants.json +++ b/dev/data/manifest-variants.json @@ -248,31 +248,6 @@ "nativeMessaging" ] }, - { - "action": "add", - "path": [ - "permissions" - ], - "items": [ - "webRequest" - ] - }, - { - "action": "add", - "path": [ - "permissions" - ], - "items": [ - "webRequestBlocking" - ] - }, - { - "action": "remove", - "path": [ - "permissions" - ], - "item": "declarativeNetRequest" - }, { "action": "remove", "path": [ diff --git a/docs/permissions.md b/docs/permissions.md index 3fdf72d8..8ab3bba5 100644 --- a/docs/permissions.md +++ b/docs/permissions.md @@ -9,12 +9,7 @@ `unlimitedStorage` is used to help prevent web browsers from unexpectedly deleting dictionary data. -* `webRequest` and `webRequestBlocking` _(Firefox only)_
- Yomichan uses these permissions to ensure certain requests have valid and secure headers. - This sometimes involves removing or changing the `Origin` request header, - as this can be used to fingerprint browser configuration. - -* `declarativeNetRequest` _(Chrome only)_
+* `declarativeNetRequest`
Yomichan uses this permission to ensure certain requests have valid and secure headers. This sometimes involves removing or changing the `Origin` request header, as this can be used to fingerprint browser configuration. diff --git a/ext/js/background/request-builder.js b/ext/js/background/request-builder.js index 32c4a788..7ee89539 100644 --- a/ext/js/background/request-builder.js +++ b/ext/js/background/request-builder.js @@ -31,7 +31,6 @@ class RequestBuilder { * Creates a new instance. */ constructor() { - this._onBeforeSendHeadersExtraInfoSpec = ['blocking', 'requestHeaders', 'extraHeaders']; this._textEncoder = new TextEncoder(); this._ruleIds = new Set(); } @@ -55,15 +54,50 @@ class RequestBuilder { * @returns {Promise} The response of the `fetch` call. */ async fetchAnonymous(url, init) { - if (isObject(chrome.declarativeNetRequest)) { - return await this._fetchAnonymousDeclarative(url, init); + const id = this._getNewRuleId(); + const originUrl = this._getOriginURL(url); + url = encodeURI(decodeURI(url)); + + this._ruleIds.add(id); + try { + const addRules = [{ + id, + priority: 1, + condition: { + urlFilter: `|${this._escapeDnrUrl(url)}|`, + resourceTypes: ['xmlhttprequest'] + }, + action: { + type: 'modifyHeaders', + requestHeaders: [ + { + operation: 'remove', + header: 'Cookie' + }, + { + operation: 'set', + header: 'Origin', + value: originUrl + } + ], + responseHeaders: [ + { + operation: 'remove', + header: 'Set-Cookie' + } + ] + } + }]; + + await this._updateSessionRules({addRules}); + try { + return await fetch(url, init); + } finally { + await this._tryUpdateSessionRules({removeRuleIds: [id]}); + } + } finally { + this._ruleIds.delete(id); } - const originURL = this._getOriginURL(url); - const headerModifications = [ - ['cookie', null], - ['origin', {name: 'Origin', value: originURL}] - ]; - return await this._fetchInternal(url, init, headerModifications); } /** @@ -126,144 +160,7 @@ class RequestBuilder { // Private - async _fetchInternal(url, init, headerModifications) { - const filter = { - urls: [this._getMatchURL(url)], - types: ['xmlhttprequest'] - }; - - let requestId = null; - const onBeforeSendHeadersCallback = (details) => { - if (requestId !== null || details.url !== url) { return {}; } - ({requestId} = details); - - if (headerModifications === null) { return {}; } - - const requestHeaders = details.requestHeaders; - this._modifyHeaders(requestHeaders, headerModifications); - return {requestHeaders}; - }; - - let errorDetailsTimer = null; - let {promise: errorDetailsPromise, resolve: errorDetailsResolve} = deferPromise(); - const onErrorOccurredCallback = (details) => { - if (errorDetailsResolve === null || details.requestId !== requestId) { return; } - if (errorDetailsTimer !== null) { - clearTimeout(errorDetailsTimer); - errorDetailsTimer = null; - } - errorDetailsResolve(details); - errorDetailsResolve = null; - }; - - const eventListeners = []; - const onBeforeSendHeadersExtraInfoSpec = (headerModifications !== null ? this._onBeforeSendHeadersExtraInfoSpec : []); - this._addWebRequestEventListener(chrome.webRequest.onBeforeSendHeaders, onBeforeSendHeadersCallback, filter, onBeforeSendHeadersExtraInfoSpec, eventListeners); - this._addWebRequestEventListener(chrome.webRequest.onErrorOccurred, onErrorOccurredCallback, filter, void 0, eventListeners); - - try { - return await fetch(url, init); - } catch (e) { - // onErrorOccurred is not always invoked by this point, so a delay is needed - if (errorDetailsResolve !== null) { - errorDetailsTimer = setTimeout(() => { - errorDetailsTimer = null; - if (errorDetailsResolve === null) { return; } - errorDetailsResolve(null); - errorDetailsResolve = null; - }, 100); - } - const details = await errorDetailsPromise; - if (details !== null) { - const data = {details}; - this._assignErrorData(e, data); - } - throw e; - } finally { - this._removeWebRequestEventListeners(eventListeners); - } - } - - _addWebRequestEventListener(target, callback, filter, extraInfoSpec, eventListeners) { - try { - for (let i = 0; i < 2; ++i) { - try { - if (typeof extraInfoSpec === 'undefined') { - target.addListener(callback, filter); - } else { - target.addListener(callback, filter, extraInfoSpec); - } - break; - } catch (e) { - // Firefox doesn't support the 'extraHeaders' option and will throw the following error: - // Type error for parameter extraInfoSpec (Error processing 2: Invalid enumeration value "extraHeaders") for [target]. - if (i === 0 && `${e.message}`.includes('extraHeaders') && Array.isArray(extraInfoSpec)) { - const index = extraInfoSpec.indexOf('extraHeaders'); - if (index >= 0) { - extraInfoSpec.splice(index, 1); - continue; - } - } - throw e; - } - } - } catch (e) { - console.log(e); - return; - } - eventListeners.push({target, callback}); - } - - _removeWebRequestEventListeners(eventListeners) { - for (const {target, callback} of eventListeners) { - try { - target.removeListener(callback); - } catch (e) { - console.log(e); - } - } - } - - _getMatchURL(url) { - const url2 = new URL(url); - return `${url2.protocol}//${url2.host}${url2.pathname}${url2.search}`.replace(/\*/g, '%2a'); - } - - _getOriginURL(url) { - const url2 = new URL(url); - return `${url2.protocol}//${url2.host}`; - } - - _modifyHeaders(headers, modifications) { - modifications = new Map(modifications); - - for (let i = 0, ii = headers.length; i < ii; ++i) { - const header = headers[i]; - const name = header.name.toLowerCase(); - const modification = modifications.get(name); - if (typeof modification === 'undefined') { continue; } - - modifications.delete(name); - - if (modification === null) { - headers.splice(i, 1); - --i; - --ii; - } else { - headers[i] = modification; - } - } - - for (const header of modifications.values()) { - if (header !== null) { - headers.push(header); - } - } - } - async _clearSessionRules() { - if (!isObject(chrome.declarativeNetRequest)) { return; } - const rules = await this._getSessionRules(); if (rules.length === 0) { return; } @@ -276,68 +173,6 @@ class RequestBuilder { await this._updateSessionRules({removeRuleIds}); } - async _clearDynamicRules() { - if (!isObject(chrome.declarativeNetRequest)) { return; } - - const rules = await this._getDynamicRules(); - - if (rules.length === 0) { return; } - - const removeRuleIds = []; - for (const {id} of rules) { - removeRuleIds.push(id); - } - - await this._updateDynamicRules({removeRuleIds}); - } - - async _fetchAnonymousDeclarative(url, init) { - const id = this._getNewRuleId(); - const originUrl = this._getOriginURL(url); - url = encodeURI(decodeURI(url)); - - this._ruleIds.add(id); - try { - const addRules = [{ - id, - priority: 1, - condition: { - urlFilter: `|${this._escapeDnrUrl(url)}|`, - resourceTypes: ['xmlhttprequest'] - }, - action: { - type: 'modifyHeaders', - requestHeaders: [ - { - operation: 'remove', - header: 'Cookie' - }, - { - operation: 'set', - header: 'Origin', - value: originUrl - } - ], - responseHeaders: [ - { - operation: 'remove', - header: 'Set-Cookie' - } - ] - } - }]; - - await this._updateSessionRules({addRules}); - try { - return await fetch(url, init); - } finally { - await this._tryUpdateSessionRules({removeRuleIds: [id]}); - } - } finally { - this._ruleIds.delete(id); - } - } - _getSessionRules() { return new Promise((resolve, reject) => { chrome.declarativeNetRequest.getSessionRules((result) => { @@ -364,6 +199,28 @@ class RequestBuilder { }); } + async _tryUpdateSessionRules(options) { + try { + await this._updateSessionRules(options); + return true; + } catch (e) { + return false; + } + } + + async _clearDynamicRules() { + const rules = await this._getDynamicRules(); + + if (rules.length === 0) { return; } + + const removeRuleIds = []; + for (const {id} of rules) { + removeRuleIds.push(id); + } + + await this._updateDynamicRules({removeRuleIds}); + } + _getDynamicRules() { return new Promise((resolve, reject) => { chrome.declarativeNetRequest.getDynamicRules((result) => { @@ -390,15 +247,6 @@ class RequestBuilder { }); } - async _tryUpdateSessionRules(options) { - try { - await this._updateSessionRules(options); - return true; - } catch (e) { - return false; - } - } - _getNewRuleId() { let id = 1; while (this._ruleIds.has(id)) { @@ -409,6 +257,11 @@ class RequestBuilder { return id; } + _getOriginURL(url) { + const url2 = new URL(url); + return `${url2.protocol}//${url2.host}`; + } + _escapeDnrUrl(url) { return url.replace(/[|*^]/g, (char) => this._urlEncodeUtf8(char)); } @@ -422,25 +275,6 @@ class RequestBuilder { return result; } - _assignErrorData(error, data) { - try { - error.data = data; - } catch (e) { - // On Firefox, assigning DOMException.data can fail in certain contexts. - // https://bugzilla.mozilla.org/show_bug.cgi?id=1776555 - try { - Object.defineProperty(error, 'data', { - configurable: true, - enumerable: true, - writable: true, - value: data - }); - } catch (e2) { - // NOP - } - } - } - static _joinUint8Arrays(items, totalLength) { if (items.length === 1) { const {array, length} = items[0]; diff --git a/ext/permissions.html b/ext/permissions.html index 4aaef3c1..f6956cd7 100644 --- a/ext/permissions.html +++ b/ext/permissions.html @@ -47,22 +47,7 @@
-
-
-
webRequest and webRequestBlocking
-
-

- Yomitan uses these permissions to ensure certain requests have valid and secure headers. - This sometimes involves removing or changing the Origin request header, - as this can be used to fingerprint browser configuration. -

-

- Example: Origin: -

-
-
-
-
+
declarativeNetRequest
@@ -77,11 +62,11 @@
-
+
scripting
- Yomitan will sometimes need to inject stylesheets into webpages in order to + Yomitan needs to inject content scripts and stylesheets into webpages in order to properly display the search popup.
@@ -123,18 +108,6 @@
-
-
-
webNavigation (optional)
-
- Yomitan may require this permission to inject content scripts for certain browsers - if Google Docs accessibility mode is enabled. -
-
-
- -
-
Allow in private windows (optional)
-- cgit v1.2.3 From bbefd8a07ba71d7fe5e9c707ddb06e99bfd2a502 Mon Sep 17 00:00:00 2001 From: praschke Date: Sun, 29 Oct 2023 22:17:08 +0000 Subject: nativeMessaging can always be optional this is the only blocker to Firefox for Android. --- dev/data/manifest-variants.json | 29 ++++++----------------------- docs/permissions.md | 5 ++--- ext/js/extension/environment.js | 16 ++++++---------- ext/permissions.html | 4 ++-- ext/settings.html | 2 +- 5 files changed, 17 insertions(+), 39 deletions(-) diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json index 4d4ec301..139814fd 100644 --- a/dev/data/manifest-variants.json +++ b/dev/data/manifest-variants.json @@ -229,25 +229,12 @@ "gecko": { "id": "{cb7c0bec-7085-4f84-8422-7b55a7c4467c}", "strict_min_version": "115.0" + }, + "gecko_android": { + "strict_min_version": "115.0" } } }, - { - "action": "remove", - "path": [ - "optional_permissions" - ], - "item": "nativeMessaging" - }, - { - "action": "add", - "path": [ - "permissions" - ], - "items": [ - "nativeMessaging" - ] - }, { "action": "remove", "path": [ @@ -327,13 +314,6 @@ ], "item": "clipboardRead" }, - { - "action": "remove", - "path": [ - "permissions" - ], - "item": "webRequestBlocking" - }, { "action": "remove", "path": [ @@ -365,6 +345,9 @@ ], "excludeFiles": [ "sw.js", + "offscreen.html", + "js/background/offscreen.js", + "js/background/offscreen-main.js", "js/dom/simple-dom-parser.js", "lib/parse5.js" ] diff --git a/docs/permissions.md b/docs/permissions.md index 8ab3bba5..b2b1a34c 100644 --- a/docs/permissions.md +++ b/docs/permissions.md @@ -27,15 +27,14 @@ Yomichan supports simulating the `Ctrl+C` (copy to clipboard) keyboard shortcut when a definitions popup is open and focused. -* `clipboardRead` (optional)
+* `clipboardRead` _(optional)_
Yomichan supports automatically opening a search window when Japanese text is copied to the clipboard while the browser is running, depending on how certain settings are configured. This allows Yomichan to support scanning text from external applications, provided there is a way to copy text from those applications to the clipboard. -* `nativeMessaging` (optional on Chrome)
+* `nativeMessaging` _(optional, unavailable on Firefox for Android)_
Yomichan has the ability to communicate with an optional native messaging component in order to support parsing large blocks of Japanese text using [MeCab](https://en.wikipedia.org/wiki/MeCab). The installation of this component is optional and is not included by default. - This permission is optional on Chrome, but required on Firefox, because Firefox does not permit it to be optional. diff --git a/ext/js/extension/environment.js b/ext/js/extension/environment.js index ec1e8612..ad5a19ae 100644 --- a/ext/js/extension/environment.js +++ b/ext/js/extension/environment.js @@ -31,8 +31,9 @@ class Environment { } async _loadEnvironmentInfo() { - const browser = await this._getBrowser(); const os = await this._getOperatingSystem(); + const browser = await this._getBrowser(os); + return { browser, platform: {os} @@ -64,7 +65,7 @@ class Environment { }); } - async _getBrowser() { + async _getBrowser(os) { try { if (chrome.runtime.getURL('/').startsWith('ms-browser-extension://')) { return 'edge-legacy'; @@ -76,17 +77,12 @@ class Environment { // NOP } if (typeof browser !== 'undefined') { - try { - const info = await browser.runtime.getBrowserInfo(); - if (info.name === 'Fennec') { - return 'firefox-mobile'; - } - } catch (e) { - // NOP - } if (this._isSafari()) { return 'safari'; } + if (os === 'android') { + return 'firefox-mobile'; + } return 'firefox'; } else { return 'chrome'; diff --git a/ext/permissions.html b/ext/permissions.html index f6956cd7..376a9de5 100644 --- a/ext/permissions.html +++ b/ext/permissions.html @@ -94,9 +94,9 @@
-
+
-
nativeMessaging (optional)
+
nativeMessaging (optional)
Yomitan has the ability to communicate with an optional native messaging component in order to support parsing large blocks of Japanese text using diff --git a/ext/settings.html b/ext/settings.html index f1001f90..8d5f0a76 100644 --- a/ext/settings.html +++ b/ext/settings.html @@ -1372,7 +1372,7 @@

-
+
-- cgit v1.2.3 From 201b6a689f7887c48e1fa4d010005242d2e6182a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 03:35:14 +0000 Subject: build(deps-dev): bump the minor group with 5 updates Bumps the minor group with 5 updates: | Package | From | To | | --- | --- | --- | | [@playwright/test](https://github.com/microsoft/playwright) | `1.38.1` | `1.39.0` | | [eslint](https://github.com/eslint/eslint) | `8.50.0` | `8.52.0` | | [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc) | `2.9.0` | `2.10.0` | | [html-validate](https://gitlab.com/html-validate/html-validate) | `8.5.0` | `8.7.0` | | [stylelint](https://github.com/stylelint/stylelint) | `15.10.3` | `15.11.0` | Updates `@playwright/test` from 1.38.1 to 1.39.0 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.38.1...v1.39.0) Updates `eslint` from 8.50.0 to 8.52.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.50.0...v8.52.0) Updates `eslint-plugin-jsonc` from 2.9.0 to 2.10.0 - [Release notes](https://github.com/ota-meshi/eslint-plugin-jsonc/releases) - [Changelog](https://github.com/ota-meshi/eslint-plugin-jsonc/blob/master/CHANGELOG.md) - [Commits](https://github.com/ota-meshi/eslint-plugin-jsonc/compare/v2.9.0...v2.10.0) Updates `html-validate` from 8.5.0 to 8.7.0 - [Release notes](https://gitlab.com/html-validate/html-validate/tags) - [Commits](https://gitlab.com/html-validate/html-validate/compare/v8.5.0...v8.7.0) Updates `stylelint` from 15.10.3 to 15.11.0 - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/15.10.3...15.11.0) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: eslint-plugin-jsonc dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: html-validate dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 318 ++++++++++++++++++++++++++++++++++-------------------- package.json | 10 +- 2 files changed, 208 insertions(+), 120 deletions(-) diff --git a/package-lock.json b/package-lock.json index 61b77b09..20337415 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,20 +10,20 @@ "hasInstallScript": true, "license": "GPL-3.0-or-later", "devDependencies": { - "@playwright/test": "^1.38.1", + "@playwright/test": "^1.39.0", "ajv": "^8.11.0", "browserify": "^17.0.0", "css": "^3.0.0", - "eslint": "^8.50.0", + "eslint": "^8.52.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-jsdoc": "^46.8.2", - "eslint-plugin-jsonc": "^2.9.0", + "eslint-plugin-jsonc": "^2.10.0", "eslint-plugin-no-unsanitized": "^4.0.1", "fake-indexeddb": "^4.0.2", - "html-validate": "^8.5.0", + "html-validate": "^8.7.0", "jsdom": "^22.1.0", "parse5": "^7.1.2", - "stylelint": "^15.10.3", + "stylelint": "^15.11.0", "stylelint-config-recommended": "^13.0.0" } }, @@ -312,9 +312,9 @@ "dev": true }, "node_modules/@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", + "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -333,12 +333,12 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.11", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", - "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", "minimatch": "^3.0.5" }, @@ -360,9 +360,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, "node_modules/@isaacs/cliui": { @@ -478,12 +478,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", - "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.39.0.tgz", + "integrity": "sha512-3u1iFqgzl7zr004bGPYiN/5EZpRUSFddQBra8Rqll5N0/vfpqlP9I9EXqAoGacuAbX6c9Ulg/Cjqglp5VkK6UQ==", "dev": true, "dependencies": { - "playwright": "1.38.1" + "playwright": "1.39.0" }, "bin": { "playwright": "cli.js" @@ -529,6 +529,12 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -1346,12 +1352,12 @@ } }, "node_modules/css-functions-list": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", - "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.1.tgz", + "integrity": "sha512-Nj5YcaGgBtuUmn1D7oHqPW0c9iui7xsTsj5lIX8ZgevdfhmjFfKB3r8moHJtNJnctnYXJyYX5I1pp90HM4TPgQ==", "dev": true, "engines": { - "node": ">=12.22" + "node": ">=12 || >=16" } }, "node_modules/css-tree": { @@ -1772,18 +1778,19 @@ } }, "node_modules/eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", + "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", - "@humanwhocodes/config-array": "^0.11.11", + "@eslint/js": "8.52.0", + "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -1825,6 +1832,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-compat-utils": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", + "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-plugin-header": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", @@ -1858,12 +1877,13 @@ } }, "node_modules/eslint-plugin-jsonc": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.9.0.tgz", - "integrity": "sha512-RK+LeONVukbLwT2+t7/OY54NJRccTXh/QbnXzPuTLpFMVZhPuq1C9E07+qWenGx7rrQl0kAalAWl7EmB+RjpGA==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.10.0.tgz", + "integrity": "sha512-9d//o6Jyh4s1RxC9fNSt1+MMaFN2ruFdXPG9XZcb/mR2KkfjADYiNL/hbU6W0Cyxfg3tS/XSFuhl5LgtMD8hmw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", + "eslint-compat-utils": "^0.1.2", "jsonc-eslint-parser": "^2.0.4", "natural-compare": "^1.4.0" }, @@ -2134,22 +2154,23 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=12.0.0" } }, "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, "node_modules/foreach": { @@ -2531,18 +2552,18 @@ } }, "node_modules/html-validate": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/html-validate/-/html-validate-8.5.0.tgz", - "integrity": "sha512-EiRJ7mqRZb68DgxyMlA+5uVheCuNYZiXnoSajcdSTK8IcNuPpyeSI0CZu9wK1jE6jQrWnf8myIa5JkjDByHPuw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/html-validate/-/html-validate-8.7.0.tgz", + "integrity": "sha512-fsDHUxzVNzXzV2KpPOx5GbGRCK0cFs7a8+9jE5QTyYUGAlm1PNGst8Vi0U7hSmootkCBxY3bu7LgQBjjZDeBPw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.10.0", "@html-validate/stylish": "^4.1.0", "@sidvind/better-ajv-errors": "^2.0.0", "ajv": "^8.0.0", - "deepmerge": "^4.2.0", + "deepmerge": "4.3.1", "glob": "^10.0.0", - "ignore": "^5.0.0", + "ignore": "5.2.4", "kleur": "^4.1.0", "minimist": "^1.2.0", "prompts": "^2.0.0", @@ -3216,6 +3237,12 @@ } } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -3277,6 +3304,15 @@ "node": "*" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -3296,9 +3332,9 @@ } }, "node_modules/known-css-properties": { - "version": "0.28.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.28.0.tgz", - "integrity": "sha512-9pSL5XB4J+ifHP0e0jmmC98OGC1nL8/JjS+fi6mnTlIf//yt/MfVLtKg7S6nCtj/8KTcWX7nRlY0XywoYY1ISQ==", + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.29.0.tgz", + "integrity": "sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==", "dev": true }, "node_modules/labeled-stream-splicer": { @@ -3971,12 +4007,12 @@ } }, "node_modules/playwright": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", - "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.39.0.tgz", + "integrity": "sha512-naE5QT11uC/Oiq0BwZ50gDmy8c8WLPRTEWuSSFVG2egBka/1qMoSqYQcROMT9zLwJ86oPofcTH2jBY/5wWOgIw==", "dev": true, "dependencies": { - "playwright-core": "1.38.1" + "playwright-core": "1.39.0" }, "bin": { "playwright": "cli.js" @@ -3989,9 +4025,9 @@ } }, "node_modules/playwright-core": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", - "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.39.0.tgz", + "integrity": "sha512-+k4pdZgs1qiM+OUkSjx96YiKsXsmb59evFoqv8SKO067qBA+Z2s/dCzJij/ZhdQcs2zlTAgRKfeiiLm8PQ2qvw==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -4890,9 +4926,9 @@ "dev": true }, "node_modules/stylelint": { - "version": "15.10.3", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.3.tgz", - "integrity": "sha512-aBQMMxYvFzJJwkmg+BUUg3YfPyeuCuKo2f+LOw7yYbU8AZMblibwzp9OV4srHVeQldxvSFdz0/Xu8blq2AesiA==", + "version": "15.11.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.11.0.tgz", + "integrity": "sha512-78O4c6IswZ9TzpcIiQJIN49K3qNoXTM8zEJzhaTE/xRTCZswaovSEVIa/uwbOltZrk16X4jAxjaOhzz/hTm1Kw==", "dev": true, "dependencies": { "@csstools/css-parser-algorithms": "^2.3.1", @@ -4902,12 +4938,12 @@ "balanced-match": "^2.0.0", "colord": "^2.9.3", "cosmiconfig": "^8.2.0", - "css-functions-list": "^3.2.0", + "css-functions-list": "^3.2.1", "css-tree": "^2.3.1", "debug": "^4.3.4", "fast-glob": "^3.3.1", "fastest-levenshtein": "^1.0.16", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^7.0.0", "global-modules": "^2.0.0", "globby": "^11.1.0", "globjoin": "^0.1.4", @@ -4916,13 +4952,13 @@ "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", - "known-css-properties": "^0.28.0", + "known-css-properties": "^0.29.0", "mathml-tag-names": "^2.1.3", "meow": "^10.1.5", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.27", + "postcss": "^8.4.28", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", "postcss-selector-parser": "^6.0.13", @@ -4965,6 +5001,18 @@ "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", "dev": true }, + "node_modules/stylelint/node_modules/file-entry-cache": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-7.0.1.tgz", + "integrity": "sha512-uLfFktPmRetVCbHe5UPuekWrQ6hENufnA46qEGbfACkK5drjTTdQYUragRgMjHldcbYG+nslUerqMPjbBSHXjQ==", + "dev": true, + "dependencies": { + "flat-cache": "^3.1.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/stylelint/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -5893,9 +5941,9 @@ } }, "@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", + "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", "dev": true }, "@html-validate/stylish": { @@ -5908,12 +5956,12 @@ } }, "@humanwhocodes/config-array": { - "version": "0.11.11", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", - "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.1", + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", "minimatch": "^3.0.5" } @@ -5925,9 +5973,9 @@ "dev": true }, "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, "@isaacs/cliui": { @@ -6012,12 +6060,12 @@ "optional": true }, "@playwright/test": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", - "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.39.0.tgz", + "integrity": "sha512-3u1iFqgzl7zr004bGPYiN/5EZpRUSFddQBra8Rqll5N0/vfpqlP9I9EXqAoGacuAbX6c9Ulg/Cjqglp5VkK6UQ==", "dev": true, "requires": { - "playwright": "1.38.1" + "playwright": "1.39.0" } }, "@sidvind/better-ajv-errors": { @@ -6048,6 +6096,12 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, + "@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -6736,9 +6790,9 @@ } }, "css-functions-list": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", - "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.1.tgz", + "integrity": "sha512-Nj5YcaGgBtuUmn1D7oHqPW0c9iui7xsTsj5lIX8ZgevdfhmjFfKB3r8moHJtNJnctnYXJyYX5I1pp90HM4TPgQ==", "dev": true }, "css-tree": { @@ -7057,18 +7111,19 @@ "dev": true }, "eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", + "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", - "@humanwhocodes/config-array": "^0.11.11", + "@eslint/js": "8.52.0", + "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -7121,6 +7176,13 @@ } } }, + "eslint-compat-utils": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", + "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", + "dev": true, + "requires": {} + }, "eslint-plugin-header": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", @@ -7146,12 +7208,13 @@ } }, "eslint-plugin-jsonc": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.9.0.tgz", - "integrity": "sha512-RK+LeONVukbLwT2+t7/OY54NJRccTXh/QbnXzPuTLpFMVZhPuq1C9E07+qWenGx7rrQl0kAalAWl7EmB+RjpGA==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.10.0.tgz", + "integrity": "sha512-9d//o6Jyh4s1RxC9fNSt1+MMaFN2ruFdXPG9XZcb/mR2KkfjADYiNL/hbU6W0Cyxfg3tS/XSFuhl5LgtMD8hmw==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", + "eslint-compat-utils": "^0.1.2", "jsonc-eslint-parser": "^2.0.4", "natural-compare": "^1.4.0" } @@ -7337,19 +7400,20 @@ } }, "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "requires": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, "flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, "foreach": { @@ -7634,18 +7698,18 @@ "dev": true }, "html-validate": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/html-validate/-/html-validate-8.5.0.tgz", - "integrity": "sha512-EiRJ7mqRZb68DgxyMlA+5uVheCuNYZiXnoSajcdSTK8IcNuPpyeSI0CZu9wK1jE6jQrWnf8myIa5JkjDByHPuw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/html-validate/-/html-validate-8.7.0.tgz", + "integrity": "sha512-fsDHUxzVNzXzV2KpPOx5GbGRCK0cFs7a8+9jE5QTyYUGAlm1PNGst8Vi0U7hSmootkCBxY3bu7LgQBjjZDeBPw==", "dev": true, "requires": { "@babel/code-frame": "^7.10.0", "@html-validate/stylish": "^4.1.0", "@sidvind/better-ajv-errors": "^2.0.0", "ajv": "^8.0.0", - "deepmerge": "^4.2.0", + "deepmerge": "4.3.1", "glob": "^10.0.0", - "ignore": "^5.0.0", + "ignore": "5.2.4", "kleur": "^4.1.0", "minimist": "^1.2.0", "prompts": "^2.0.0", @@ -8100,6 +8164,12 @@ "xml-name-validator": "^4.0.0" } }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -8146,6 +8216,15 @@ "through": ">=2.2.7 <3" } }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -8159,9 +8238,9 @@ "dev": true }, "known-css-properties": { - "version": "0.28.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.28.0.tgz", - "integrity": "sha512-9pSL5XB4J+ifHP0e0jmmC98OGC1nL8/JjS+fi6mnTlIf//yt/MfVLtKg7S6nCtj/8KTcWX7nRlY0XywoYY1ISQ==", + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.29.0.tgz", + "integrity": "sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==", "dev": true }, "labeled-stream-splicer": { @@ -8680,19 +8759,19 @@ "dev": true }, "playwright": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", - "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.39.0.tgz", + "integrity": "sha512-naE5QT11uC/Oiq0BwZ50gDmy8c8WLPRTEWuSSFVG2egBka/1qMoSqYQcROMT9zLwJ86oPofcTH2jBY/5wWOgIw==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.38.1" + "playwright-core": "1.39.0" } }, "playwright-core": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", - "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.39.0.tgz", + "integrity": "sha512-+k4pdZgs1qiM+OUkSjx96YiKsXsmb59evFoqv8SKO067qBA+Z2s/dCzJij/ZhdQcs2zlTAgRKfeiiLm8PQ2qvw==", "dev": true }, "postcss": { @@ -9364,9 +9443,9 @@ "dev": true }, "stylelint": { - "version": "15.10.3", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.3.tgz", - "integrity": "sha512-aBQMMxYvFzJJwkmg+BUUg3YfPyeuCuKo2f+LOw7yYbU8AZMblibwzp9OV4srHVeQldxvSFdz0/Xu8blq2AesiA==", + "version": "15.11.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.11.0.tgz", + "integrity": "sha512-78O4c6IswZ9TzpcIiQJIN49K3qNoXTM8zEJzhaTE/xRTCZswaovSEVIa/uwbOltZrk16X4jAxjaOhzz/hTm1Kw==", "dev": true, "requires": { "@csstools/css-parser-algorithms": "^2.3.1", @@ -9376,12 +9455,12 @@ "balanced-match": "^2.0.0", "colord": "^2.9.3", "cosmiconfig": "^8.2.0", - "css-functions-list": "^3.2.0", + "css-functions-list": "^3.2.1", "css-tree": "^2.3.1", "debug": "^4.3.4", "fast-glob": "^3.3.1", "fastest-levenshtein": "^1.0.16", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^7.0.0", "global-modules": "^2.0.0", "globby": "^11.1.0", "globjoin": "^0.1.4", @@ -9390,13 +9469,13 @@ "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", - "known-css-properties": "^0.28.0", + "known-css-properties": "^0.29.0", "mathml-tag-names": "^2.1.3", "meow": "^10.1.5", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.27", + "postcss": "^8.4.28", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", "postcss-selector-parser": "^6.0.13", @@ -9417,6 +9496,15 @@ "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", "dev": true }, + "file-entry-cache": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-7.0.1.tgz", + "integrity": "sha512-uLfFktPmRetVCbHe5UPuekWrQ6hENufnA46qEGbfACkK5drjTTdQYUragRgMjHldcbYG+nslUerqMPjbBSHXjQ==", + "dev": true, + "requires": { + "flat-cache": "^3.1.1" + } + }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", diff --git a/package.json b/package.json index ce906797..508268ea 100644 --- a/package.json +++ b/package.json @@ -35,20 +35,20 @@ "sourceDir": "ext" }, "devDependencies": { - "@playwright/test": "^1.38.1", + "@playwright/test": "^1.39.0", "ajv": "^8.11.0", "browserify": "^17.0.0", "css": "^3.0.0", - "eslint": "^8.50.0", + "eslint": "^8.52.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-jsdoc": "^46.8.2", - "eslint-plugin-jsonc": "^2.9.0", + "eslint-plugin-jsonc": "^2.10.0", "eslint-plugin-no-unsanitized": "^4.0.1", "fake-indexeddb": "^4.0.2", - "html-validate": "^8.5.0", + "html-validate": "^8.7.0", "jsdom": "^22.1.0", "parse5": "^7.1.2", - "stylelint": "^15.10.3", + "stylelint": "^15.11.0", "stylelint-config-recommended": "^13.0.0" } } -- cgit v1.2.3 From a8e9248269fa1020d304c6cd60d09ad23234acd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 03:59:10 +0000 Subject: build(deps): bump the minor group with 3 updates Bumps the minor group with 3 updates: [awalsh128/cache-apt-pkgs-action](https://github.com/awalsh128/cache-apt-pkgs-action), [ad-m/github-push-action](https://github.com/ad-m/github-push-action) and [ossf/scorecard-action](https://github.com/ossf/scorecard-action). Updates `awalsh128/cache-apt-pkgs-action` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/awalsh128/cache-apt-pkgs-action/releases) - [Commits](https://github.com/awalsh128/cache-apt-pkgs-action/compare/1850ee53f6e706525805321a3f2f863dcf73c962...44c33b32f808cdddd5ac0366d70595ed63661ed8) Updates `ad-m/github-push-action` from 0.7.0 to 0.8.0 - [Release notes](https://github.com/ad-m/github-push-action/releases) - [Commits](https://github.com/ad-m/github-push-action/compare/29f05e01bb17e6f28228b47437e03a7b69e1f9ef...d91a481090679876dfc4178fef17f286781251df) Updates `ossf/scorecard-action` from 2.2.0 to 2.3.1 - [Release notes](https://github.com/ossf/scorecard-action/releases) - [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md) - [Commits](https://github.com/ossf/scorecard-action/compare/08b4669551908b1024bb425080c797723083c031...0864cf19026789058feabb7e87baa5f140aac736) --- updated-dependencies: - dependency-name: awalsh128/cache-apt-pkgs-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor - dependency-name: ad-m/github-push-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor - dependency-name: ossf/scorecard-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor ... Signed-off-by: dependabot[bot] --- .github/workflows/playwright.yml | 2 +- .github/workflows/publish-firefox-development.yml | 2 +- .github/workflows/scorecard.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 8d4adca8..6ea5b906 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - name: Install CJK fonts - uses: awalsh128/cache-apt-pkgs-action@1850ee53f6e706525805321a3f2f863dcf73c962 # v1.3.0 + uses: awalsh128/cache-apt-pkgs-action@44c33b32f808cdddd5ac0366d70595ed63661ed8 # v1.3.1 with: packages: fonts-ipafont-mincho execute_install_scripts: true diff --git a/.github/workflows/publish-firefox-development.yml b/.github/workflows/publish-firefox-development.yml index 7312bd56..1181277a 100644 --- a/.github/workflows/publish-firefox-development.yml +++ b/.github/workflows/publish-firefox-development.yml @@ -91,7 +91,7 @@ jobs: git commit -a -m "${{ github.ref_name }}" - name: Push changes - uses: ad-m/github-push-action@29f05e01bb17e6f28228b47437e03a7b69e1f9ef # pin@master + uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # pin@master with: branch: metadata diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4db56a60..da73b593 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 with: results_file: results.sarif results_format: sarif -- cgit v1.2.3 From 11aefe0975670dda4323a1be8df675730469f42f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 03:59:18 +0000 Subject: build(deps): bump actions/setup-node from 3 to 4 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- .github/workflows/create-prerelease-on-tag.yml | 2 +- .github/workflows/playwright.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0254cbaa..fc70925f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: ".node-version" diff --git a/.github/workflows/create-prerelease-on-tag.yml b/.github/workflows/create-prerelease-on-tag.yml index 90700f42..97eab1fd 100644 --- a/.github/workflows/create-prerelease-on-tag.yml +++ b/.github/workflows/create-prerelease-on-tag.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: ".node-version" diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 8d4adca8..c5bbc1cf 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -21,7 +21,7 @@ jobs: packages: fonts-ipafont-mincho execute_install_scripts: true - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: cache: "npm" node-version-file: ".node-version" -- cgit v1.2.3 From 5c45643772e6669dc9945c038ebf06c634b19b25 Mon Sep 17 00:00:00 2001 From: jbukl Date: Tue, 31 Oct 2023 22:06:14 -0400 Subject: search, anki playwright tests prep tests for cicd reorganize exports in playwright utils --- .eslintrc.json | 2 + .vscode/settings.json | 5 +- dev/data/manifest-variants.json | 21 +++++++ playwright.config.js | 12 +++- test/playwright/global.setup.js | 32 +++++++++++ test/playwright/global.teardown.js | 28 +++++++++ test/playwright/integration.spec.js | 91 ++++++++++++++++++++++++++++++ test/playwright/playwright-util.js | 109 ++++++++++++++++++++++++++++++++++++ test/playwright/visual.spec.js | 38 +++---------- 9 files changed, 307 insertions(+), 31 deletions(-) create mode 100644 test/playwright/global.setup.js create mode 100644 test/playwright/global.teardown.js create mode 100644 test/playwright/integration.spec.js create mode 100644 test/playwright/playwright-util.js diff --git a/.eslintrc.json b/.eslintrc.json index 06a2be34..56bbcf09 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -461,6 +461,8 @@ }, { "files": [ + "integration.spec.js", + "playwright-util.js", "visual.spec.js" ], "env": { diff --git a/.vscode/settings.json b/.vscode/settings.json index d3738141..9318d9f6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,8 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, - "eslint.format.enable": true + "eslint.format.enable": true, + "playwright.env": { + "PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS": 1 + } } diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json index c9e7cd03..73b2dc13 100644 --- a/dev/data/manifest-variants.json +++ b/dev/data/manifest-variants.json @@ -171,6 +171,27 @@ } ] }, + { + "name": "chrome-playwright", + "inherit": "chrome-dev", + "fileName": "yomitan-chrome-playwright.zip", + "modifications": [ + { + "action": "remove", + "path": [ + "optional_permissions" + ], + "item": "clipboardRead" + }, + { + "action": "add", + "path": [ + "permissions" + ], + "items": ["clipboardRead"] + } + ] + }, { "name": "firefox", "inherit": "base", diff --git a/playwright.config.js b/playwright.config.js index 0f15ff59..11d79e72 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -61,9 +61,19 @@ module.exports = defineConfig({ /* Configure projects for major browsers */ projects: [ + { + name: 'playwright setup', + testMatch: /global\.setup\.js/, + teardown: 'playwright teardown' + }, + { + name: 'playwright teardown', + testMatch: /global\.teardown\.js/ + }, { name: 'chromium', - use: {...devices['Desktop Chrome']} + use: {...devices['Desktop Chrome']}, + dependencies: ['playwright setup'] } // { diff --git a/test/playwright/global.setup.js b/test/playwright/global.setup.js new file mode 100644 index 00000000..442647f8 --- /dev/null +++ b/test/playwright/global.setup.js @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2023 Yomitan Authors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +const {test: setup} = require('@playwright/test'); +const {ManifestUtil} = require('../../dev/manifest-util'); +const {root} = require('./playwright-util'); +const path = require('path'); +const fs = require('fs'); + +const manifestPath = path.join(root, 'ext/manifest.json'); +const copyManifestPath = path.join(root, 'ext/manifest-old.json'); + +setup('use test manifest', () => { + const manifestUtil = new ManifestUtil(); + const variant = manifestUtil.getManifest('chrome-playwright'); + fs.renameSync(manifestPath, copyManifestPath); + fs.writeFileSync(manifestPath, ManifestUtil.createManifestString(variant).replace('$YOMITAN_VERSION', '0.0.0.0')); +}); \ No newline at end of file diff --git a/test/playwright/global.teardown.js b/test/playwright/global.teardown.js new file mode 100644 index 00000000..2fb29ebe --- /dev/null +++ b/test/playwright/global.teardown.js @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 Yomitan Authors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +const {test: teardown} = require('@playwright/test'); +const {root} = require('./playwright-util'); +const path = require('path'); +const fs = require('fs'); + +const manifestPath = path.join(root, 'ext/manifest.json'); +const copyManifestPath = path.join(root, 'ext/manifest-old.json'); + +teardown('bring back original manifest', () => { + fs.renameSync(copyManifestPath, manifestPath); +}); \ No newline at end of file diff --git a/test/playwright/integration.spec.js b/test/playwright/integration.spec.js new file mode 100644 index 00000000..4e4663d6 --- /dev/null +++ b/test/playwright/integration.spec.js @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2023 Yomitan Authors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +const path = require('path'); +const { + test, + expect, + root, + mockModelFieldNames, + mockModelFieldsToAnkiValues, + expectedAddNoteBody, + mockAnkiRouteHandler, + writeToClipboardFromPage +} = require('./playwright-util'); +const {createDictionaryArchive} = require('../../dev/util'); + +test.beforeEach(async ({context}) => { + // wait for the on-install welcome.html tab to load, which becomes the foreground tab + const welcome = await context.waitForEvent('page'); + welcome.close(); // close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang +}); + +test('search clipboard', async ({page, extensionId}) => { + await page.goto(`chrome-extension://${extensionId}/search.html`); + await page.locator('#search-option-clipboard-monitor-container > label').click(); + await page.waitForTimeout(200); // race + + await writeToClipboardFromPage(page, 'あ'); + await expect(page.locator('#search-textbox')).toHaveValue('あ'); +}); + +test('anki add', async ({context, page, extensionId}) => { + // mock anki routes + let resolve; + const addNotePromise = new Promise((res) => { + resolve = res; + }); + await context.route(/127.0.0.1:8765\/*/, (route) => { + mockAnkiRouteHandler(route); + const req = route.request(); + if (req.url().includes('127.0.0.1:8765') && req.postDataJSON().action === 'addNote') { + resolve(req.postDataJSON()); + } + }); + + // open settings + await page.goto(`chrome-extension://${extensionId}/settings.html`); + + // load in test dictionary + const dictionary = createDictionaryArchive(path.join(root, 'test/data/dictionaries/valid-dictionary1'), 'valid-dictionary1'); + const testDictionarySource = await dictionary.generateAsync({type: 'arraybuffer'}); + await page.locator('input[id="dictionary-import-file-input"]').setInputFiles({name: 'valid-dictionary1.zip', buffer: Buffer.from(testDictionarySource)}); + await expect(page.locator('id=dictionaries')).toHaveText('Dictionaries (1 installed, 1 enabled)', {timeout: 5 * 60 * 1000}); + + // connect to anki + await page.locator('.toggle', {has: page.locator('[data-setting="anki.enable"]')}).click(); + await expect(page.locator('#anki-error-message')).toHaveText('Connected'); + + // prep anki deck + await page.locator('[data-modal-action="show,anki-cards"]').click(); + await page.locator('select.anki-card-deck').selectOption('Mock Deck'); + await page.locator('select.anki-card-model').selectOption('Mock Model'); + for (const modelField of mockModelFieldNames) { + await page.locator(`[data-setting="anki.terms.fields.${modelField}"]`).fill(mockModelFieldsToAnkiValues[modelField]); + } + await page.locator('#anki-cards-modal > div > div.modal-footer > button:nth-child(2)').click(); + await writeToClipboardFromPage(page, '読むの例文'); + + // add to anki deck + await page.goto(`chrome-extension://${extensionId}/search.html`); + await page.waitForTimeout(500); // race + await page.locator('#search-textbox').fill('読む'); + await page.locator('#search-textbox').press('Enter'); + await page.locator('[data-mode="term-kanji"]').click(); + const addNoteReqBody = await addNotePromise; + expect(addNoteReqBody).toMatchObject(expectedAddNoteBody); +}); \ No newline at end of file diff --git a/test/playwright/playwright-util.js b/test/playwright/playwright-util.js new file mode 100644 index 00000000..e28f16eb --- /dev/null +++ b/test/playwright/playwright-util.js @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2023 Yomitan Authors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +const path = require('path'); +const {test: base, chromium} = require('@playwright/test'); + +export const root = path.join(__dirname, '..', '..'); + +export const test = base.extend({ + context: async ({ }, use) => { + const pathToExtension = path.join(root, 'ext'); + const context = await chromium.launchPersistentContext('', { + // headless: false, + args: [ + '--headless=new', + `--disable-extensions-except=${pathToExtension}`, + `--load-extension=${pathToExtension}` + ] + }); + await use(context); + await context.close(); + }, + extensionId: async ({context}, use) => { + let [background] = context.serviceWorkers(); + if (!background) { + background = await context.waitForEvent('serviceworker'); + } + + const extensionId = background.url().split('/')[2]; + await use(extensionId); + } +}); +export const expect = test.expect; + +export const mockModelFieldNames = [ + 'Word', + 'Reading', + 'Audio', + 'Sentence' +]; + +export const mockModelFieldsToAnkiValues = { + 'Word': '{expression}', + 'Reading': '{furigana-plain}', + 'Sentence': '{clipboard-text}', + 'Audio': '{audio}' +}; + +export const mockAnkiRouteHandler = (route) => { + const reqBody = route.request().postDataJSON(); + const respBody = ankiRouteResponses[reqBody.action]; + if (!respBody) { + return route.abort(); + } + route.fulfill(respBody); +}; + +export const writeToClipboardFromPage = async (page, text) => { + await page.evaluate(`navigator.clipboard.writeText('${text}')`); +}; + +export const expectedAddNoteBody = { + 'action': 'addNote', + 'params': + { + 'note': { + 'fields': { + 'Word': '読む', 'Reading': '読[よ]む', 'Audio': '[sound:mock_audio.mp3]', 'Sentence': '読むの例文' + }, + 'tags': ['yomitan'], + 'deckName': 'Mock Deck', + 'modelName': 'Mock Model', + 'options': { + 'allowDuplicate': false, 'duplicateScope': 'collection', 'duplicateScopeOptions': { + 'deckName': null, 'checkChildren': false, 'checkAllModels': false + } + } + } + }, 'version': 2 +}; + +const baseAnkiResp = { + status: 200, + contentType: 'text/json' +}; + +const ankiRouteResponses = { + 'version': Object.assign({body: JSON.stringify(6)}, baseAnkiResp), + 'deckNames': Object.assign({body: JSON.stringify(['Mock Deck'])}, baseAnkiResp), + 'modelNames': Object.assign({body: JSON.stringify(['Mock Model'])}, baseAnkiResp), + 'modelFieldNames': Object.assign({body: JSON.stringify(mockModelFieldNames)}, baseAnkiResp), + 'canAddNotes': Object.assign({body: JSON.stringify([true, true])}, baseAnkiResp), + 'storeMediaFile': Object.assign({body: JSON.stringify('mock_audio.mp3')}, baseAnkiResp), + 'addNote': Object.assign({body: JSON.stringify(102312488912)}, baseAnkiResp) +}; \ No newline at end of file diff --git a/test/playwright/visual.spec.js b/test/playwright/visual.spec.js index acb12e97..001f329f 100644 --- a/test/playwright/visual.spec.js +++ b/test/playwright/visual.spec.js @@ -16,40 +16,20 @@ */ const path = require('path'); -const {test: base, chromium} = require('@playwright/test'); -const root = path.join(__dirname, '..', '..'); - -export const test = base.extend({ - context: async ({ }, use) => { - const pathToExtension = path.join(root, 'ext'); - const context = await chromium.launchPersistentContext('', { - // headless: false, - args: [ - '--headless=new', - `--disable-extensions-except=${pathToExtension}`, - `--load-extension=${pathToExtension}` - ] - }); - await use(context); - await context.close(); - }, - extensionId: async ({context}, use) => { - let [background] = context.serviceWorkers(); - if (!background) { - background = await context.waitForEvent('serviceworker'); - } - const extensionId = background.url().split('/')[2]; - await use(extensionId); - } -}); -const expect = test.expect; +const { + test, + expect, + root +} = require('./playwright-util'); -test('visual', async ({context, page, extensionId}) => { +test.beforeEach(async ({context}) => { // wait for the on-install welcome.html tab to load, which becomes the foreground tab const welcome = await context.waitForEvent('page'); welcome.close(); // close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang +}); +test('visual', async ({page, extensionId}) => { // open settings await page.goto(`chrome-extension://${extensionId}/settings.html`); @@ -117,4 +97,4 @@ test('visual', async ({context, page, extensionId}) => { await screenshot(2, i, el, {x: 15, y: 15}); i++; } -}); +}); \ No newline at end of file -- cgit v1.2.3 From 193437fed0f4ee756fd62902947afce54f54dfe6 Mon Sep 17 00:00:00 2001 From: jbukl Date: Wed, 1 Nov 2023 23:10:50 -0400 Subject: add playwright sw env variable in action workflow --- .github/workflows/playwright.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 8d4adca8..be3e2c19 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -66,6 +66,8 @@ jobs: - name: "[PR] Generate new screenshots & compare against master" id: playwright + env: + PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS: 1 run: | npx playwright test 2>&1 | tee ./playwright-output || true continue-on-error: true -- cgit v1.2.3 From 92494e25341f0c2b76f61aded7c41d1021504c4c Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Thu, 2 Nov 2023 22:32:23 +0900 Subject: Bump .node-version to v20 (due to EOL of v16) --- .node-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.node-version b/.node-version index 6f7f377b..9a2a0e21 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v16 +v20 -- cgit v1.2.3 From 857976d1a85c70e0e247d32db9fcda9c12019fbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:43:12 +0000 Subject: build(deps-dev): bump fake-indexeddb from 4.0.2 to 5.0.1 Bumps [fake-indexeddb](https://github.com/dumbmatter/fakeIndexedDB) from 4.0.2 to 5.0.1. - [Release notes](https://github.com/dumbmatter/fakeIndexedDB/releases) - [Changelog](https://github.com/dumbmatter/fakeIndexedDB/blob/master/CHANGELOG.md) - [Commits](https://github.com/dumbmatter/fakeIndexedDB/compare/v4.0.2...v5.0.1) --- updated-dependencies: - dependency-name: fake-indexeddb dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 222 +++--------------------------------------------------- package.json | 2 +- 2 files changed, 11 insertions(+), 213 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20337415..bff02d94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-jsonc": "^2.10.0", "eslint-plugin-no-unsanitized": "^4.0.1", - "fake-indexeddb": "^4.0.2", + "fake-indexeddb": "^5.0.1", "html-validate": "^8.7.0", "jsdom": "^22.1.0", "parse5": "^7.1.2", @@ -767,15 +767,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base64-arraybuffer-es6": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/base64-arraybuffer-es6/-/base64-arraybuffer-es6-0.7.0.tgz", - "integrity": "sha512-ESyU/U1CFZDJUdr+neHRhNozeCv72Y7Vm0m1DCbjX3KBjT6eYocvAJlSk6+8+HkVwXlT1FNxhGW6q3UKAlCvvw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -2035,12 +2026,12 @@ } }, "node_modules/fake-indexeddb": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/fake-indexeddb/-/fake-indexeddb-4.0.2.tgz", - "integrity": "sha512-SdTwEhnakbgazc7W3WUXOJfGmhH0YfG4d+dRPOFoYDRTL6U5t8tvrmkf2W/C3W1jk2ylV7Wrnj44RASqpX/lEw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fake-indexeddb/-/fake-indexeddb-5.0.1.tgz", + "integrity": "sha512-vxybH29Owtc6khV/Usy47B1g+eKwyhFiX8nwpCC4td320jvwrKQDH6vNtcJZgUzVxmfsSIlHzLKQzT76JMCO7A==", "dev": true, - "dependencies": { - "realistic-structured-clone": "^3.0.0" + "engines": { + "node": ">=18" } }, "node_modules/fast-deep-equal": { @@ -3381,12 +3372,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "node_modules/lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", @@ -4357,32 +4342,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/realistic-structured-clone": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/realistic-structured-clone/-/realistic-structured-clone-3.0.0.tgz", - "integrity": "sha512-rOjh4nuWkAqf9PWu6JVpOWD4ndI+JHfgiZeMmujYcPi+fvILUu7g6l26TC1K5aBIp34nV+jE1cDO75EKOfHC5Q==", - "dev": true, - "dependencies": { - "domexception": "^1.0.1", - "typeson": "^6.1.0", - "typeson-registry": "^1.0.0-alpha.20" - } - }, - "node_modules/realistic-structured-clone/node_modules/domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "dependencies": { - "webidl-conversions": "^4.0.2" - } - }, - "node_modules/realistic-structured-clone/node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, "node_modules/redent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", @@ -5244,73 +5203,6 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "node_modules/typeson": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/typeson/-/typeson-6.1.0.tgz", - "integrity": "sha512-6FTtyGr8ldU0pfbvW/eOZrEtEkczHRUtduBnA90Jh9kMPCiFNnXIon3vF41N0S4tV1HHQt4Hk1j4srpESziCaA==", - "dev": true, - "engines": { - "node": ">=0.1.14" - } - }, - "node_modules/typeson-registry": { - "version": "1.0.0-alpha.39", - "resolved": "https://registry.npmjs.org/typeson-registry/-/typeson-registry-1.0.0-alpha.39.tgz", - "integrity": "sha512-NeGDEquhw+yfwNhguLPcZ9Oj0fzbADiX4R0WxvoY8nGhy98IbzQy1sezjoEFWOywOboj/DWehI+/aUlRVrJnnw==", - "dev": true, - "dependencies": { - "base64-arraybuffer-es6": "^0.7.0", - "typeson": "^6.0.0", - "whatwg-url": "^8.4.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/typeson-registry/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/typeson-registry/node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/typeson-registry/node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true, - "engines": { - "node": ">=10.4" - } - }, - "node_modules/typeson-registry/node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", - "dev": true, - "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/umd": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", @@ -6283,12 +6175,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "base64-arraybuffer-es6": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/base64-arraybuffer-es6/-/base64-arraybuffer-es6-0.7.0.tgz", - "integrity": "sha512-ESyU/U1CFZDJUdr+neHRhNozeCv72Y7Vm0m1DCbjX3KBjT6eYocvAJlSk6+8+HkVwXlT1FNxhGW6q3UKAlCvvw==", - "dev": true - }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -7300,13 +7186,10 @@ } }, "fake-indexeddb": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/fake-indexeddb/-/fake-indexeddb-4.0.2.tgz", - "integrity": "sha512-SdTwEhnakbgazc7W3WUXOJfGmhH0YfG4d+dRPOFoYDRTL6U5t8tvrmkf2W/C3W1jk2ylV7Wrnj44RASqpX/lEw==", - "dev": true, - "requires": { - "realistic-structured-clone": "^3.0.0" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fake-indexeddb/-/fake-indexeddb-5.0.1.tgz", + "integrity": "sha512-vxybH29Owtc6khV/Usy47B1g+eKwyhFiX8nwpCC4td320jvwrKQDH6vNtcJZgUzVxmfsSIlHzLKQzT76JMCO7A==", + "dev": true }, "fast-deep-equal": { "version": "3.1.3", @@ -8278,12 +8161,6 @@ "p-locate": "^5.0.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", @@ -9013,34 +8890,6 @@ } } }, - "realistic-structured-clone": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/realistic-structured-clone/-/realistic-structured-clone-3.0.0.tgz", - "integrity": "sha512-rOjh4nuWkAqf9PWu6JVpOWD4ndI+JHfgiZeMmujYcPi+fvILUu7g6l26TC1K5aBIp34nV+jE1cDO75EKOfHC5Q==", - "dev": true, - "requires": { - "domexception": "^1.0.1", - "typeson": "^6.1.0", - "typeson-registry": "^1.0.0-alpha.20" - }, - "dependencies": { - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - } - } - }, "redent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", @@ -9698,57 +9547,6 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "typeson": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/typeson/-/typeson-6.1.0.tgz", - "integrity": "sha512-6FTtyGr8ldU0pfbvW/eOZrEtEkczHRUtduBnA90Jh9kMPCiFNnXIon3vF41N0S4tV1HHQt4Hk1j4srpESziCaA==", - "dev": true - }, - "typeson-registry": { - "version": "1.0.0-alpha.39", - "resolved": "https://registry.npmjs.org/typeson-registry/-/typeson-registry-1.0.0-alpha.39.tgz", - "integrity": "sha512-NeGDEquhw+yfwNhguLPcZ9Oj0fzbADiX4R0WxvoY8nGhy98IbzQy1sezjoEFWOywOboj/DWehI+/aUlRVrJnnw==", - "dev": true, - "requires": { - "base64-arraybuffer-es6": "^0.7.0", - "typeson": "^6.0.0", - "whatwg-url": "^8.4.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, - "requires": { - "punycode": "^2.1.1" - } - }, - "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true - }, - "whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", - "dev": true, - "requires": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" - } - } - } - }, "umd": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", diff --git a/package.json b/package.json index 508268ea..22f5bd56 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-jsonc": "^2.10.0", "eslint-plugin-no-unsanitized": "^4.0.1", - "fake-indexeddb": "^4.0.2", + "fake-indexeddb": "^5.0.1", "html-validate": "^8.7.0", "jsdom": "^22.1.0", "parse5": "^7.1.2", -- cgit v1.2.3 From 0f97d039b85cecee383c19ace205808040b0e855 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:43:51 +0000 Subject: build(deps-dev): bump browserify-sign from 4.2.1 to 4.2.2 Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. - [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md) - [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2) --- updated-dependencies: - dependency-name: browserify-sign dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 63 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20337415..0bfcabe4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -797,9 +797,9 @@ ] }, "node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "dev": true }, "node_modules/brace-expansion": { @@ -966,26 +966,29 @@ } }, "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "dev": true, "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 4" } }, "node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { "inherits": "^2.0.3", @@ -6296,9 +6299,9 @@ "dev": true }, "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "dev": true }, "brace-expansion": { @@ -6453,26 +6456,26 @@ } }, "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "dev": true, "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" }, "dependencies": { "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "requires": { "inherits": "^2.0.3", -- cgit v1.2.3 From 8f77e66af3ed110ab4555005b420300a5e517f52 Mon Sep 17 00:00:00 2001 From: jbukl Date: Thu, 2 Nov 2023 10:22:26 -0400 Subject: Playwright search wait for input success --- test/playwright/integration.spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/playwright/integration.spec.js b/test/playwright/integration.spec.js index 4e4663d6..1bfd39ea 100644 --- a/test/playwright/integration.spec.js +++ b/test/playwright/integration.spec.js @@ -31,7 +31,7 @@ const {createDictionaryArchive} = require('../../dev/util'); test.beforeEach(async ({context}) => { // wait for the on-install welcome.html tab to load, which becomes the foreground tab const welcome = await context.waitForEvent('page'); - welcome.close(); // close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang + await welcome.close(); // close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang }); test('search clipboard', async ({page, extensionId}) => { @@ -82,8 +82,11 @@ test('anki add', async ({context, page, extensionId}) => { // add to anki deck await page.goto(`chrome-extension://${extensionId}/search.html`); - await page.waitForTimeout(500); // race - await page.locator('#search-textbox').fill('読む'); + await expect(async () => { + await page.locator('#search-textbox').clear(); + await page.locator('#search-textbox').fill('読む'); + await expect(page.locator('#search-textbox')).toHaveValue('読む'); + }).toPass({timeout: 5000}); await page.locator('#search-textbox').press('Enter'); await page.locator('[data-mode="term-kanji"]').click(); const addNoteReqBody = await addNotePromise; -- cgit v1.2.3 From 9da441030ee7e6e1c71d30a4e1edb7c02f8da1e1 Mon Sep 17 00:00:00 2001 From: jbukl Date: Thu, 2 Nov 2023 14:35:59 -0400 Subject: Playwright GH action env push fix --- .github/workflows/playwright.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index a0839fe3..3cd8c3b2 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -9,6 +9,8 @@ jobs: playwright: timeout-minutes: 60 runs-on: ubuntu-latest + env: + PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS: 1 steps: - name: Remove all fonts run: rm -rf /usr/share/fonts @@ -66,8 +68,6 @@ jobs: - name: "[PR] Generate new screenshots & compare against master" id: playwright - env: - PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS: 1 run: | npx playwright test 2>&1 | tee ./playwright-output || true continue-on-error: true -- cgit v1.2.3