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({
|
await this.setupNestedPopups({
|
||||||
depth: 1,
|
depth: 1,
|
||||||
useProxyPopup: false,
|
useProxyPopup: false,
|
||||||
isSearchPage: true
|
pageType: 'search'
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
yomichan.logError(e);
|
yomichan.logError(e);
|
||||||
|
@ -62,7 +62,7 @@ class PopupPreviewFrame {
|
|||||||
parentPopupId: null,
|
parentPopupId: null,
|
||||||
parentFrameId: null,
|
parentFrameId: null,
|
||||||
useProxyPopup: false,
|
useProxyPopup: false,
|
||||||
isSearchPage: false,
|
pageType: 'web',
|
||||||
allowRootFramePopupProxy: false
|
allowRootFramePopupProxy: false
|
||||||
});
|
});
|
||||||
this._frontendGetOptionsContextOld = this._frontend.getOptionsContext.bind(this._frontend);
|
this._frontendGetOptionsContextOld = this._frontend.getOptionsContext.bind(this._frontend);
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
parentPopupId: null,
|
parentPopupId: null,
|
||||||
parentFrameId: null,
|
parentFrameId: null,
|
||||||
useProxyPopup: false,
|
useProxyPopup: false,
|
||||||
isSearchPage: false,
|
pageType: 'web',
|
||||||
allowRootFramePopupProxy: true
|
allowRootFramePopupProxy: true
|
||||||
});
|
});
|
||||||
await frontend.prepare();
|
await frontend.prepare();
|
||||||
|
@ -184,7 +184,8 @@ class DisplayFloat extends Display {
|
|||||||
depth,
|
depth,
|
||||||
parentPopupId,
|
parentPopupId,
|
||||||
parentFrameId,
|
parentFrameId,
|
||||||
useProxyPopup: true
|
useProxyPopup: true,
|
||||||
|
pageType: 'popup'
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
yomichan.logError(e);
|
yomichan.logError(e);
|
||||||
|
@ -30,7 +30,7 @@ class Frontend {
|
|||||||
parentPopupId,
|
parentPopupId,
|
||||||
parentFrameId,
|
parentFrameId,
|
||||||
useProxyPopup,
|
useProxyPopup,
|
||||||
isSearchPage,
|
pageType,
|
||||||
allowRootFramePopupProxy
|
allowRootFramePopupProxy
|
||||||
}) {
|
}) {
|
||||||
this._id = generateId(16);
|
this._id = generateId(16);
|
||||||
@ -55,7 +55,7 @@ class Frontend {
|
|||||||
this._parentPopupId = parentPopupId;
|
this._parentPopupId = parentPopupId;
|
||||||
this._parentFrameId = parentFrameId;
|
this._parentFrameId = parentFrameId;
|
||||||
this._useProxyPopup = useProxyPopup;
|
this._useProxyPopup = useProxyPopup;
|
||||||
this._isSearchPage = isSearchPage;
|
this._pageType = pageType;
|
||||||
this._depth = depth;
|
this._depth = depth;
|
||||||
this._frameId = frameId;
|
this._frameId = frameId;
|
||||||
this._popupFactory = popupFactory;
|
this._popupFactory = popupFactory;
|
||||||
@ -392,7 +392,7 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
if (this._updatePopupToken !== token) { return; }
|
if (this._updatePopupToken !== token) { return; }
|
||||||
|
|
||||||
if (this._isSearchPage) {
|
if (this._pageType === 'search') {
|
||||||
this.setDisabledOverride(!this._options.scanning.enableOnSearchPage);
|
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([
|
await dynamicLoader.loadScripts([
|
||||||
'/mixed/js/text-scanner.js',
|
'/mixed/js/text-scanner.js',
|
||||||
'/mixed/js/frame-client.js',
|
'/mixed/js/frame-client.js',
|
||||||
@ -385,7 +385,7 @@ class Display extends EventDispatcher {
|
|||||||
parentPopupId,
|
parentPopupId,
|
||||||
parentFrameId,
|
parentFrameId,
|
||||||
useProxyPopup,
|
useProxyPopup,
|
||||||
isSearchPage: false,
|
pageType,
|
||||||
allowRootFramePopupProxy: true
|
allowRootFramePopupProxy: true
|
||||||
});
|
});
|
||||||
await frontend.prepare();
|
await frontend.prepare();
|
||||||
|
Loading…
Reference in New Issue
Block a user