Attempt to fix a problem where previous page request influenced the score of the new page

This commit is contained in:
Kuba Orlik 2022-07-07 20:00:33 +02:00
parent d512e3cede
commit 6e062f92d7

View File

@ -117,9 +117,10 @@ export default class ExtendedRequest {
async cacheOrigin(): Promise<void> { async cacheOrigin(): Promise<void> {
let url: string; let url: string;
if (this.data.tabId && this.data.tabId >= 0) { if (this.data.type === 'main_frame') {
const tab = await browser.tabs.get(this.data.tabId); url = this.data.url;
url = tab.url; } else if (this.data.originUrl) {
url = this.data.originUrl;
} else if ( } else if (
(this.data as any)?.frameAncestors && (this.data as any)?.frameAncestors &&
(this.data as any).frameAncestors[0] !== undefined (this.data as any).frameAncestors[0] !== undefined