mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-30 09:57:52 +01:00
Fix: "has been blocked by CORS policy" for redirection from "youtube.com"
This commit is contained in:
1 parent
85dd78f415
commit
06ff0045a0
1 file changed
+2
-2
@@ -199,7 +199,7 @@ function setState() {
|
|||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
GM.xmlHttpRequest({
|
GM.xmlHttpRequest({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: `https://youtube.com/watch?v=${getVideoId()}`,
|
url: `https://www.youtube.com/watch?v=${getVideoId()}`,
|
||||||
headers: {
|
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"
|
"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 {
|
else {
|
||||||
fetch(`https://youtube.com/watch?v=${getVideoId()}`).then((response) => {
|
fetch(`https://www.youtube.com/watch?v=${getVideoId()}`).then((response) => {
|
||||||
response.text().then((text) => {
|
response.text().then((text) => {
|
||||||
let result = getDislikesFromYoutubeResponse(text);
|
let result = getDislikesFromYoutubeResponse(text);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|||||||
Reference in new issue
Block a user