mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-23 23:03:01 +01:00
Added Option to Disable Logging By Default (#474)
* Added Option to Disable Logging By Default
* Added Userscript Support to Disable Logging
* Formatting and Fixed Compiling
* Updated Description of Setting Option
* Whitespace 😅
* Dot in Description of Setting option
* Typo in JAVASCRIPT
This commit is contained in:
1 parent
3d788b3d31
commit
fbf00e474d
6 files changed
+66
-9
No files matched your search
@@ -25,6 +25,7 @@ const NEUTRAL_STATE = "NEUTRAL_STATE";
|
||||
|
||||
let extConfig = {
|
||||
disableVoteSubmission: false,
|
||||
disableLogging: true,
|
||||
coloredThumbs: false,
|
||||
coloredBar: false,
|
||||
colorTheme: "classic",
|
||||
@@ -298,6 +299,7 @@ async function setInitialState() {
|
||||
|
||||
async function initExtConfig() {
|
||||
initializeDisableVoteSubmission();
|
||||
initializeDisableLogging();
|
||||
initializeColoredThumbs();
|
||||
initializeColoredBar();
|
||||
initializeColorTheme();
|
||||
@@ -332,6 +334,16 @@ function initializeDisableVoteSubmission() {
|
||||
});
|
||||
}
|
||||
|
||||
function initializeDisableLogging() {
|
||||
getBrowser().storage.sync.get(["disableLogging"], (res) => {
|
||||
if (res.disableLogging === undefined) {
|
||||
getBrowser().storage.sync.set({ disableLogging: true });
|
||||
} else {
|
||||
extConfig.disableLogging = res.disableLogging;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initializeColoredThumbs() {
|
||||
getBrowser().storage.sync.get(["coloredThumbs"], (res) => {
|
||||
if (res.coloredThumbs === undefined) {
|
||||
|
||||
@@ -103,11 +103,13 @@ function isVideoLoaded() {
|
||||
}
|
||||
|
||||
function cLog(message, writer) {
|
||||
message = `[return youtube dislike]: ${message}`;
|
||||
if (writer) {
|
||||
writer(message);
|
||||
} else {
|
||||
console.log(message);
|
||||
if (!extConfig.disableLogging){
|
||||
message = `[return youtube dislike]: ${message}`;
|
||||
if (writer) {
|
||||
writer(message);
|
||||
} else {
|
||||
console.log(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user