From 6e062f92d771e46c66adbece28b5f9d3d04be9e2 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Thu, 7 Jul 2022 20:00:33 +0200 Subject: [PATCH] Attempt to fix a problem where previous page request influenced the score of the new page --- extended-request.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extended-request.ts b/extended-request.ts index cd23f20..37a4091 100644 --- a/extended-request.ts +++ b/extended-request.ts @@ -117,9 +117,10 @@ export default class ExtendedRequest { async cacheOrigin(): Promise { let url: string; - if (this.data.tabId && this.data.tabId >= 0) { - const tab = await browser.tabs.get(this.data.tabId); - url = tab.url; + if (this.data.type === 'main_frame') { + url = this.data.url; + } else if (this.data.originUrl) { + url = this.data.originUrl; } else if ( (this.data as any)?.frameAncestors && (this.data as any).frameAncestors[0] !== undefined