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
1 changed files with 4 additions and 3 deletions

View File

@ -117,9 +117,10 @@ export default class ExtendedRequest {
async cacheOrigin(): Promise<void> {
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