diff options
author | Jesús <heckyel@hyperbola.info> | 2020-01-01 13:49:39 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-01-01 13:49:39 -0500 |
commit | 80dc73c4d0acca9c674c0e346175f3ebce2174ee (patch) | |
tree | f3d26327e1e033f0e52bbc2d0f0b428d0bd278e4 /scripts-greasemonkey | |
parent | c459c65a4d5382923230533cba89ff7ff98b9e79 (diff) | |
download | book-80dc73c4d0acca9c674c0e346175f3ebce2174ee.tar.lz book-80dc73c4d0acca9c674c0e346175f3ebce2174ee.tar.xz book-80dc73c4d0acca9c674c0e346175f3ebce2174ee.zip |
[Invidious Redirect] fix syntax
Diffstat (limited to 'scripts-greasemonkey')
-rw-r--r-- | scripts-greasemonkey/youtube_to_invidious.user.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts-greasemonkey/youtube_to_invidious.user.js b/scripts-greasemonkey/youtube_to_invidious.user.js index 06d5f38..a5893a9 100644 --- a/scripts-greasemonkey/youtube_to_invidious.user.js +++ b/scripts-greasemonkey/youtube_to_invidious.user.js @@ -87,7 +87,9 @@ function addbtn(){ let btn=document.createElement('a'); btn.innerHTML='<h2>Watch on '+instance+'</h2>'; btn.href='javascript:void(0)'; - btn.onclick=function(){redir();}; + btn.onclick=function(){ + redir(); + } btn.className='skipinv'; title[i].parentNode.appendChild(btn); } @@ -96,8 +98,12 @@ function addbtn(){ if(current){ thumbs=Array.prototype.slice.call(document.getElementsByTagName('img')).filter(ytel); if(b==1)links=Array.prototype.slice.call(document.getElementsByTagName('a')).filter(ythref); - if(thumbs.length>0)thumb(); - if(links.length>0)link(); + if(thumbs.length>0){ + thumb(); + } + if(links.length>0){ + link(); + } statuscheck(); }else{ let title=Array.prototype.slice.call(document.getElementsByTagName('h1')); @@ -113,7 +119,9 @@ let observer=new MutationObserver(function(mutations){ } if(b==1){ links=Array.prototype.slice.call(mutation.target.getElementsByTagName('a')).filter(ythref); - if(links.length>0)link(); + if(links.length>0){ + link(); + } } }else{ skip=Array.prototype.slice.call(mutation.target.getElementsByClassName('skipinv')); |