summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-26 18:47:58 -0400
committerGitHub <noreply@github.com>2020-09-26 18:47:58 -0400
commit9c7b9d666087add0f72900c045ee43ed05c5b467 (patch)
tree25094cf37cdb542f96736d2286bb5a7761a15467
parentc1b59763941a74367b81e9b8329319f1ede72317 (diff)
Fix page type never being detected as search page correctly (#867)
-rw-r--r--ext/bg/js/search.js2
-rw-r--r--ext/bg/js/settings/popup-preview-frame.js2
-rw-r--r--ext/fg/js/content-script-main.js2
-rw-r--r--ext/fg/js/float.js3
-rw-r--r--ext/fg/js/frontend.js6
-rw-r--r--ext/mixed/js/display.js4
6 files changed, 10 insertions, 9 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index f5b4a671..af88bb76 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -333,7 +333,7 @@ class DisplaySearch extends Display {
await this.setupNestedPopups({
depth: 1,
useProxyPopup: false,
- isSearchPage: true
+ pageType: 'search'
});
} catch (e) {
yomichan.logError(e);
diff --git a/ext/bg/js/settings/popup-preview-frame.js b/ext/bg/js/settings/popup-preview-frame.js
index eb174917..bce5919d 100644
--- a/ext/bg/js/settings/popup-preview-frame.js
+++ b/ext/bg/js/settings/popup-preview-frame.js
@@ -62,7 +62,7 @@ class PopupPreviewFrame {
parentPopupId: null,
parentFrameId: null,
useProxyPopup: false,
- isSearchPage: false,
+ pageType: 'web',
allowRootFramePopupProxy: false
});
this._frontendGetOptionsContextOld = this._frontend.getOptionsContext.bind(this._frontend);
diff --git a/ext/fg/js/content-script-main.js b/ext/fg/js/content-script-main.js
index 84e78392..a427d10f 100644
--- a/ext/fg/js/content-script-main.js
+++ b/ext/fg/js/content-script-main.js
@@ -41,7 +41,7 @@
parentPopupId: null,
parentFrameId: null,
useProxyPopup: false,
- isSearchPage: false,
+ pageType: 'web',
allowRootFramePopupProxy: true
});
await frontend.prepare();
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 7f673bd5..bfa2195e 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -184,7 +184,8 @@ class DisplayFloat extends Display {
depth,
parentPopupId,
parentFrameId,
- useProxyPopup: true
+ useProxyPopup: true,
+ pageType: 'popup'
});
} catch (e) {
yomichan.logError(e);
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index e3988c94..13b0d80c 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -30,7 +30,7 @@ class Frontend {
parentPopupId,
parentFrameId,
useProxyPopup,
- isSearchPage,
+ pageType,
allowRootFramePopupProxy
}) {
this._id = generateId(16);
@@ -55,7 +55,7 @@ class Frontend {
this._parentPopupId = parentPopupId;
this._parentFrameId = parentFrameId;
this._useProxyPopup = useProxyPopup;
- this._isSearchPage = isSearchPage;
+ this._pageType = pageType;
this._depth = depth;
this._frameId = frameId;
this._popupFactory = popupFactory;
@@ -392,7 +392,7 @@ class Frontend {
}
if (this._updatePopupToken !== token) { return; }
- if (this._isSearchPage) {
+ if (this._pageType === 'search') {
this.setDisabledOverride(!this._options.scanning.enableOnSearchPage);
}
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 377a491d..e5f12a1a 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -361,7 +361,7 @@ class Display extends EventDispatcher {
}
}
- async setupNestedPopups({depth, parentPopupId, parentFrameId, useProxyPopup}) {
+ async setupNestedPopups({depth, parentPopupId, parentFrameId, useProxyPopup, pageType}) {
await dynamicLoader.loadScripts([
'/mixed/js/text-scanner.js',
'/mixed/js/frame-client.js',
@@ -385,7 +385,7 @@ class Display extends EventDispatcher {
parentPopupId,
parentFrameId,
useProxyPopup,
- isSearchPage: false,
+ pageType,
allowRootFramePopupProxy: true
});
await frontend.prepare();