瀏覽代碼

Fix Clips functionality

mphelp 3 年之前
父節點
當前提交
728680f84b

+ 4 - 8
Extensions/UserScript/Return Youtube Dislike.user.js

@@ -7,7 +7,8 @@
 // @description  Return of the YouTube Dislike, Based off https://www.returnyoutubedislike.com/
 // @icon         https://github.com/Anarios/return-youtube-dislike/raw/main/Icons/Return%20Youtube%20Dislike%20-%20Transparent.png
 // @author       Anarios & JRWR
-// @match        *://*.youtube.com/*
+// @match        *://*.youtube.com/watch*
+// @match        *://*.youtube.com/clip*
 // @exclude      *://music.youtube.com/*
 // @exclude      *://*.music.youtube.com/*
 // @compatible   chrome
@@ -348,13 +349,8 @@ function setEventListeners(evt) {
     }
   }
 
-  if (
-    window.location.href.indexOf("watch?") >= 0 ||
-    (isMobile && evt?.indexOf("watch?") >= 0)
-  ) {
-    cLog("Setting up...");
-    jsInitChecktimer = setInterval(checkForJS_Finish, 111);
-  }
+  cLog("Setting up...");
+  jsInitChecktimer = setInterval(checkForJS_Finish, 111);
 }
 
 (function () {

+ 1 - 5
Extensions/combined/manifest-chrome.json

@@ -19,11 +19,7 @@
   },
   "content_scripts": [
     {
-      "matches": [
-        "*://youtube.com/*",
-        "*://www.youtube.com/*",
-        "*://m.youtube.com/*"
-      ],
+      "matches": ["*://*.youtube.com/watch*", "*://*.youtube.com/clip*"],
       "exclude_matches": ["*://*.music.youtube.com/*"],
       "js": ["ryd.content-script.js"],
       "css": ["content-style.css"]

+ 1 - 1
Extensions/combined/manifest-firefox.json

@@ -16,7 +16,7 @@
   },
   "content_scripts": [
     {
-      "matches": ["*://*.youtube.com/*"],
+      "matches": ["*://*.youtube.com/watch*", "*://*.youtube.com/clip*"],
       "exclude_matches": ["*://*.music.youtube.com/*"],
       "run_at": "document_idle",
       "css": ["content-style.css"],

+ 1 - 3
Extensions/combined/ryd.content-script.js

@@ -44,9 +44,7 @@ function setEventListeners(evt) {
     }
   }
 
-  if (window.location.href.indexOf("watch?") >= 0) {
-    jsInitChecktimer = setInterval(checkForJS_Finish, 111);
-  }
+  jsInitChecktimer = setInterval(checkForJS_Finish, 111);
 }
 
 setEventListeners();