Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
own3mall committed Feb 27, 2021
1 parent 4edbc4e commit 82cdfb2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Binary file modified release/YouTubeNonStop.xpi
Binary file not shown.
19 changes: 17 additions & 2 deletions src/chrome/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var shouldSwitchTab = false;
var initEvent = null;
var isTypingInSearchBox = false;
var aButton = null;
var closestPaperDiag;

/* Functions */

Expand Down Expand Up @@ -126,7 +127,7 @@ var YouTubeNonStopObj = {
pauseButton = arrayOfDoms[i].getElementById('confirm-button');
if(pauseButton){
dateNow = new Date();
var closestPaperDiag = pauseButton.closest('paper-dialog');
closestPaperDiag = pauseButton.closest('paper-dialog');
if(closestPaperDiag && closestPaperDiag != null && !closestPaperDiag.getAttribute("aria-hidden")){
log("YouTubeNonStop: Resuming playback and clicking on the confirm button on " + dateNow.toLocaleDateString() + " " + dateNow.toLocaleTimeString('en-US') + "!");
pauseButton.click();
Expand All @@ -153,11 +154,25 @@ var YouTubeNonStopObj = {
}
}

// Check for randomly appearing login nag screen
signInButton = arrayOfDoms[i].querySelector('div.yt-player-error-message-renderer div#dismiss-button');
if(signInButton){
dateNow = new Date();
log("YouTubeNonStop: Resuming playback and clicking on the Not Now button for the YouTube randomly appearing signin nag screen on " + dateNow.toLocaleDateString() + " " + dateNow.toLocaleTimeString('en-US') + "!");
signInButton.click();
aButton = signInButton.getElementsByTagName('a');
if(aButton && aButton.length){
aButton[0].click();
}
YouTubeNonStopObj.playAudio(arrayOfDoms[i], arrayOfTabs[i], true);
}

// Check for agree button nag screen
agreeButton = arrayOfDoms[i].getElementById('introAgreeButton');
if(agreeButton){
closestPaperDiag = agreeButton.closest('paper-dialog');
dateNow = new Date();
if(YouTubeNonStopObj.isVisible(agreeButton)){
if(closestPaperDiag && closestPaperDiag != null && !closestPaperDiag.getAttribute("aria-hidden")){
log("YouTubeNonStop: Resuming playback and clicking on the agree button for the YouTube cookies annoying nag screen on " + dateNow.toLocaleDateString() + " " + dateNow.toLocaleTimeString('en-US') + "!");
agreeButton.click();
aButton = agreeButton.getElementsByTagName('a');
Expand Down
2 changes: 1 addition & 1 deletion src/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<em:id>own3mall0@gmail.com</em:id>
<em:name>YouTubeNonStop</em:name>
<em:description>Kiss the annoying "Video paused. Continue watching?" and "Get the best YouTube experience sign in nag screen" confirmation goodbye!</em:description>
<em:version>1.0.5</em:version>
<em:version>1.0.6</em:version>
<em:type>2</em:type>

<em:creator>own3mall</em:creator>
Expand Down

0 comments on commit 82cdfb2

Please sign in to comment.