Skip to content

Commit 0f19ec0

Browse files
authored
Fix Extraction with Multiple Windows Open (#100)
1 parent 703efba commit 0f19ec0

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/js/exports.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export async function injectTab({
2020

2121
// Extract tabIds from all highlighted tabs
2222
const tabIds = []
23-
const tabs = await chrome.tabs.query({ highlighted: true })
23+
const tabs = await chrome.tabs.query({
24+
currentWindow: true,
25+
highlighted: true,
26+
})
2427
if (!tabs.length) {
2528
const [tab] = await chrome.tabs.query({
2629
currentWindow: true,

src/js/popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async function initPopup() {
7070
}
7171

7272
async function processFileTypes(hasPerms) {
73-
const [tab] = await chrome.tabs.query({ active: true })
73+
const [tab] = await chrome.tabs.query({ currentWindow: true, active: true })
7474
console.debug('tab:', tab)
7575
const url = new URL(tab.url)
7676
// console.debug('url:', url)

0 commit comments

Comments
 (0)