Skip to content

Commit

Permalink
Updated Release To Stop Code from Looking for Dismiss Dialogs in Cert…
Browse files Browse the repository at this point in the history
…ain YouTube Sections
  • Loading branch information
own3mall committed Oct 25, 2022
1 parent 3d9008c commit 8fff0fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Binary file modified release/YouTubeNonStop.xpi
Binary file not shown.
14 changes: 12 additions & 2 deletions src/chrome/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var debug = false; // Set to true to make it work on any page (test using the in
var extraInfo = false; // Set to true for more logging
var interval = null;
var matchStr = "youtube.com";
var ignoredAreas = new Array('youtube.com/c/', 'youtube.com/c', 'youtube.com/channel/', 'studio.youtube.com', 'youtube.com/account', 'youtube.com/user/');


// Global Non-Settings
Expand Down Expand Up @@ -65,7 +66,7 @@ var YouTubeNonStopObj = {
for(i = 0; i < tabs.length; i++){
tabUrl = gBrowser.getBrowserForTab(tabs[i]).contentDocument.URL;
tab = gBrowser.getBrowserForTab(tabs[i]).contentDocument;
if(tabUrl.toLowerCase().indexOf(matchStr) != -1){
if(tabUrl.toLowerCase().indexOf(matchStr) != -1 && !YouTubeNonStopObj.isYouTubeIgnoredArea(tabUrl.toLowerCase())){
arrayOfDoms.push(tab);
arrayOfTabs.push(tabs[i]);
arrayUrls.push(tabUrl);
Expand All @@ -81,6 +82,15 @@ var YouTubeNonStopObj = {
}
runningLoopDetection = false;
},
isYouTubeIgnoredArea: function(url){
for(var k = 0; k < ignoredAreas.length; k++){
if(url.indexOf(ignoredAreas[k]) != -1){
//log("YouTubeNonStop: YouTube ignored area detected on URL \"" + url + "\"! Skipping this page!");
return true;
}
}
return false;
},
youTubeMonitor: function(){
clearInterval(interval);
interval = setInterval(function(){
Expand Down Expand Up @@ -244,7 +254,7 @@ var YouTubeNonStopObj = {
return false;
},
isVisible: function(element){
return (element.offsetWidth > 0 || element.offsetHeight > 0)
return (element.offsetWidth > 0 || element.offsetHeight > 0);
}
};

Expand Down
4 changes: 2 additions & 2 deletions 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.7</em:version>
<em:version>1.0.8</em:version>
<em:type>2</em:type>

<em:creator>own3mall</em:creator>
Expand All @@ -21,7 +21,7 @@
<Description>
<em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id>
<em:minVersion>27.0</em:minVersion>
<em:maxVersion>29.*</em:maxVersion>
<em:maxVersion>31.*</em:maxVersion>
</Description>
</em:targetApplication>

Expand Down

0 comments on commit 8fff0fb

Please sign in to comment.