Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

fix: check if the window of tab is not normal window when create and update the tab #34

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/background.ts
nohzafk marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ async function processTabAndGroup(tab: chrome.tabs.Tab, types: any) {

async function handleNewTab(tab: chrome.tabs.Tab) {
const enable = await getStorage<boolean>("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://"))
) {
Expand All @@ -110,10 +112,12 @@ async function handleTabUpdate(
tab: chrome.tabs.Tab
) {
const enable = await getStorage<boolean>("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"
) {
Expand Down