Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name NEW POLYMER DISABLE
- // @namespace local
- // @version 0.1
- // @match http*://*/*
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- (function() {
- 'use strict';
- var href = document.location.href;
- if(!(new RegExp("http(s|):\\/\\/(www.|)youtube.com\\/").test(location.href))){
- return;
- }
- if (href.indexOf("/embed/") == -1 && href.indexOf("studio." == -1)) {
- if (href.indexOf("disable_polymer") == -1 && href.indexOf("app") == -1) {
- document.location += (href.indexOf("?") == -1 ? "?":"&") + "app=desktop&disable_polymer=1";
- }
- }
- var locationhref = location.href;
- Refresh();
- function Refresh(){
- setTimeout(function(){ Refresh() }, 500);
- if((locationhref != location.href && location.href.indexOf("app") == -1)){
- location = location;
- }
- else{
- if(location.href.indexOf("homepage=youtubefuckyou") != -1){
- console.log("CLICKING LOGO!");
- setTimeout(function(){ ClickLogo(); }, 500); // This is the only known way to get this to work at this time. There might be a better way, but knowing youtube there probably isn't. Contact me at reddit (u/altf4tsp) with any more info!
- }
- else{
- if(location.href.indexOf("/?") != -1 && IsNewYouTube()){
- console.log("NEW YOUTUBE ON THE HOMEPAGE!");
- location.href = "https://www.youtube.com/watch?v=nihROg5WlJk&homepage=youtubefuckyou&app=desktop&disable_polymer=1"; // Goes to the special URL seen above
- }
- }
- }
- }
- function IsNewYouTube(){
- return(document.getElementsByTagName("html")[0].getAttribute("lang") == "en-US");
- }
- function IsOldYouTube(){
- return(document.getElementsByTagName("html")[0].getAttribute("lang") == "en");
- }
- function ClickLogo(){
- if(document.getElementById("logo-container") != undefined){
- document.getElementById("logo-container").click();
- }
- else{
- setTimeout(function(){ ClickLogo(); }, 500);
- }
- }
- })();
Add Comment
Please, Sign In to add comment