aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/yomichan.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js/yomichan.js')
-rw-r--r--ext/mixed/js/yomichan.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mixed/js/yomichan.js b/ext/mixed/js/yomichan.js
index 6eba68b2..2de82274 100644
--- a/ext/mixed/js/yomichan.js
+++ b/ext/mixed/js/yomichan.js
@@ -48,6 +48,7 @@ const yomichan = (() => {
}
this._isExtensionUnloaded = false;
+ this._isTriggeringExtensionUnloaded = false;
this._isReady = false;
const {promise, resolve} = deferPromise();
@@ -256,7 +257,13 @@ const yomichan = (() => {
triggerExtensionUnloaded() {
this._isExtensionUnloaded = true;
- this.trigger('extensionUnloaded');
+ if (this._isTriggeringExtensionUnloaded) { return; }
+ try {
+ this._isTriggeringExtensionUnloaded = true;
+ this.trigger('extensionUnloaded');
+ } finally {
+ this._isTriggeringExtensionUnloaded = false;
+ }
}
// Private