Fix page type never being detected as search page correctly (#867)
This commit is contained in:
parent
c1b5976394
commit
9c7b9d6660
@ -333,7 +333,7 @@ class DisplaySearch extends Display {
|
||||
await this.setupNestedPopups({
|
||||
depth: 1,
|
||||
useProxyPopup: false,
|
||||
isSearchPage: true
|
||||
pageType: 'search'
|
||||
});
|
||||
} catch (e) {
|
||||
yomichan.logError(e);
|
||||
|
@ -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);
|
||||
|
@ -41,7 +41,7 @@
|
||||
parentPopupId: null,
|
||||
parentFrameId: null,
|
||||
useProxyPopup: false,
|
||||
isSearchPage: false,
|
||||
pageType: 'web',
|
||||
allowRootFramePopupProxy: true
|
||||
});
|
||||
await frontend.prepare();
|
||||
|
@ -184,7 +184,8 @@ class DisplayFloat extends Display {
|
||||
depth,
|
||||
parentPopupId,
|
||||
parentFrameId,
|
||||
useProxyPopup: true
|
||||
useProxyPopup: true,
|
||||
pageType: 'popup'
|
||||
});
|
||||
} catch (e) {
|
||||
yomichan.logError(e);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user