Don't use hard coded browser name prefix 3

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

View file

@ -9,6 +9,7 @@ const DEFAULT_COLOR = "blue";
const DEFAULT_ICON = "circle";
const NEW_CONTAINER_ID = "new";
const BROWSER_NAME = (await browser.runtime.getBrowserInfo()).name.toLowerCase();
const ONBOARDING_STORAGE_KEY = "onboarding-stage";
// List of panels
@ -202,7 +203,7 @@ const Logic = {
},
userContextId(cookieStoreId = "") {
const userContextId = cookieStoreId.replace("firefox-container-", "");
const userContextId = cookieStoreId.replace(BROWSER_NAME + "-container-", "");
return (userContextId !== cookieStoreId) ? Number(userContextId) : false;
},