aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-10 15:49:56 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-11 21:04:30 +0300
commit565e3a8c6ad31afa0ddb171ac5a33b6b84e5c3dc (patch)
tree965d5d3b29cb45df2d9c3dbabf0de9811372e682 /ext/fg/js/frontend.js
parentb9035854b2b45979c16f8733bb66993f6ce044fe (diff)
change iframe popup live
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index a6df4b4c..f969df32 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -29,7 +29,7 @@ class Frontend extends TextScanner {
constructor(popup, initEventDispatcher) {
super(
window,
- popup.isProxy() ? [] : [popup.getContainer()],
+ () => this.popup.isProxy() ? [] : [this.popup.getContainer()],
[(x, y) => this.popup.containsPoint(x, y)],
() => this.popup.depth <= this.options.scanning.popupNestingMaxDepth && !this._disabledOverride
);
@@ -78,6 +78,7 @@ class Frontend extends TextScanner {
}
this.initEventDispatcher.on('setDisabledOverride', this.onSetDisabledOverride.bind(this));
+ this.initEventDispatcher.on('popupChange', this.onPopupChange.bind(this));
yomichan.on('orphaned', this.onOrphaned.bind(this));
yomichan.on('optionsUpdated', this.updateOptions.bind(this));
@@ -242,6 +243,12 @@ class Frontend extends TextScanner {
}
}
+ async onPopupChange({popup}) {
+ this.onSearchClear(true);
+ this.popup = popup;
+ await popup.setOptions(this.options);
+ }
+
getOptionsContext() {
this.optionsContext.url = this.popup.url;
return this.optionsContext;
@@ -274,7 +281,7 @@ class Frontend extends TextScanner {
}
_broadcastRootPopupInformation() {
- if (!this.popup.isProxy() && this.popup.depth === 0) {
+ if (!this.popup.isProxy() && this.popup.depth === 0 && this.popup.frameId === 0) {
apiBroadcastTab('rootPopupInformation', {popupId: this.popup.id, frameId: this.popup.frameId});
}
}