Skip to content

Commit

Permalink
Send tabs from the background to sidebar pages whether they are detec…
Browse files Browse the repository at this point in the history
…ted as opened or not #2200
  • Loading branch information
piroor committed May 1, 2019
1 parent 0d21bcb commit 9cad91b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions webextensions/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,10 @@ async function notifyReadyToSidebars() {
log('notifyReadyToSidebars: start');
const promisedResults = [];
for (const window of TabsStore.windows.values()) {
// Skip windows already detected as "opened", because the "opened" status
// means that the connection is estabilished and there is no need to
// receive tabs exported at here.
if (SidebarConnection.isOpen(window.id))
continue;
// Send PING to all windows whether they are detected as "opened" or "not opened yet",
// because the connection may be established before this background page starts listening
// of messages from sidebar pages.
// See also: https://github.com/piroor/treestyletab/issues/2200
TabsUpdate.completeLoadingTabs(window.id); // failsafe
log(`notifyReadyToSidebars: to ${window.id}`);
promisedResults.push(browser.runtime.sendMessage({
Expand Down

0 comments on commit 9cad91b

Please sign in to comment.