Sfoglia il codice sorgente

Fix: "has been blocked by CORS policy" for redirection from "youtube.com"

Yuriy Chumak 3 anni fa
parent
commit
06ff0045a0
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      Extensions/UserScript/Return Youtube Dislike.user.js

+ 2 - 2
Extensions/UserScript/Return Youtube Dislike.user.js

@@ -199,7 +199,7 @@ function setState() {
   if (isMobile) {
     GM.xmlHttpRequest({
       method: "GET",
-      url: `https://youtube.com/watch?v=${getVideoId()}`,
+      url: `https://www.youtube.com/watch?v=${getVideoId()}`,
       headers: {
         "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.3674"
       },
@@ -219,7 +219,7 @@ function setState() {
     });
   }
   else {
-    fetch(`https://youtube.com/watch?v=${getVideoId()}`).then((response) => {
+    fetch(`https://www.youtube.com/watch?v=${getVideoId()}`).then((response) => {
       response.text().then((text) => {
         let result = getDislikesFromYoutubeResponse(text);
         if (result) {