Don't use hard coded browser name prefix 2

This commit is contained in:
Aaron-P 2019-04-14 19:42:04 -06:00 committed by GitHub
parent a804b75f09
commit ba885834ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ const messageHandler = {
// We use this to catch redirected tabs that have just opened
// If this were in platform we would change how the tab opens based on "new tab" link navigations such as ctrl+click
LAST_CREATED_TAB_TIMER: 2000,
BROWSER_NAME = (await browser.runtime.getBrowserInfo()).name.toLowerCase(),
init() {
// Handles messages from webextension code
@ -148,8 +149,8 @@ const messageHandler = {
this.lastCreatedTab = tab;
if (tab.cookieStoreId) {
// Don't count firefox-default, firefox-private, nor our own confirm page loads
if (tab.cookieStoreId !== "firefox-default" &&
tab.cookieStoreId !== "firefox-private" &&
if (tab.cookieStoreId !== this.BROWSER_NAME + "-default" &&
tab.cookieStoreId !== this.BROWSER_NAME + "-private" &&
!tab.url.startsWith("moz-extension")) {
// increment the counter of container tabs opened
this.incrementCountOfContainerTabsOpened();