Skip to content

Commit

Permalink
Store cache to the first (normal) tab instead of the last tab. #1907
Browse files Browse the repository at this point in the history
Generally leftmost tab may be long-live.
  • Loading branch information
piroor committed Jun 26, 2019
1 parent 9114cb1 commit 2fe575c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webextensions/background/background-cache.js
Expand Up @@ -303,7 +303,7 @@ async function getWindowCache(owner, key) {
}

function getWindowCacheOwner(windowId) {
const tab = Tab.getLastTab(windowId);
const tab = Tab.getFirstNormalTab(windowId) || Tab.getFirstTab(windowId);
if (!tab)
return null;
return {
Expand Down
2 changes: 1 addition & 1 deletion webextensions/sidebar/sidebar-cache.js
Expand Up @@ -421,7 +421,7 @@ async function getWindowCache(key) {
}

function getWindowCacheOwner() {
return Tab.getLastTab(mTargetWindow);
return Tab.getFirstNormalTab(mTargetWindow) || Tab.getFirstTab(mTargetWindow);
}

export async function reserveToUpdateCachedTabbar() {
Expand Down

0 comments on commit 2fe575c

Please sign in to comment.