Răsfoiți Sursa

Fixed global declaration error

Variable 'jsInitChecktimer' wasn't declared globally, so it was causing a problem with the new declaration 'let' (instead of 'var' for a better compliance with ES2015 standards).
Kalinka 3 ani în urmă
părinte
comite
d917142772
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      Extensions/UserScript/Return Youtube Dislike.user.js

+ 3 - 1
Extensions/UserScript/Return Youtube Dislike.user.js

@@ -404,6 +404,8 @@ function getDislikesFromYoutubeResponse(htmlResponse) {
 }
 
 function setEventListeners(evt) {
+  let jsInitChecktimer;
+  
   function checkForJS_Finish(check) {
     console.log();
     if (getButtons()?.offsetParent && isVideoLoaded()) {
@@ -425,7 +427,7 @@ function setEventListeners(evt) {
     (isMobile && evt?.indexOf("watch?") >= 0)
   ) {
     cLog("Setting up...");
-    let jsInitChecktimer = setInterval(checkForJS_Finish, 111);
+    jsInitChecktimer = setInterval(checkForJS_Finish, 111);
   }
 }