Skip to content

Commit ae50409

Browse files
committed
Return tab correctly
1 parent bd26dd3 commit ae50409

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webextensions/common/tst-api.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ async function getTabsByQueries(queries, { windowId, queryOptions, sender }) {
13921392
populate: true
13931393
}).catch(ApiTabs.createErrorHandler());
13941394
const activeWindow = TabsStore.windows.get(windowId || win.id) || win;
1395-
const tabs = await Promise.all(queries.map(id => getTabsByQuery({ id, activeWindow, queryOptions, sender }).catch(error => {
1395+
const tabs = await Promise.all(queries.map(query => getTabsByQuery(query, { activeWindow, queryOptions, sender }).catch(error => {
13961396
console.error(error);
13971397
return null;
13981398
})));
@@ -1401,12 +1401,12 @@ async function getTabsByQueries(queries, { windowId, queryOptions, sender }) {
14011401
return tabs.flat().filter(tab => !!tab);
14021402
}
14031403

1404-
async function getTabsByQuery({ query, activeWindow, queryOptions, sender }) {
1404+
async function getTabsByQuery(query, { activeWindow, queryOptions, sender }) {
14051405
log('getTabsByQuery: ', { query, activeWindow, queryOptions, sender });
14061406
if (query && typeof query == 'object' && typeof query.id == 'number') // tabs.Tab
14071407
query = query.id;
1408+
let id = query;
14081409
query = String(query).toLowerCase();
1409-
let id = query;
14101410
let baseTab = Tab.getActiveTab(activeWindow.id);
14111411

14121412
// this sometimes happen when the active tab was detached from the window

0 commit comments

Comments
 (0)