From c459c65a4d5382923230533cba89ff7ff98b9e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Wed, 1 Jan 2020 13:42:10 -0500 Subject: [YouTube to Invidious] remove embed, function is part of Invidious Embed --- scripts-greasemonkey/youtube_to_invidious.user.js | 66 +---------------------- 1 file changed, 2 insertions(+), 64 deletions(-) diff --git a/scripts-greasemonkey/youtube_to_invidious.user.js b/scripts-greasemonkey/youtube_to_invidious.user.js index b807431..06d5f38 100644 --- a/scripts-greasemonkey/youtube_to_invidious.user.js +++ b/scripts-greasemonkey/youtube_to_invidious.user.js @@ -2,7 +2,7 @@ // @name YouTube to Invidious // @author OdinBrood, Jesús E. // @namespace InvidiousRedirect -// @description Scan page for Youtube embeds and urls and replace with Invidious. +// @description Scan page for Youtube urls and replace with Invidious. // @homepageURL https://libregit.org/heckyel/book/src/branch/master/scripts-greasemonkey // @include * // @exclude /^http(s|)://(www[.]|)invidio[.]us/.*$/ @@ -35,10 +35,9 @@ let d=1; //set to 0 to disable Invidious proxy [default 1] let e=1; //set to 0 to disable bypass of url shorteners [default 1] let ytdomains=new RegExp(/http(s|):\/\/(m[.]|i[.]|www[.]|img[.]|)(youtu(|be|be-nocookie)|.*ytimg)[.](com|be)\/.*/); -let shorteners=new RegExp(/^http(s|):\/\/(bit.ly|goo.gl|tinyurl.com|t.co|ow.ly|is.gd|buff.ly|deck.ly|su.pr|lnk.co|fur.ly|moourl.com|)\/.*/); let params=new RegExp(/^(autoplay|channel|v|playlist|list)$/); let current=window.location.href.match(ytdomains)===null; -let frames,thumbs,links,skip; +let thumbs,links,skip; function statuscheck(){ // Console Feedback @@ -53,64 +52,11 @@ function link(){ } } -function embed(){ - for(let i=0;i0){ - embed(); - } if(thumbs.length>0)thumb(); if(links.length>0)link(); statuscheck(); @@ -165,11 +107,7 @@ if(current){ let observer=new MutationObserver(function(mutations){ mutations.forEach(function(mutation){ if(current){ - frames=Array.prototype.slice.call(mutation.target.getElementsByTagName('iframe')).filter(ytel); thumbs=Array.prototype.slice.call(mutation.target.getElementsByTagName('img')).filter(ytel); - if(frames.length>0){ - embed(); - } if(thumbs.length>0){ thumb(); } -- cgit v1.2.3