Guest User

Untitled

a guest
Jul 9th, 2020
6,477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. // ==UserScript==
  2. // @name NEW POLYMER DISABLE
  3. // @namespace local
  4. // @version 0.1
  5. // @match http*://*/*
  6. // @grant none
  7. // @run-at document-start
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12. var href = document.location.href;
  13. if(!(new RegExp("http(s|):\\/\\/(www.|)youtube.com\\/").test(location.href))){
  14. return;
  15. }
  16. if (href.indexOf("/embed/") == -1 && href.indexOf("studio." == -1)) {
  17. if (href.indexOf("disable_polymer") == -1 && href.indexOf("app") == -1) {
  18. document.location += (href.indexOf("?") == -1 ? "?":"&") + "app=desktop&disable_polymer=1";
  19. }
  20. }
  21. var locationhref = location.href;
  22. Refresh();
  23. function Refresh(){
  24. setTimeout(function(){ Refresh() }, 500);
  25. if((locationhref != location.href && location.href.indexOf("app") == -1)){
  26. location = location;
  27. }
  28. else{
  29. if(location.href.indexOf("homepage=youtubefuckyou") != -1){
  30. console.log("CLICKING LOGO!");
  31. 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!
  32. }
  33. else{
  34. if(location.href.indexOf("/?") != -1 && IsNewYouTube()){
  35. console.log("NEW YOUTUBE ON THE HOMEPAGE!");
  36. location.href = "https://www.youtube.com/watch?v=nihROg5WlJk&homepage=youtubefuckyou&app=desktop&disable_polymer=1"; // Goes to the special URL seen above
  37. }
  38. }
  39. }
  40. }
  41.  
  42. function IsNewYouTube(){
  43. return(document.getElementsByTagName("html")[0].getAttribute("lang") == "en-US");
  44. }
  45. function IsOldYouTube(){
  46. return(document.getElementsByTagName("html")[0].getAttribute("lang") == "en");
  47. }
  48. function ClickLogo(){
  49. if(document.getElementById("logo-container") != undefined){
  50. document.getElementById("logo-container").click();
  51. }
  52. else{
  53. setTimeout(function(){ ClickLogo(); }, 500);
  54. }
  55. }
  56. })();
Add Comment
Please, Sign In to add comment