Skip to content

Commit

Permalink
Update youtube-subscribe-click.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ashp0 authored Feb 18, 2021
1 parent c08fda1 commit 4f29ed4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions youtube-subscribe-click.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@

(function() {
'use strict';
// Click the subscribe button
document.getElementsByClassName("style-scope ytd-button-renderer style-destructive size-default")[0].click();
// Then close the window

// Your code here...
try
{
var btnelem=document.getElementsByClassName('style-scope ytd-subscribe-button-renderer')[0];
var subscribed = (btnelem.innerText.search("UNSUB")==-1)?false:true;
}catch(Exception){window.close()}
if(!subscribed){
document.getElementsByClassName('style-scope ytd-subscribe-button-renderer')[0].click();
}
window.close();
})();

0 comments on commit 4f29ed4

Please sign in to comment.