Skip to content

Commit

Permalink
Fix Extraction with Multiple Windows Open (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
smashedr committed Sep 5, 2024
1 parent 703efba commit 0f19ec0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/js/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export async function injectTab({

// Extract tabIds from all highlighted tabs
const tabIds = []
const tabs = await chrome.tabs.query({ highlighted: true })
const tabs = await chrome.tabs.query({
currentWindow: true,
highlighted: true,
})
if (!tabs.length) {
const [tab] = await chrome.tabs.query({
currentWindow: true,
Expand Down
2 changes: 1 addition & 1 deletion src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function initPopup() {
}

async function processFileTypes(hasPerms) {
const [tab] = await chrome.tabs.query({ active: true })
const [tab] = await chrome.tabs.query({ currentWindow: true, active: true })
console.debug('tab:', tab)
const url = new URL(tab.url)
// console.debug('url:', url)
Expand Down

0 comments on commit 0f19ec0

Please sign in to comment.