Skip to content

Commit

Permalink
Pull request #896: AG-8439 handle error occuring on tabs drag
Browse files Browse the repository at this point in the history
Merge in EXTENSIONS/browser-extension from fix/AG-8439 to feature/AG-2737

Squashed commit of the following:

commit efe0a43
Merge: 9736e3e ea1c6a6
Author: Maxim Topciu <maximtop@gmail.com>
Date:   Fri Jun 4 13:18:25 2021 +0300

    Merge branch 'feature/AG-2737' into fix/AG-8439

commit 9736e3e
Author: Maxim Topciu <maximtop@gmail.com>
Date:   Fri Jun 4 07:13:46 2021 +0300

    AG-8439 handle error occuring on tabs drag
  • Loading branch information
maximtop committed Jun 4, 2021
1 parent ea1c6a6 commit 71f6937
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Extension/src/background/extension-api/tabs.js
Expand Up @@ -53,7 +53,12 @@ export const tabsImpl = (function () {
* https://dev.opera.com/extensions/tab-window/#accessing-the-current-tab
* https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/query
*/
const tabs = await browser.tabs.query({ currentWindow: true, active: true });
let tabs;
try {
tabs = await browser.tabs.query({ currentWindow: true, active: true });
} catch (e) {
log.debug(new Error(e.message));
}

if (tabs && tabs.length > 0) {
return tabs[0].id;
Expand Down

0 comments on commit 71f6937

Please sign in to comment.