mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-01 18:31:24 +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,
|
getDislikeButton,
|
||||||
checkForSignInButton,
|
checkForSignInButton,
|
||||||
} from "./src/buttons";
|
} from "./src/buttons";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
isMobile,
|
isMobile,
|
||||||
isVideoDisliked,
|
isVideoDisliked,
|
||||||
@@ -17,7 +18,7 @@ import {
|
|||||||
NEUTRAL_STATE,
|
NEUTRAL_STATE,
|
||||||
} from "./src/state";
|
} from "./src/state";
|
||||||
|
|
||||||
import { numberFormat } from "./src/utils";
|
import { numberFormat, getBrowser } from "./src/utils";
|
||||||
|
|
||||||
let storedData = {
|
let storedData = {
|
||||||
likes: 0,
|
likes: 0,
|
||||||
@@ -253,17 +254,3 @@ document.addEventListener("yt-navigate-finish", function (event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => sendVideoIds(), 2500);
|
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));
|
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