Extension Releases/Support • Re: Bypass Cloudflare with Firefox Cookies
Found a minor issue with the code to replace the Add-ons Manager icon. If you stay in the Add-ons Manager, pick any other extension or category then back, the original icon will return. If you close the Add-ons Manager and reopen it (i.e. its tab) the same will occur. The new icon only "sticks" for the first visit in the Add-ons Manager.
Played a bit with AI and the only solution was to replace this in the uc.js file:
From:
CODE:
setTimeout(function() { // icon replacement}, 100);To:
CODE:
setInterval(function() { // icon replacement}, 3000);This change was also suggested:
CODE:
"if(page_URL == "about:addons"){to:
CODE:
if(page_URL.startsWith("about:addons")){
I ran some tests myself and found the same issue. However, the solution suggested by AI isn't a good one because "setInterval 3000" causes the code to run every 3 seconds, even if the "about:addons" page isn't open.
Screenshots:
Below is a new code for the "change__bypass_cloudflare_with_firefox_cookies__addon_icon.uc.js" file that worked without any problems in the tests I ran:
CODE:
function get_Operating_System__change__bypass_cloudflare_with_firefox_cookies__addon_LOGO_icon() { var os = Services.appinfo.OS.toLowerCase();if (os.startsWith("win")) {return "Windows";} else if (os == "linux") {return "Linux";} else{return "";}}gBrowser.addProgressListener({ onLocationChange: function() {var page_URL = gBrowser.contentDocument.location.href;if(page_URL == "about:addons"){/*var hour = new Date().toLocaleFormat("%H");var minute = new Date().toLocaleFormat("%M");var second = new Date().toLocaleFormat("%S");var time_now = hour + ":" + minute + ":" + second;console.log('Message from "about:addons" Page - Time Now = ' + time_now + ' ');*/setTimeout(function() {var arr_addons = content.document.getElementsByClassName("addon addon-view");if(arr_addons){for(var i=0; i<arr_addons.length; i++){var addon = arr_addons[i];var addon_name = addon.getAttribute("name");if(addon_name == 'Bypass Cloudflare with "Backup Browser" Cookies'){var directoryService = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties);var ProfilesDir = directoryService.get("ProfD", Components.interfaces.nsIFile);var ProfilesDir_Path = ProfilesDir.path;var addon_LOGO_icon_PATH = "";var operating_system = get_Operating_System__change__bypass_cloudflare_with_firefox_cookies__addon_LOGO_icon();if(operating_system == "Windows"){ProfilesDir_Path = ProfilesDir_Path.replace(/\\/g,'/');addon_LOGO_icon_PATH = 'file:///' + ProfilesDir_Path + "/chrome/bypass_cloudflare_with_firefox_cookies_LOGO.png";} else if(operating_system == "Linux"){addon_LOGO_icon_PATH = 'file:///' + ProfilesDir_Path + "/chrome/bypass_cloudflare_with_firefox_cookies_LOGO.png";}addon._icon.src = addon_LOGO_icon_PATH;}}}}, 1000);}}});
I kept the "setTimeout" function and increased the waiting time from 100 to 1000. I don't think 3000 is necessary, but if you notice any issues, you can increase this waiting time.
I also kept the following: if(page_URL == "about:addons"){
There is no need for if(page_URL.startsWith("about:addons")){ because the entire page URL is "about:addons," not just the beginning of the URL.
Screenshot:
The issue with the "Status Bar" height involves several factors to consider, so I'll dedicate another post to it.
Discussion in the ATmosphere