From c11356485ec29f4359171c8ec2f770fd7613ecd3 Mon Sep 17 00:00:00 2001 From: patricklamar Date: Sun, 10 Dec 2023 15:10:46 +0800 Subject: [PATCH] fix: check if the window of tab is not normal window when create and update the tab --- src/background.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/background.ts b/src/background.ts index 95b385c..2cb8238 100644 --- a/src/background.ts +++ b/src/background.ts @@ -88,10 +88,12 @@ async function processTabAndGroup(tab: chrome.tabs.Tab, types: any) { async function handleNewTab(tab: chrome.tabs.Tab) { const enable = await getStorage("isOn"); + const window = await chrome.windows.get(tab.windowId); if ( !enable || !tab.id || !tab.url || + window.type != "normal" || !types.length || (tab.status === "complete" && tab.url.startsWith("chrome://")) ) { @@ -110,10 +112,12 @@ async function handleTabUpdate( tab: chrome.tabs.Tab ) { const enable = await getStorage("isOn"); + const window = await chrome.windows.get(tab.windowId); if ( !enable || !tab.id || !tab.url || + window.type != "normal" || tab.url.startsWith("chrome://") || changeInfo.status !== "complete" ) {