aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/yomichan.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-18 14:15:36 -0400
committerGitHub <noreply@github.com>2020-07-18 14:15:36 -0400
commitdac33e696145ad3c2cfe076a7fadc82c05732102 (patch)
tree06dff8bd7dd2d8ebad5a025cf71e2910b2af80d4 /ext/mixed/js/yomichan.js
parentf9c76efea00ff62021119c4d0fcf414e8988be1d (diff)
Extension unload indication fix (#662)
* Remove unused function * Rename field * Change extensionUnloaded trigger function * Update how extension unloaded content is shown * Ignore certain errors caused by extension unload * Add _showExtensionUnloaded function * Wrap internals of updateOptions * Suppress errors caued by extension unload * Make the frontend trigger the popup's extensionUnloaded event
Diffstat (limited to 'ext/mixed/js/yomichan.js')
-rw-r--r--ext/mixed/js/yomichan.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/mixed/js/yomichan.js b/ext/mixed/js/yomichan.js
index 7fffbaa6..33870658 100644
--- a/ext/mixed/js/yomichan.js
+++ b/ext/mixed/js/yomichan.js
@@ -196,7 +196,7 @@ const yomichan = (() => {
try {
return chrome.runtime.sendMessage(...args);
} catch (e) {
- this._onExtensionUnloaded(e);
+ this.triggerExtensionUnloaded();
throw e;
}
}
@@ -205,7 +205,7 @@ const yomichan = (() => {
try {
return chrome.runtime.connect(...args);
} catch (e) {
- this._onExtensionUnloaded(e);
+ this.triggerExtensionUnloaded();
throw e;
}
}
@@ -247,13 +247,13 @@ const yomichan = (() => {
}
}
- // Private
-
- _onExtensionUnloaded(error) {
+ triggerExtensionUnloaded() {
this._isExtensionUnloaded = true;
- this.trigger('extensionUnloaded', {error});
+ this.trigger('extensionUnloaded');
}
+ // Private
+
_getUrl() {
return (typeof window === 'object' && window !== null ? window.location.href : '');
}