diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-01-20 23:13:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 04:13:17 +0000 |
commit | 6ba1ffe74558dd174e3308d48885fb068fa37d55 (patch) | |
tree | 5519bbf972096e0e3370171d2b62a26d6164d671 /ext/js/display/display.js | |
parent | ebdde1ee612a262256ad0384131e53bc29b1e10f (diff) |
WebExtension class (#551)
* Add WebExtension class
* Use WebExtension class
* Use WebExtension instance for all runtime message sending
* Use getUrl
* Add a sendMessage variant which ignores the response and error
Diffstat (limited to 'ext/js/display/display.js')
-rw-r--r-- | ext/js/display/display.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 677c7c4b..689481f4 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -390,7 +390,7 @@ export class Display extends EventDispatcher { * @param {Error} error */ onError(error) { - if (yomitan.isExtensionUnloaded) { return; } + if (yomitan.webExtension.unloaded) { return; } log.error(error); } @@ -727,8 +727,7 @@ export class Display extends EventDispatcher { /** @type {import('display').WindowApiHandler<'displayExtensionUnloaded'>} */ _onMessageExtensionUnloaded() { - if (yomitan.isExtensionUnloaded) { return; } - yomitan.triggerExtensionUnloaded(); + yomitan.webExtension.triggerUnloaded(); } // Private @@ -1894,7 +1893,7 @@ export class Display extends EventDispatcher { * @param {import('text-scanner').SearchedEventDetails} details */ _onContentTextScannerSearched({type, dictionaryEntries, sentence, textSource, optionsContext, error}) { - if (error !== null && !yomitan.isExtensionUnloaded) { + if (error !== null && !yomitan.webExtension.unloaded) { log.error(error); } |