mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-22 14:23:01 +01:00
move getBrowser to utils.js
This commit is contained in:
1 parent
4d9f706904
commit
954967e701
2 files changed
+17
-16
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
getDislikeButton,
|
||||
checkForSignInButton,
|
||||
} from "./src/buttons";
|
||||
|
||||
import {
|
||||
isMobile,
|
||||
isVideoDisliked,
|
||||
@@ -17,7 +18,7 @@ import {
|
||||
NEUTRAL_STATE,
|
||||
} from "./src/state";
|
||||
|
||||
import { numberFormat } from "./src/utils";
|
||||
import { numberFormat, getBrowser } from "./src/utils";
|
||||
|
||||
let storedData = {
|
||||
likes: 0,
|
||||
@@ -253,17 +254,3 @@ document.addEventListener("yt-navigate-finish", function (event) {
|
||||
});
|
||||
|
||||
setTimeout(() => sendVideoIds(), 2500);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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 }
|
||||
Reference in new issue
Block a user