Fix page type never being detected as search page correctly (#867)

This commit is contained in:
toasted-nutbread 2020-09-26 18:47:58 -04:00 committed by GitHub
parent c1b5976394
commit 9c7b9d6660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 9 deletions

View File

@ -333,7 +333,7 @@ class DisplaySearch extends Display {
await this.setupNestedPopups({
depth: 1,
useProxyPopup: false,
isSearchPage: true
pageType: 'search'
});
} catch (e) {
yomichan.logError(e);

View File

@ -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);

View File

@ -41,7 +41,7 @@
parentPopupId: null,
parentFrameId: null,
useProxyPopup: false,
isSearchPage: false,
pageType: 'web',
allowRootFramePopupProxy: true
});
await frontend.prepare();

View File

@ -184,7 +184,8 @@ class DisplayFloat extends Display {
depth,
parentPopupId,
parentFrameId,
useProxyPopup: true
useProxyPopup: true,
pageType: 'popup'
});
} catch (e) {
yomichan.logError(e);

View File

@ -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);
}

View File

@ -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();