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:
Divyansh Agrawal
2024-06-16 22:22:41 +05:30
committed by GitHub
parent 3d788b3d31
commit fbf00e474d
6 changed files with 66 additions and 9 deletions
@@ -28,6 +28,7 @@ const extConfig = {
// You may change the following variables to allowed values listed in the corresponding brackets (* means default). Keep the style and keywords intact.
showUpdatePopup: false, // [true, false*] Show a popup tab after extension update (See what's new)
disableVoteSubmission: false, // [true, false*] Disable like/dislike submission (Stops counting your likes and dislikes)
disableLogging: true, // [true*, false] Disable Logging API Response in JavaScript Console.
coloredThumbs: false, // [true, false*] Colorize thumbs (Use custom colors for thumb icons)
coloredBar: false, // [true, false*] Colorize ratio bar (Use custom colors for ratio bar)
colorTheme: "classic", // [classic*, accessible, neon] Color theme (red/green, blue/yellow, pink/cyan)
@@ -51,8 +52,10 @@ let isMobile = location.hostname == "m.youtube.com";
let isShorts = () => location.pathname.startsWith("/shorts");
let mobileDislikes = 0;
function cLog(text, subtext = "") {
subtext = subtext.trim() === "" ? "" : `(${subtext})`;
console.log(`[Return YouTube Dislikes] ${text} ${subtext}`);
if (!extConfig.disableLogging) {
subtext = subtext.trim() === "" ? "" : `(${subtext})`;
console.log(`[Return YouTube Dislikes] ${text} ${subtext}`);
}
}
function isInViewport(element) {