Last active
July 12, 2020 15:21
-
-
Save XtinaSchelin/1bfb84ae4c4be082d9618d350b3e6d1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Disney Plus Blocking Dammit | |
// @namespace https://xtinas.org | |
// @version 0.1 | |
// @description Block Disney Plus videos of cops and other racist crap. | |
// @author Xtina Schelin | |
// @updateURL https://gist.githubusercontent.com/XtinaSchelin/1bfb84ae4c4be082d9618d350b3e6d1b/raw/413d35ad6002cddd93ff6f17173f562a0691daca/dp_blocking.js | |
// @downloadURL https://gist.githubusercontent.com/XtinaSchelin/1bfb84ae4c4be082d9618d350b3e6d1b/raw/413d35ad6002cddd93ff6f17173f562a0691daca/dp_blocking.js | |
// @match https://www.disneyplus.com/movies/* | |
// @match https://disneyplus.com/movies/* | |
// @match https://www.disneyplus.com/search* | |
// @match https://disneyplus.com/search* | |
// @grant none | |
// ==/UserScript== | |
var result_skips = { | |
"Pocahontas": "168a3654-9a02-4437-aa54-8df1d9bcf771", | |
"Pocahontas II": "0fcc49d1-396c-4968-a85f-8c5242bde4d4" | |
}; | |
var movie_skips = { | |
"Pocahontas": "https://www.disneyplus.com/movies/pocahontas/", | |
"Pocahontas II": "https://www.disneyplus.com/movies/pocahontas-ii-journey-to-a-new-world/" | |
}; | |
/* No more editing */ | |
// Create the lookup lists | |
var skips_result = []; | |
for (var key in result_skips) | |
{ | |
skips_result.push(result_skips[key]); | |
} | |
var skips_movies = []; | |
for (key in movie_skips) | |
{ | |
skips_movies.push(movie_skips[key]); | |
} | |
// Search page only | |
var x = 0; | |
setInterval(function(){ | |
if (document.location.href == "https://www.disneyplus.com/search") | |
{ | |
var divs = document.getElementsByClassName("gv2-asset"); | |
for (x = 0; x < divs.length; x++) | |
{ | |
var gv2key = divs[x].getAttribute("data-gv2key"); | |
if (skips_result.indexOf(gv2key) > -1) | |
{ | |
divs[x].parentNode.removeChild(divs[x]); | |
} | |
} | |
} | |
// Movie pages. | |
else if (document.location.href.indexOf("https://www.disneyplus.com/movies/") > -1) | |
{ | |
for (x = 0; x < skips_movies.length; x++) | |
{ | |
if (document.location.href.indexOf(skips_movies[x]) > -1) | |
{ | |
console.log(document.location.href); | |
document.getElementById("logo").click(); | |
} | |
} | |
} | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment