Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Add an explicit error message if the search result tab is closed when…
Browse files Browse the repository at this point in the history
… you as for the next result
  • Loading branch information
ianb committed Nov 5, 2019
1 parent 93dc7ba commit 11bacf8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion extension/intents/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,14 @@ this.intents.search = (function() {
tabSearchResults.set(tab.id, searchInfo);
} else {
lastTabId = tabId;
await context.makeTabActive(tabId);
try {
await context.makeTabActive(tabId);
} catch (e) {
if (String(e).includes("Invalid tab ID")) {
e.displayMessage = "The search results tab has been closed";
}
throw e;
}
await browser.tabs.update(tabId, { url: item.url });
}
},
Expand Down

0 comments on commit 11bacf8

Please sign in to comment.