aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/yomichan.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-08-01 16:22:00 -0400
committerGitHub <noreply@github.com>2020-08-01 16:22:00 -0400
commit1e839cd230e53f822478f945cb415a8af2b09aef (patch)
treeeeb4c9552ce591b52642f38542f83f8094066231 /ext/mixed/js/yomichan.js
parentb52074b3f0df09b9e37a210789507aa553a2dc9d (diff)
More display refactoring (#697)
* Remove some unnecessary _setQuery calls * Add support for forcing the query parser to be visible or hidden * Move _setEventListenersActive calls * Remove URL for kanji links * Refactor _setContentTermsOrKanji * Move search query text assignment into Display * Move title updates into Display * Move popup close calls * Prevent infinite loop of extension unload events
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