move getBrowser to utils.js

This commit is contained in:
Leon Bubova committed 2021-12-18 00:07:15 +01:00
1 parent 4d9f706904
commit 954967e701
2 files changed
+17 -16

No files matched your search

+15 -1
View File
@@ -25,4 +25,18 @@ function numberFormat(numberState) {
return formatter.format(roundDown(numberState));
}
export { numberFormat }
function getBrowser() {
if (typeof chrome !== "undefined" && typeof chrome.runtime !== "undefined") {
return chrome;
} else if (
typeof browser !== "undefined" &&
typeof browser.runtime !== "undefined"
) {
return browser;
} else {
console.log("browser is not supported");
return false;
}
}
export { numberFormat, getBrowser }