-
Notifications
You must be signed in to change notification settings - Fork 11
/
checkForAddonsUpdates.html
35 lines (33 loc) · 23.4 KB
/
checkForAddonsUpdates.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML>
<meta charset="utf-8"/>
<title>Check for Addons Updates [0.1.6pre4 - 2021-03-28]</title>
<body>
<a href="custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3ECheck%20for%20Addons%20Updates%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABEVBMVEUAAAARdxEcTL9YluZYmelgmeZOkOU4f+BOk+hShdpVh9szmTNHd9MeWckdWMkRdxEfhR9Vu1UdVcYRdxGI7ohHrUcdXMwdWMkcUcMcTsFRgthv1G8zmTNVkuVhleJflOJckeFclONEh+JJkLpNiuFKi+Mpb9g8f95knOdcj99ajd9Lg9xkmeVem+kyiIxonudYidscTL9Kf9g2cdQiY9AjbqdgmeZbleVZmOhCl5Y8ctMmYs4/g+EdZqBmm+VTlOc3a89Bgt9XkeNSjeIZX5pHhuAWZ2w5iY43e905iI0rbqkWZmtYj+FTjOAmaKNQj+Qnc3khYJ0jbNchatZXleZgl+Q4dtg2iZYdaG4cWpZZmeovdSBxAAAAEHRSTlMAgH/MoZXKh52fy4Ccv39AzZGpkwAAALNJREFUeF51j8WuAkEQRXsGf9o2Pri7u7s7T///Q2joBbCgkqrknsW5KfB0rP/OR5CudR+B5WS/BVs2Vqm6t+FAy8FBJ/XlHwxD4350xoHH61utg6geORw5iCeS3z8SlSQpw5Ir91IolsomNSil5isAut5oyrLchghCSCEAb713RZlOlRGZfABCrg6MEcJ4jhZ4KVyBql6MbDcqb9G0nUkps5p7DsR8/pcZEfwTwd0I5JPdM/o+FIGIkY8MAAAAAElFTkSuQmCC%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B/*Initialization%20Code*/%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/checkForAddonsUpdates.js%0A//%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fid%3D57958%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Check_for_Addons_Updates%0A%0A//%20Check%20for%20Addons%20Updates%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22code%22%20section%29%0A%0A//%20%28c%29%20Infocatcher%202012-2021%0A//%20version%200.1.6pre4%20-%202021-03-28%0A%0A//%20Button%20just%20open%20hidden%20tab%20with%20about%3Aaddons%20and%20trigger%20built-in%20%22Check%20for%20Updates%22%20function.%0A//%20And%20show%20tab%2C%20if%20found%20updates.%0A%0A%28function%28%29%20%7B%0Avar%20btn%20%3D%20this%20instanceof%20XULElement%0A%09%3F%20this%0A%09%3A%20%7B%20//%20Launched%20not%20from%20custom%20button%0A%09%09image%3A%20%22%22%2C%20//%20Base64-encoded%20icon%20%28if%20empty%2C%20will%20be%20used%20%22imgLoading%22%29%0A%09%09label%3A%20%22Check%20for%20Addons%20Updates%22%2C%0A%09%09tooltipText%3A%20%22%22%0A%09%7D%3B%0Aif%28%22_cb_disabled%22%20in%20btn%29%0A%09return%3B%0Abtn._cb_disabled%20%3D%20true%3B%0A%0Aif%28%21%28%22Services%22%20in%20window%29%29%0A%09Components.utils.import%28%22resource%3A//gre/modules/Services.jsm%22%29%3B%0Avar%20app%20%3D%20Services.appinfo.name%3B%0Avar%20pv%20%3D%20parseFloat%28Services.appinfo.platformVersion%29%3B%0A%0Avar%20ADDONS_URL%20%3D%20%22about%3Aaddons%22%3B%0A%0Avar%20progressIcon%20%3D%20new%20ProgressIcon%28btn%29%3B%0Avar%20image%20%3D%20btn.image%20%7C%7C%20progressIcon.imgLoading%3B%0Avar%20tip%20%3D%20btn.tooltipText%3B%0Abtn.tooltipText%20%3D%20%22Open%20%22%20+%20ADDONS_URL%20+%20%22%u2026%22%3B%0A%0Avar%20tab%2C%20browser%2C%20gBrowser%3B%0Avar%20tbTabInfo%2C%20tbTab%3B%0A%0Avar%20trgWindow%20%3D%20Services.wm.getMostRecentWindow%28%22navigator%3Abrowser%22%29%0A%09%7C%7C%20app%20%3D%3D%20%22Thunderbird%22%20%26%26%20Services.wm.getMostRecentWindow%28%22mail%3A3pane%22%29%0A%09%7C%7C%20window%3B%0Avar%20trgDocument%20%3D%20trgWindow.document%3B%0Avar%20tabmail%20%3D%20trgDocument.getElementById%28%22tabmail%22%29%3B%0A%0Aif%28tabmail%20%26%26%20app%20%3D%3D%20%22Thunderbird%22%29%20%7B%20//%20Note%3A%20SeaMonkey%20doesn%27t%20support%20content%20tabs%20in%20mail%20window%0A%09let%20addonsWin%3B%0A%09let%20receivePong%20%3D%20function%28subject%2C%20topic%2C%20data%29%20%7B%0A%09%09addonsWin%20%3D%20subject%3B%0A%09%7D%3B%0A%09Services.obs.addObserver%28receivePong%2C%20%22EM-pong%22%2C%20false%29%3B%0A%09Services.obs.notifyObservers%28null%2C%20%22EM-ping%22%2C%20%22%22%29%3B%0A%09Services.obs.removeObserver%28receivePong%2C%20%22EM-pong%22%29%3B%0A%09if%28addonsWin%29%20%7B%0A%09%09let%20rootWindow%20%3D%20addonsWin%0A%09%09%09.QueryInterface%28Components.interfaces.nsIInterfaceRequestor%29%0A%09%09%09.getInterface%28Components.interfaces.nsIWebNavigation%29%0A%09%09%09.QueryInterface%28Components.interfaces.nsIDocShellTreeItem%29%0A%09%09%09.rootTreeItem%0A%09%09%09.QueryInterface%28Components.interfaces.nsIInterfaceRequestor%29%0A%09%09%09.getInterface%28Components.interfaces.nsIDOMWindow%29%3B%0A%09%09tabmail%20%3D%20rootWindow.document.getElementById%28%22tabmail%22%29%3B%0A%09%09tbTabInfo%20%3D%20tabmail.getBrowserForDocument%28addonsWin%29%3B%0A%09%09tbTab%20%3D%20tab%20%3D%20tbTabInfo.tabNode%3B%0A%09%09processAddonsTab%28addonsWin%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09Services.obs.addObserver%28function%20observer%28subject%2C%20topic%2C%20data%29%20%7B%0A%09%09%09Services.obs.removeObserver%28observer%2C%20topic%29%3B%0A%09%09%09if%28subject.document.readyState%20%3D%3D%20%22complete%22%29%0A%09%09%09%09processAddonsTab%28subject%29%3B%0A%09%09%09else%20%7B%0A%09%09%09%09subject.addEventListener%28%22load%22%2C%20function%20onLoad%28e%29%20%7B%0A%09%09%09%09%09subject.removeEventListener%28e.type%2C%20onLoad%2C%20false%29%3B%0A%09%09%09%09%09processAddonsTab%28subject%29%3B%0A%09%09%09%09%7D%2C%20false%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20%22EM-loaded%22%2C%20false%29%3B%0A%09%09//%20See%20openAddonsMgr%28%29%20-%3E%20openContentTab%28%29%0A%09%09tbTabInfo%20%3D%20tabmail.openTab%28%22contentTab%22%2C%20%7B%0A%09%09%09contentPage%3A%20ADDONS_URL%2C%0A%09%09%09clickHandler%3A%20%22specialTabs.siteClickHandler%28event%2C%20/addons%5C.mozilla%5C.org/%29%3B%22%2C%0A%09%09%09background%3A%20true%0A%09%09%7D%29%3B%0A%09%09tbTab%20%3D%20tab%20%3D%20tbTabInfo.tabNode%3B%0A%09%09tbTab.collapsed%20%3D%20true%3B%0A%09%09//%20Note%3A%20dontSelectHiddenTab%28%29%20not%20implemented%0A%09%7D%0A%7D%0Aelse%20if%28%22gBrowser%22%20in%20trgWindow%20%26%26%20trgWindow.gBrowser.tabs%29%20%7B%0A%09let%20isPending%20%3D%20false%3B%0A%09let%20ws%20%3D%20Services.wm.getEnumerator%28%22navigator%3Abrowser%22%29%3B%0A%09windowsLoop%3A%0A%09while%28ws.hasMoreElements%28%29%29%20%7B%0A%09%09let%20w%20%3D%20ws.getNext%28%29%3B%0A%09%09let%20tabs%20%3D%20w.gBrowser.tabs%3B%0A%09%09for%28let%20i%20%3D%200%2C%20l%20%3D%20tabs.length%3B%20i%20%3C%20l%3B%20++i%29%20%7B%0A%09%09%09let%20t%20%3D%20tabs%5Bi%5D%3B%0A%09%09%09if%28%0A%09%09%09%09%21t.closing%0A%09%09%09%09%26%26%20t.linkedBrowser%0A%09%09%09%09%26%26%20t.linkedBrowser.currentURI.spec%20%3D%3D%20ADDONS_URL%0A%09%09%09%29%20%7B%0A%09%09%09%09tab%20%3D%20t%3B%0A%09%09%09%09break%20windowsLoop%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09gBrowser%20%3D%20trgWindow.gBrowser%3B%0A%09if%28%21tab%29%20%7B%0A%09%09tab%20%3D%20gBrowser.addTab%28ADDONS_URL%2C%20%7B%0A%09%09%09triggeringPrincipal%3A%20%22Services%22%20in%20window%20//%20Firefox%2063+%0A%09%09%09%09%26%26%20Services.scriptSecurityManager%0A%09%09%09%09%26%26%20Services.scriptSecurityManager.getSystemPrincipal%28%29%0A%09%09%7D%29%3B%0A%09%09tab.collapsed%20%3D%20true%3B%0A%09%09tab.closing%20%3D%20true%3B%20//%20See%20%22visibleTabs%22%20getter%20in%20chrome%3A//browser/content/tabbrowser.xml%0A%09%09trgWindow.addEventListener%28%22TabSelect%22%2C%20dontSelectHiddenTab%2C%20false%29%3B%0A%09%7D%0A%09else%20if%28%0A%09%09tab.getAttribute%28%22pending%22%29%20%3D%3D%20%22true%22%20//%20Gecko%20%3E%3D%209.0%0A%09%09%7C%7C%20tab.linkedBrowser.contentDocument.readyState%20%3D%3D%20%22uninitialized%22%0A%09%09//%20%7C%7C%20tab.linkedBrowser.__SS_restoreState%20%3D%3D%201%0A%09%29%0A%09%09isPending%20%3D%20true%3B%0A%0A%09browser%20%3D%20tab.linkedBrowser%3B%0A%09if%28%0A%09%09isPending%0A%09%09%7C%7C%20browser.webProgress.isLoadingDocument%0A%09%09%7C%7C%20browser.currentURI.spec%20%3D%3D%20%22about%3Ablank%22%20//%20Firefox%2079+%0A%09%29%20%7B%0A%09%09browser.addEventListener%28%22load%22%2C%20processAddonsTab%2C%20true%29%3B%0A%09%09if%28isPending%29%20%7B%0A%09%09%09if%28pv%20%3E%3D%2041%29%20%7B%0A%09%09%09%09//%20Workaround%20to%20correctly%20restore%20pending%20tab%0A%09%09%09%09//%20See%20https%3A//github.com/Infocatcher/Custom_Buttons/issues/39%0A%09%09%09%09let%20selTab%20%3D%20gBrowser.selectedTab%3B%0A%09%09%09%09gBrowser.selectedTab%20%3D%20tab%3B%0A%09%09%09%09gBrowser.selectedTab%20%3D%20selTab%3B%0A%09%09%09%7D%0A%09%09%09else%20%7B%0A%09%09%09%09browser.reload%28%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09else%20%7B%0A%09%09processAddonsTab%28%29%3B%0A%09%7D%0A%7D%0Aelse%20%7B%0A%09progressIcon.restore%28%29%3B%0A%09btn.tooltipText%20%3D%20tip%3B%0A%09delete%20btn._cb_disabled%3B%0A%09Services.prompt.alert%28window%2C%20btn.label%2C%20%22Error%3A%20Can%27t%20find%20supported%20window%21%22%29%3B%0A%09return%3B%0A%7D%0A%0Afunction%20processAddonsTab%28e%2C%20again%29%20%7B%0A%09var%20doc%3B%0A%09if%28e%20%26%26%20e%20instanceof%20Components.interfaces.nsIDOMWindow%29%20%7B%0A%09%09doc%20%3D%20e.document%3B%0A%09%7D%0A%09else%20if%28e%29%20%7B%0A%09%09doc%20%3D%20e.target%3B%0A%09%09if%28doc.location%20%21%3D%20ADDONS_URL%29%0A%09%09%09return%3B%0A%09%09browser.removeEventListener%28e.type%2C%20processAddonsTab%2C%20true%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09doc%20%3D%20browser.contentDocument%3B%0A%09%7D%0A%0A%09btn.tooltipText%20%3D%20%22Process%20%22%20+%20ADDONS_URL%20+%20%22%u2026%22%3B%0A%09progressIcon.loading%28%29%3B%0A%0A%09var%20origAttr%20%3D%20%22_cb_checkForAddonsUpdates_origImage%22%3B%0A%09if%28%21tab.hasAttribute%28origAttr%29%29%20%7B%0A%09%09var%20link%20%3D%20doc.querySelector%28%27link%5Brel%3D%22shortcut%20icon%22%5D%27%29%3B%20//%20Not%20loaded%20yet%3F%0A%09%09tab.setAttribute%28origAttr%2C%20link%20%26%26%20link.href%20%7C%7C%20tab.image%29%3B%0A%09%7D%0A%09tab.image%20%3D%20image%3B%0A%0A%09var%20fu%20%3D%20%24%28%22cmd_findAllUpdates%22%29%3B%0A%09if%28%21fu%29%20%7B%20//%20Firefox%2072+%0A%09%09var%20win%20%3D%20doc.defaultView%3B%0A%09%09var%20vb%20%3D%20doc.getElementById%28%22html-view-browser%22%29%3B%0A%09%09if%28%21vb%29%20%7B%0A%09%09%09if%28%21HTMLHtmlElement.isInstance%28doc.documentElement%29%29%20%7B%20//%20Firefox%2087+%0A%09%09%09%09win.setTimeout%28processAddonsTab%2C%2020%2C%20win%29%3B%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09vb%20%3D%20browser%3B%0A%09%09%7D%0A%09%09if%28%21again%29%20%7B%20//%20Strange%20errors%20happens%0A%09%09%09//%20chrome%3A//mozapps/content/extensions/aboutaddons.js%0A%09%09%09//%20getTelemetryViewName%28%29%20-%3E%20el.closest%28...%29%20is%20null%0A%09%09%09win.setTimeout%28processAddonsTab%2C%2020%2C%20win%2C%20true%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09var%20vbDoc%20%3D%20vb.contentDocument%3B%0A%09%09fu%20%3D%20vbDoc.querySelector%28%27%5Baction%3D%22check-for-updates%22%5D%27%29%3B%0A%09%09var%20um%20%3D%20vbDoc.getElementById%28%22updates-message%22%29%3B%0A%09%7D%0A%0A%09var%20notFound%20%3D%20%24%28%22updates-noneFound%22%29%20%7C%7C%20%7B%0A%09%09get%20hidden%28%29%20%7B%20return%20um.getAttribute%28%22state%22%29%20%21%3D%20%22none-found%22%3B%20%7D%0A%09%7D%3B%0A%09var%20updated%20%3D%20%24%28%22updates-installed%22%29%20%7C%7C%20%7B%0A%09%09get%20hidden%28%29%20%7B%20return%20um.getAttribute%28%22state%22%29%20%21%3D%20%22installed%22%3B%20%7D%0A%09%7D%3B%0A%09//%20Avoid%20getting%20false%20results%20from%20the%20past%20update%20check%20%28may%20not%20be%20required%20for%20%22noneFound%22%29%0A%09if%28um%29%20%7B%20//%20Firefox%2072+%0A%09%09um.hidden%20%3D%20true%3B%0A%09%09um.removeAttribute%28%22state%22%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09notFound.hidden%20%3D%20updated.hidden%20%3D%20true%3B%0A%09%7D%0A%0A%09//fu.doCommand%28%29%3B%0A%09fu.click%28%29%3B%0A%0A%09function%20localize%28node%2C%20key%2C%20callback%29%20%7B%0A%09%09if%28um%29%20%7B%20//%20Firefox%2072+%0A%09%09%09doc.l10n.formatValue%28key%29.then%28function%28s%29%20%7B%0A%09%09%09%09callback%28s%20%7C%7C%20key%29%3B%0A%09%09%09%7D%2C%20Components.utils.reportError%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09callback%28node.getAttribute%28%22value%22%29%20%7C%7C%20key%29%3B%0A%09%7D%0A%0A%09var%20inProgress%20%3D%20%24%28%22updates-progress%22%29%20%7C%7C%20%7B%0A%09%09get%20hidden%28%29%20%7B%20return%20um.getAttribute%28%22state%22%29%20%21%3D%20%22updating%22%3B%20%7D%0A%09%7D%3B%0A%09localize%28inProgress%2C%20%22addon-updates-updating%22%2C%20function%28s%29%20%7B%0A%09%09btn.tooltipText%20%3D%20s%3B%0A%09%7D%29%3B%0A%0A%09var%20waitTimer%20%3D%20setInterval%28function%28%29%20%7B%0A%09%09if%28%21doc.defaultView%20%7C%7C%20doc.defaultView.closed%29%20%7B%0A%09%09%09stopWait%28%29%3B%0A%09%09%09notify%28%22Tab%20with%20add-ons%20manager%20was%20closed%21%22%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09if%28%21inProgress.hidden%29%0A%09%09%09return%3B%0A%09%09var%20autoUpdate%20%3D%20%24%28%22utils-autoUpdateDefault%22%29%0A%09%09%09%7C%7C%20vbDoc.querySelector%28%27%5Baction%3D%22set-update-automatically%22%5D%27%29%3B%0A%09%09var%20autoUpdateChecked%20%3D%20autoUpdate.getAttribute%28%22checked%22%29%20%3D%3D%20%22true%22%0A%09%09%09%7C%7C%20autoUpdate.checked%3B%0A%0A%09%09var%20found%20%3D%20%24%28%22updates-manualUpdatesFound-btn%22%29%20%7C%7C%20%7B%0A%09%09%09get%20hidden%28%29%20%7B%20return%20um.getAttribute%28%22state%22%29%20%21%3D%20%22manual-updates-found%22%3B%20%7D%0A%09%09%7D%3B%0A%09%09if%28%0A%09%09%09autoUpdateChecked%0A%09%09%09%09%3F%20notFound.hidden%20%26%26%20updated.hidden%0A%09%09%09%09%3A%20notFound.hidden%20%26%26%20found.hidden%0A%09%09%29%20//%20Too%20early%3F%0A%09%09%09return%3B%0A%0A%09%09stopWait%28%29%3B%0A%09%09if%28%21tbTab%29%0A%09%09%09tab.closing%20%3D%20false%3B%0A%09%09function%20removeTab%28%29%20%7B%0A%09%09%09if%28%21tab.collapsed%29%0A%09%09%09%09return%3B%0A%09%09%09if%28tbTab%29%20%7B%0A%09%09%09%09tabmail.closeTab%28tbTabInfo%2C%20true%20/*aNoUndo*/%29%3B%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09gBrowser.removeTab%28tab%29%3B%0A%09%09%09%28function%20forgetClosedTab%28isSecondTry%29%20%7B%0A%09%09%09%09var%20ss%20%3D%20%22nsISessionStore%22%20in%20Components.interfaces%0A%09%09%09%09%09%3F%20%28%0A%09%09%09%09%09%09Components.classes%5B%[email protected]/browser/sessionstore%3B1%22%5D%0A%09%09%09%09%09%09%7C%7C%20Components.classes%5B%[email protected]/suite/sessionstore%3B1%22%5D%0A%09%09%09%09%09%29.getService%28Components.interfaces.nsISessionStore%29%0A%09%09%09%09%09%3A%20trgWindow.SessionStore%3B%20//%20Firefox%2061+%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1450559%0A%09%09%09%09if%28%21%28%22forgetClosedTab%22%20in%20ss%29%29%0A%09%09%09%09%09return%3B%0A%09%09%09%09var%20closedTabs%20%3D%20JSON.parse%28ss.getClosedTabData%28window%29%29%3B%0A%09%09%09%09for%28let%20i%20%3D%200%2C%20l%20%3D%20closedTabs.length%3B%20i%20%3C%20l%3B%20++i%29%20%7B%0A%09%09%09%09%09let%20closedTab%20%3D%20closedTabs%5Bi%5D%3B%0A%09%09%09%09%09let%20state%20%3D%20closedTab.state%3B%0A%09%09%09%09%09if%28state.entries%5Bstate.index%20-%201%5D.url%20%3D%3D%20ADDONS_URL%29%20%7B%0A%09%09%09%09%09%09ss.forgetClosedTab%28window%2C%20i%29%3B%0A%09%09%09%09%09%09return%3B%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09if%28%21isSecondTry%29%20//%20May%20be%20needed%20in%20SeaMonkey%0A%09%09%09%09%09setTimeout%28forgetClosedTab%2C%200%2C%20true%29%3B%0A%09%09%09%7D%29%28%29%3B%0A%09%09%7D%0A%0A%09%09if%28%21notFound.hidden%29%20%7B%0A%09%09%09removeTab%28%29%3B%0A%09%09%09localize%28notFound%2C%20%22addon-updates-none-found%22%2C%20function%28s%29%20%7B%0A%09%09%09%09notify%28s%29%3B%0A%09%09%09%7D%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09if%28autoUpdateChecked%29%20%7B%0A%09%09%09removeTab%28%29%3B%0A%09%09%09localize%28updated%2C%20%22addon-updates-installed%22%2C%20function%28s%29%20%7B%0A%09%09%09%09notify%28s%29%3B%0A%09%09%09%7D%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%0A%09%09tab.collapsed%20%3D%20false%3B%0A%0A%09%09var%20cats%20%3D%20%24%28%22categories%22%29%3B%0A%09%09var%20upds%20%3D%20%24%28%22category-availableUpdates%22%29%3B%0A%09%09if%28cats%20%26%26%20upds%29%20%7B%0A%09%09%09if%28vb%20%26%26%20cats.selectedItem%20%3D%3D%20upds%29%20//%20Only%20for%20Firefox%2072+%0A%09%09%09%09cats.selectedItem%20%3D%20%24%28%22category-extension%22%29%3B%20//%20Trick%20to%20force%20update%0A%09%09%09cats.selectedItem%20%3D%20upds%3B%0A%09%09%7D%0A%09%09else%20%7B%20//%20Firefox%2076+%20%3F%0A%09%09%09vbDoc.querySelector%28%27.category%5Bname%3D%22available-updates%22%5D%27%29.click%28%29%3B%0A%09%09%7D%0A%0A%09%09var%20tabWin%20%3D%20tab.ownerDocument.defaultView%3B%0A%09%09if%28tbTab%29%0A%09%09%09tabmail.switchToTab%28tbTabInfo%29%3B%0A%09%09else%0A%09%09%09tabWin.gBrowser.selectedTab%20%3D%20tab%3B%0A%09%09setTimeout%28function%28%29%20%7B%0A%09%09%09tabWin.focus%28%29%3B%0A%09%09%09doc.defaultView.focus%28%29%3B%0A%09%09%09var%20al%20%3D%20%24%28%22addon-list%22%29%20%7C%7C%20vb%3B%0A%09%09%09al.focus%28%29%3B%0A%09%09%7D%2C%200%29%3B%0A%09%7D%2C%2050%29%3B%0A%09function%20%24%28id%29%20%7B%0A%09%09return%20doc.getElementById%28id%29%3B%0A%09%7D%0A%09function%20stopWait%28%29%20%7B%0A%09%09clearInterval%28waitTimer%29%3B%0A%09%09progressIcon.restore%28%29%3B%0A%09%09btn.tooltipText%20%3D%20tip%3B%0A%09%09if%28tab.image%20%3D%3D%20image%29%0A%09%09%09tab.image%20%3D%20tab.getAttribute%28origAttr%29%3B%0A%09%09tab.removeAttribute%28origAttr%29%3B%0A%09%09trgWindow.removeEventListener%28%22TabSelect%22%2C%20dontSelectHiddenTab%2C%20false%29%3B%0A%09%09setTimeout%28function%28%29%20%7B%0A%09%09%09delete%20btn._cb_disabled%3B%0A%09%09%7D%2C%20500%29%3B%0A%09%7D%0A%09function%20notify%28msg%29%20%7B%0A%09%09Components.classes%5B%[email protected]/alerts-service%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIAlertsService%29%0A%09%09%09.showAlertNotification%28%0A%09%09%09%09app%20%3D%3D%20%22Firefox%22%20%26%26%20pv%20%3E%3D%2057%0A%09%09%09%09%09%3F%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric.svg%22%0A%09%09%09%09%09%3A%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric.png%22%2C%0A%09%09%09%09btn.label%2C%0A%09%09%09%09msg%2C%20false%2C%20%22%22%2C%20null%0A%09%09%09%29%3B%0A%09%7D%0A%7D%0Afunction%20dontSelectHiddenTab%28e%29%20%7B%0A%09//%20%3Ctab%20/%3E%3Ctab%20collapsed%3D%22true%22%20/%3E%0A%09//%20Close%20first%20tab%3A%20collapsed%20tab%20becomes%20selected%0A%09var%20trgTab%20%3D%20e.originalTarget%20%7C%7C%20e.target%3B%0A%09if%28trgTab%20%21%3D%20tab%29%0A%09%09return%3B%0A%0A%09if%28/%5Cn%28%3F%3ABrowserOpenAddonsMgr%7CtoEM%29@chrome%3A%5C/%5C//.test%28new%20Error%28%29.stack%29%29%20%7B%0A%09%09//%20User%20open%20Add-ons%20Manager%2C%20show%20tab%0A%09%09trgWindow.removeEventListener%28%22TabSelect%22%2C%20dontSelectHiddenTab%2C%20false%29%3B%0A%09%09setTimeout%28function%28%29%20%7B%20//%20Hidden%20tab%20can%27t%20be%20selected%2C%20so%20select%20it%20manually...%0A%09%09%09tab.collapsed%20%3D%20tab.closing%20%3D%20false%3B%0A%09%09%09gBrowser.selectedTab%20%3D%20tab%3B%0A%09%09%7D%2C%200%29%3B%0A%09%7D%0A%0A%09function%20done%28t%29%20%7B%0A%09%09if%28%21t.hidden%20%26%26%20%21t.closing%29%20%7B%0A%09%09%09e.preventDefault%28%29%3B%0A%09%09%09e.stopPropagation%28%29%3B%0A%09%09%09return%20gBrowser.selectedTab%20%3D%20t%3B%0A%09%09%7D%0A%09%09return%20false%3B%0A%09%7D%0A%09for%28var%20t%20%3D%20tab.nextSibling%3B%20t%3B%20t%20%3D%20t.nextSibling%29%0A%09%09if%28done%28t%29%29%0A%09%09%09return%3B%0A%09for%28var%20t%20%3D%20tab.previousSibling%3B%20t%3B%20t%20%3D%20t.previousSibling%29%0A%09%09if%28done%28t%29%29%0A%09%09%09return%3B%0A%7D%0Afunction%20ProgressIcon%28btn%29%20%7B%0A%09var%20app%20%3D%20Services.appinfo.name%3B%0A%09var%20pv%20%3D%20parseFloat%28Services.appinfo.platformVersion%29%3B%0A%09if%28app%20%3D%3D%20%22SeaMonkey%22%29%0A%09%09this.imgConnecting%20%3D%20this.imgLoading%20%3D%20%22chrome%3A//communicator/skin/icons/loading.gif%22%3B%0A%09else%20if%28app%20%3D%3D%20%22Thunderbird%22%29%20%7B%0A%09%09this.imgConnecting%20%3D%20%22chrome%3A//messenger/skin/icons/connecting.png%22%3B%0A%09%09this.imgLoading%20%3D%20%22chrome%3A//messenger/skin/icons/loading.png%22%3B%0A%09%7D%0A%09else%20%7B%0A%09%09this.imgConnecting%20%3D%20app%20%3D%3D%20%22Firefox%22%20%26%26%20pv%20%3E%3D%2058%0A%09%09%09%3F%20%22chrome%3A//browser/skin/tabbrowser/tab-connecting.png%22%0A%09%09%09%3A%20%22chrome%3A//browser/skin/tabbrowser/connecting.png%22%3B%0A%09%09this.imgLoading%20%3D%20app%20%3D%3D%20%22Firefox%22%20%26%26%20pv%20%3E%3D%2048%0A%09%09%09%3F%20%22chrome%3A//global/skin/icons/loading.png%22%0A%09%09%09%3A%20%22chrome%3A//browser/skin/tabbrowser/loading.png%22%3B%0A%09%7D%0A%09if%28%21%28btn%20instanceof%20XULElement%29%29%20%7B%0A%09%09this.loading%20%3D%20this.restore%20%3D%20function%28%29%20%7B%7D%3B%0A%09%09return%3B%0A%09%7D%0A%09var%20useAnimation%20%3D%20app%20%3D%3D%20%22Firefox%22%20%26%26%20pv%20%3E%3D%2032%20%26%26%20pv%20%3C%2048%3B%0A%09var%20btnIcon%20%3D%20btn.icon%0A%09%09%7C%7C%20btn.ownerDocument.getAnonymousElementByAttribute%28btn%2C%20%22class%22%2C%20%22toolbarbutton-icon%22%29%3B%0A%09var%20origIcon%20%3D%20btnIcon.src%3B%0A%09btnIcon.src%20%3D%20this.imgConnecting%3B%0A%09if%28useAnimation%29%20%7B%0A%09%09let%20cs%20%3D%20btnIcon.ownerDocument.defaultView.getComputedStyle%28btnIcon%2C%20null%29%3B%0A%09%09let%20s%20%3D%20btnIcon.style%3B%0A%09%09s.margin%20%3D%20%5Bcs.marginTop%2C%20cs.marginRight%2C%20cs.marginBottom%2C%20cs.marginLeft%5D.join%28%22%20%22%29%3B%0A%09%09s.padding%20%3D%20%5Bcs.paddingTop%2C%20cs.paddingRight%2C%20cs.paddingBottom%2C%20cs.paddingLeft%5D.join%28%22%20%22%29%3B%0A%09%09s.width%20%3D%20cs.width%3B%0A%09%09s.height%20%3D%20cs.height%3B%0A%09%09s.boxShadow%20%3D%20%22none%22%3B%0A%09%09s.borderColor%20%3D%20s.background%20%3D%20%22transparent%22%3B%0A%09%09btnIcon.setAttribute%28%22fadein%22%2C%20%22true%22%29%3B%0A%09%09btnIcon.setAttribute%28%22busy%22%2C%20%22true%22%29%3B%0A%09%09btnIcon.classList.add%28%22tab-throbber%22%29%3B%0A%09%09btnIcon._restore%20%3D%20function%28%29%20%7B%0A%09%09%09delete%20btnIcon._restore%3B%0A%09%09%09btnIcon.removeAttribute%28%22busy%22%29%3B%0A%09%09%09btnIcon.removeAttribute%28%22progress%22%29%3B%0A%09%09%09setTimeout%28function%28%29%20%7B%0A%09%09%09%09btnIcon.classList.remove%28%22tab-throbber%22%29%3B%0A%09%09%09%09btnIcon.removeAttribute%28%22style%22%29%3B%0A%09%09%09%09btnIcon.removeAttribute%28%22fadein%22%29%3B%0A%09%09%09%7D%2C%200%29%3B%0A%09%09%7D%3B%0A%09%7D%0A%09this.loading%20%3D%20function%28%29%20%7B%0A%09%09btnIcon.src%20%3D%20this.imgLoading%3B%0A%09%09if%28useAnimation%29%0A%09%09%09btnIcon.setAttribute%28%22progress%22%2C%20%22true%22%29%3B%0A%09%7D%3B%0A%09this.restore%20%3D%20function%28%29%20%7B%0A%09%09btnIcon.src%20%3D%20origIcon%3B%0A%09%09if%28useAnimation%29%0A%09%09%09btnIcon._restore%28%29%3B%0A%09%7D%3B%0A%7D%0A%7D%29.call%28this%29%3B%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E"
>Install</a>
| <a href="https://github.com/Infocatcher/Custom_Buttons/tree/master/Check_for_Addons_Updates">Source</a>
| <a href="https://github.com/Infocatcher/Custom_Buttons#usage">Instructions</a>
<script type="text/javascript">
var a = document.getElementsByTagName("a")[0];
a.title = document.title;
if(/%3Cimage%3E%3C%21%5BCDATA%5B(data%3A\S+)%5D%5D%3E%3C\/image%3E/.test(a.href)) {
var icon = decodeURIComponent(RegExp.$1);
var img = document.createElement("img");
img.src = icon;
img.alt = "";
img.style.verticalAlign = "middle";
img.style.marginRight = "4px";
img.style.border = "none";
a.insertBefore(img, a.firstChild);
var link = document.createElement("link");
link.rel = "shortcut icon";
link.href = icon;
document.documentElement.insertBefore(link, document.documentElement.firstChild);
}
</script>
<script type="text/javascript" src="https://infocatcher.github.io/Custom_Buttons/viewCustomButton.js"></script>
<script type="text/javascript">
if("viewCustomButtonCode" in window) setTimeout(function() {
viewCustomButtonCode(a.href);
}, 0);
</script>
</body>