Полезная информация

Mozilla Россия — свежие версии программ Mozilla, а также масса полезной информации по каждому продукту.

№7627-09-2019 19:33:30

Andrey_Krropotkin
Участник
 
Группа: Members
Зарегистрирован: 11-11-2011
Сообщений: 421
UA: unknown 0.0

Re: [CB]Toggle Restartless Add-ons

kokoss а в чем проблема? Он и так работает в 69 без отключения многопроцессорного режима.

Отсутствует

 

№7727-09-2019 20:01:12

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 784
UA: Firefox 52.0

Re: [CB]Toggle Restartless Add-ons

Andrey_Krropotkin
У меня в [firefox] 69 не работает(не активна), кнопку взял от сюда: https://forum.mozilla-russia.org/viewto … 78#p600078 ?

Отсутствует

 

№7827-09-2019 20:50:40

Andrey_Krropotkin
Участник
 
Группа: Members
Зарегистрирован: 11-11-2011
Сообщений: 421
UA: Firefox 69.0

Re: [CB]Toggle Restartless Add-ons

kokoss брал у Infocatcher здесь
У меня так:
секция /*Initialization Code*/

скрытый текст

Выделить код

Код:

// http://infocatcher.ucoz.net/js/cb/toggleRestartlessAddons.js
    // https://forum.mozilla-russia.org/viewtopic.php?id=57948
    // https://github.com/Infocatcher/Custom_Buttons/tree/master/Toggle_Restartless_Add-ons
    
    // Toggle Restartless Add-ons button for Custom Buttons
    // (code for "initialization" section)
    // Also the code can be used from main window context (as Mouse Gestures code, for example)
    
    // Also you can check for add-ons updates using right-click:
    // copy all code from
    // https://github.com/Infocatcher/Custom_Buttons/blob/master/Check_for_Addons_Updates/checkForAddonsUpdates.js
    // after "//== Check for Addons Updates begin"
    
    // See "var style = " to modify styles for specific add-ons
    
    // (c) Infocatcher 2013-2017
    // version 0.1.3pre3 - 2017-10-23
      
    var options = {
        addonTypes: ["extension"],
        // Possible values: "extension", "plugin"
        // From extensions: "userstyle" (Stylish), "greasemonkey-user-script" (Greasemonkey), "userscript" (Scriptish)
        // (swap to reorder in the menu)
        showVersions: 1,
        // 0 - don't show versions
        // 1 - show after name: "Addon Name 1.2"
        // 2 - show as "acceltext" (in place for hotkey text)
        showHidden: 0,
        // 0  - don't show hidden add-ons
        // -1 - show only enabled hidden add-ons (e.g. to track new items)
        // 1  - show all hidden add-ons
        sort: {
            enabled:     0,
            clickToPlay: 0,
            disabled:    0
            // Sort order:
            // 0, 0, 0 - sort add-ons of each type alphabetically
            // 0, 0, 1 - show enabled add-ons (of each type) first
            // 0, 1, 2 - enabled add-ons, then click-to-play and then disabled
        },
        closeMenu: false, // Close menu after left-click
        closeMenuClickToPlay: false // Close menu after left-click, for click to play plugins
        // Use Shift+click to invert closeMenu* behavior
    };
    
    var mp = document.createXULElement("menupopup");
    mp.setAttribute("onpopupshowing", "this.updateMenu();");
    mp.setAttribute("oncommand", "this.handleEvent(event);");
    mp.setAttribute("onmousedown", "if(event.button == 0) this.handleEvent(event);");
    mp.setAttribute("onclick", "if(event.button > 0) this.handleEvent(event);");
    mp.setAttribute("oncontextmenu", "return false;");
    mp.setAttribute("onpopuphidden", "this.destroyMenu();");
    
    var tb = this.parentNode;
    if(tb && tb.getAttribute("orient") == "vertical") {
        // https://addons.mozilla.org/firefox/addon/vertical-toolbar/
        var isRight = tb.parentNode.getAttribute("placement") == "right";
        mp.setAttribute("position", isRight ? "start_before" : "end_before");
    }
    
    var cleanupTimer = 0;
    mp.updateMenu = function() {
        clearTimeout(cleanupTimer);
        addStyle();
        getRestartlessAddons(options.addonTypes, function(addons) {
            var df = document.createDocumentFragment();
            var prevType;
            function sortPosition(addon) {
                if("STATE_ASK_TO_ACTIVATE" in AddonManager && addon.userDisabled == AddonManager.STATE_ASK_TO_ACTIVATE)
                    return options.sort.clickToPlay;
                if(addon.isActive)
                    return options.sort.enabled;
                return options.sort.disabled;
            }
            function key(addon) {
                return options.addonTypes.indexOf(addon.type)
                    + "\n" + sortPosition(addon)
                    + "\n" + addon.name.toLowerCase();
            }
            addons.sort(function(a, b) {
                var ka = key(a);
                var kb = key(b);
                return ka == kb ? 0 : ka < kb ? -1 : 1;
            }).forEach(function(addon) {
                var type = addon.type;
                if(prevType && type != prevType)
                    df.appendChild(document.createXULElement("menuseparator"));
                prevType = type;
                var icon = addon.iconURL || addon.icon64URL;
                var mi = document.createXULElement("menuitem");
                mi.className = "menuitem-iconic";
                var label = addon.name;
                if(options.showVersions == 1)
                    label += " " + addon.version;
                else if(options.showVersions == 2)
                    mi.setAttribute("acceltext", addon.version);
                mi.setAttribute("label", label);
                mi.setAttribute("image", icon || mp.icons[type] || "");
                if(!icon && mp.icons.useSVG)
                    mi.style.fill = "#15c";
                var tip = addon.description || "";
                var delay = "delayedStartupAddons" in Services
                    && Services.delayedStartupAddons[addon.id] || null;
                var isDelayed = delay !== null;
                mi.classList.toggle("toggleRestartlessAddons-isDelayed", isDelayed);
                if(isDelayed)
                    tip = "[Delayed Startup: " + delay.toLocaleString() + "]" + (tip ? "\n" + tip : "");
                tip && mi.setAttribute("tooltiptext", tip);
                mi.classList.toggle("toggleRestartlessAddons-isHidden", addon.hidden || false);
                setDisabled(mi, addon.userDisabled);
                mi._cbAddon = addon;
                df.appendChild(mi);
            });
            mp.textContent = "";
            mp.appendChild(df);
        });
    };
    mp.handleEvent = function(e) {
        var mi = e.target;
        if(!("_cbAddon" in mi))
            return;
        var addon = mi._cbAddon;
        if(e.type == "mousedown") {
            var closeMenu = isAskToActivateAddon(addon)
                ? options.closeMenuClickToPlay
                : options.closeMenu;
            if(e.shiftKey)
                closeMenu = !closeMenu;
            mi.setAttribute("closemenu", closeMenu ? "auto" : "none");
            return;
        }
        var hasMdf = hasModifier(e);
        if(e.type == "command" && (!hasMdf || e.shiftKey)) {
            let newDis = setNewDisabled(addon);
            setDisabled(mi, newDis);
        }
        else if(e.type == "command" && hasMdf || e.type == "click" && e.button == 1) {
            openAddonPage(addon);
            closeMenus(mi);
        }
        else if(e.type == "click" && e.button == 2) {
            if(openAddonOptions(addon))
                closeMenus(mi);
        }
    };
    mp.destroyMenu = function() {
        removeStyle();
        clearTimeout(cleanupTimer);
        cleanupTimer = setTimeout(function() {
            mp.textContent = "";
        }, 5000);
    };
    mp.icons = {
        get useSVG() {
            delete this.useSVG;
            return this.useSVG = Services.appinfo.name == "Firefox"
                && parseFloat(Services.appinfo.version) >= 57;
        },
        get plugin() {
            delete this.plugin;
            return this.plugin = this.useSVG
                ? "chrome://mozapps/skin/plugins/pluginGeneric.svg"
                : "chrome://mozapps/skin/plugins/pluginGeneric-16.png";
        },
        get extension() {
            delete this.extension;
            return this.extension = this.useSVG
                ? "chrome://mozapps/skin/extensions/extensionGeneric-16.svg"
                : "chrome://mozapps/skin/extensions/extensionGeneric-16.png";
        }
    };
    function isAskToActivateAddon(addon) {
        return addon.type == "plugin"
            && "STATE_ASK_TO_ACTIVATE" in AddonManager
            && Services.prefs.getBoolPref("plugins.click_to_play");
    }
    function setNewDisabled(addon) {
        var newDis = getNewDisabled(addon);
        var oldDis = addon.userDisabled;
        try {
            addon.userDisabled = newDis;
        }
        catch(e) { // Error: Cannot disable hidden add-on firefox@getpocket.com
            _log("Can't set addon.userDisabled to " + newDis + ", error:\n" + e);
            if(addon.hidden)
                setNewDisabledRaw(addon, newDis);
        }
        var realDis = addon.userDisabled;
        if(realDis != newDis && addon.type == "extension") { // Firefox 62+? Weird things happens
            setNewDisabledRaw(addon, newDis);
            realDis = addon.userDisabled;
        }
        if(realDis != newDis) { // We can't enable vulnerable plugins
            let err = "Can't set addon.userDisabled to " + newDis + ", real value: " + realDis;
            if(newDis) {
                _log(err + "\nSTATE_ASK_TO_ACTIVATE not supported?");
                newDis = false;
            }
            else {
                _log(err + "\nVulnerable plugin?");
                if(oldDis == AddonManager.STATE_ASK_TO_ACTIVATE)
                    newDis = true;
                else
                    newDis = AddonManager.STATE_ASK_TO_ACTIVATE;
            }
            addon.userDisabled = newDis;
        }
        return addon.userDisabled;
    }
    function getNewDisabled(addon) {
        // disabled -> STATE_ASK_TO_ACTIVATE -> enabled -> ...
        var curDis = addon.userDisabled;
        var newDis;
        if("STATE_ASK_TO_ACTIVATE" in AddonManager && curDis == AddonManager.STATE_ASK_TO_ACTIVATE)
            newDis = false;
        else if(!curDis)
            newDis = true;
        else {
            if(isAskToActivateAddon(addon))
                newDis = AddonManager.STATE_ASK_TO_ACTIVATE;
            else
                newDis = false;
        }
        return newDis;
    }
    function setNewDisabledRaw(addon, newDis) {
        _log("Let's try set addon.userDisabled using raw hack");
        let g = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {});
        if("XPIDatabase" in g && "updateAddonDisabledState" in g.XPIDatabase) { // Firefox 61+
            let rawAddon = g.XPIDatabase.getAddons().find(function(rawAddon) {
                return rawAddon.id == addon.id;
            });
            g.XPIDatabase.updateAddonDisabledState(rawAddon, newDis);
        }
        else if("eval" in g) { // See "set userDisabled(val)"
            let addonFor = g.eval("addonFor");
            let rawAddon = addonFor(addon);
            //rawAddon.userDisabled = newDis;
            g.XPIProvider.updateAddonDisabledState(rawAddon, newDis);
        }
        else { // Firefox 57+? See https://forum.mozilla-russia.org/viewtopic.php?pid=745272#p745272
            updateAddonDisabledState(addon, newDis);
        }
    }
    function updateAddonDisabledState(addon, newDis) {
        var nsvo = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {});
        var key = "_cbToggleRestartlessAddonsData";
        var url = URL.createObjectURL(new Blob([
            "XPIProvider.updateAddonDisabledState(addonFor(this." + key + "[0]), this." + key + "[1]); delete this." + key + ";"
        ]));
        addDestructor(function() {
            URL.revokeObjectURL(url);
        });
        (updateAddonDisabledState = function(addon, newDis) {
            nsvo[key] = [addon, newDis];
            Services.scriptloader.loadSubScript(url, nsvo);
        })(addon, newDis);
    }
    function setDisabled(mi, disabled) {
        var askToActivate = "STATE_ASK_TO_ACTIVATE" in AddonManager && disabled == AddonManager.STATE_ASK_TO_ACTIVATE;
        var cl = mi.classList;
        cl.toggle("toggleRestartlessAddons-askToActivate", askToActivate);
        cl.toggle("toggleRestartlessAddons-disabled", disabled && !askToActivate);
    }
    
    if(
        this instanceof XULElement // Custom Buttons
        && typeof event == "object"
        && !("type" in event) && typeof _phase == "string" && _phase == "init" // Initialization
    ) {
        this.type = "menu";
        this.orient = "horizontal";
        this.appendChild(mp);
    
        this.onmouseover = function(e) {
            if(e.target != this)
                return;
            Array.prototype.some.call(
                this.parentNode.getElementsByTagName("*"),
                function(node) {
                    if(
                        node != this
                        && node.namespaceURI == xulns
                        && node.boxObject
                        // See https://github.com/Infocatcher/Custom_Buttons/issues/28
                        //&& node.boxObject instanceof Components.interfaces.nsIMenuBoxObject
                        && "open" in node
                        && node.open
                        && node.getElementsByTagName("menupopup").length
                    ) {
                        node.open = false;
                        this.open = true;
                        return true;
                    }
                    return false;
                },
                this
            );
        };
        this.onmousedown = function(e) {
            if(e.target == this && e.button == 0 && hasModifier(e))
                e.preventDefault();
        };
        this.oncontextmenu = function(e) {
            if(e.target == this && !hasModifier(e) && hasUpdater())
                e.preventDefault();
        };
        this.onclick = function(e) {
            if(e.target != this)
                return;
            if(e.button == 0 && hasModifier(e) || e.button == 1)
                openAddonsManager();
            else if(e.button == 2 && !hasModifier(e) && hasUpdater())
                checkForAddonsUpdates.call(this);
        };
    }
    else { // Mouse gestures or something other...
        let e;
        if(typeof event == "object" && event instanceof Event && "screenX" in event) // FireGestures
            e = event;
        else if(
            this instanceof Components.interfaces.nsIDOMChromeWindow
            && "mgGestureState" in window && "endEvent" in mgGestureState // Mouse Gestures Redox
        )
            e = mgGestureState.endEvent;
        else {
            let anchor = this instanceof XULElement && this
                || window.gBrowser && gBrowser.selectedBrowser
                || document.documentElement;
            if("boxObject" in anchor) {
                let bo = anchor.boxObject;
                e = {
                    screenX: bo.screenX,
                    screenY: bo.screenY
                };
                if(this instanceof XULElement)
                    e.screenY += bo.height;
            }
        }
        if(!e || !("screenX" in e))
            throw new Error("[Toggle Restartless Add-ons]: Can't get event object");
        document.documentElement.appendChild(mp);
        mp.addEventListener("popuphidden", function destroy(e) {
            mp.removeEventListener(e.type, destroy, false);
            setTimeout(function() {
                mp.destroyMenu();
                mp.parentNode.removeChild(mp);
            }, 0);
        }, false);
        mp.openPopupAtScreen(e.screenX, e.screenY);
    }
    
    function getRestartlessAddons(addonTypes, callback, context) {
        if(!("AddonManager" in window))
            Components.utils.import("resource://gre/modules/AddonManager.jsm");
        if(!("Services" in window))
            Components.utils.import("resource://gre/modules/Services.jsm");
        var then, promise = AddonManager.getAddonsByTypes(addonTypes, then = function(addons) {
            var restartless = addons.filter(function(addon) {
                var ops = addon.operationsRequiringRestart;
                return !addon.appDisabled
                    && !(ops & AddonManager.OP_NEEDS_RESTART_ENABLE || ops & AddonManager.OP_NEEDS_RESTART_DISABLE)
                    && (
                        !addon.hidden
                        || options.showHidden > 0
                        || options.showHidden == -1 && !addon.userDisabled
                    );
            });
            callback.call(context, restartless);
        });
        promise && typeof promise.then == "function" && promise.then(then, Components.utils.reportError); // Firefox 61+
    }
    function openAddonOptions(addon) {
        // Based on code from chrome://mozapps/content/extensions/extensions.js
        // Firefox 21.0a1 (2013-01-27)
        var optionsURL = addon.optionsURL;
        if(!addon.isActive || !optionsURL)
            return false;
        if(addon.type == "plugin") // No options for now!
            return false;
        if(
            addon.optionsType == AddonManager.OPTIONS_TYPE_INLINE
            || addon.optionsType == (AddonManager.OPTIONS_TYPE_INLINE_INFO || NaN)
            || addon.optionsType == (AddonManager.OPTIONS_TYPE_INLINE_BROWSER || NaN)
        )
            openAddonPage(addon, true);
        else if(addon.optionsType == AddonManager.OPTIONS_TYPE_TAB && "switchToTabHavingURI" in window)
            switchToTabHavingURI(optionsURL, true);
        else {
            let windows = Services.wm.getEnumerator(null);
            while(windows.hasMoreElements()) {
                let win = windows.getNext();
                if(win.document.documentURI == optionsURL) {
                    win.focus();
                    return true;
                }
            }
            // Note: original code checks browser.preferences.instantApply and may open modal windows
            window.openDialog(optionsURL, "", "chrome,titlebar,toolbar,centerscreen,dialog=no");
        }
        return true;
    }
    function openAddonsManager(view) {
        var openAddonsMgr = window.BrowserOpenAddonsMgr // Firefox
            || window.openAddonsMgr // Thunderbird
            || window.toEM; // SeaMonkey
        openAddonsMgr(view);
    }
    function openAddonPage(addon, scrollToPreferences) {
        var platformVersion = parseFloat(
            Services.appinfo.name == "Pale Moon"
                ? Services.appinfo.version
                : Services.appinfo.platformVersion
        );
        scrollToPreferences = scrollToPreferences && platformVersion >= 12
            ? "/preferences"
            : "";
        openAddonsManager("addons://detail/" + encodeURIComponent(addon.id) + scrollToPreferences);
    }
    
    function hasModifier(e) {
        return e.ctrlKey || e.shiftKey || e.altKey || e.metaKey;
    }
    
    function addStyle() {
        if(addStyle.hasOwnProperty("_style"))
            return;
        var style = '\
            .toggleRestartlessAddons-isDelayed > .menu-iconic-text {\n\
                opacity: 0.75;\n\
                color: #070;\n\
            }\n\
            .toggleRestartlessAddons-isHidden > .menu-iconic-text {\n\
                color: #609;\n\
            }\n\
            .toggleRestartlessAddons-disabled > .menu-iconic-left {\n\
                opacity: 0.4;\n\
            }\n\
            .toggleRestartlessAddons-disabled > .menu-iconic-text,\n\
            .toggleRestartlessAddons-disabled > .menu-accel-container {\n\
                opacity: 0.5;\n\
            }\n\
            .toggleRestartlessAddons-askToActivate {\n\
                color: -moz-nativehyperlinktext;\n\
            }';
        addStyle._style = document.insertBefore(
            document.createProcessingInstruction(
                "xml-stylesheet",
                'href="' + "data:text/css,"
                    + encodeURIComponent(style) + '" type="text/css"'
            ),
            document.documentElement
        );
    }
    function removeStyle() {
        if(!addStyle.hasOwnProperty("_style"))
            return;
        var s = addStyle._style;
        s.parentNode.removeChild(s);
        delete addStyle._style;
    }
    function closeMenus(node) {
        // Based on function closeMenus from chrome://browser/content/utilityOverlay.js
        for(; node && "tagName" in node; node = node.parentNode) {
            if(
                node.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
                && (node.localName == "menupopup" || node.localName == "popup")
            )
                node.hidePopup();
        }
    }
    function _log(s) {
        if(typeof LOG == "function") // Custom Buttons
            LOG(s);
        else // Or something else
            Services.console.logStringMessage("Toggle Restartless Add-ons: " + s);
    }
    
    function hasUpdater() {
        var has = checkForAddonsUpdates.toString().indexOf("about:addons") != -1;
        hasUpdater = function() {
            return has;
        };
        return has;
    }
    
    
    
    
    
    
    
    
    
    function checkForAddonsUpdates() {
// http://infocatcher.ucoz.net/js/cb/checkForAddonsUpdates.js
// https://forum.mozilla-russia.org/viewtopic.php?id=57958
// https://github.com/Infocatcher/Custom_Buttons/tree/master/Check_for_Addons_Updates

// Check for Addons Updates button for Custom Buttons
// (code for "code" section)

// (c) Infocatcher 2012-2014
// version 0.1.5 - 2014-10-13

// Button just open hidden tab with about:addons and trigger built-in "Check for Updates" function.
// And show tab, if found updates.

(function() {
var btn = this instanceof XULElement
    ? this
    : { // Launched not from custom button
        image: "", // Base64-encoded icon (if empty, will be used "imgLoading")
        label: "Check for Addons Updates",
        tooltipText: ""
    };
if("_cb_disabled" in btn)
    return;
btn._cb_disabled = true;

if(!("Services" in window))
    Components.utils.import("resource://gre/modules/Services.jsm");
var app = Services.appinfo.name;

var ADDONS_URL = "about:addons";

var progressIcon = new ProgressIcon(btn);
var image = btn.image || progressIcon.imgLoading;
var tip = btn.tooltipText;
btn.tooltipText = "Open " + ADDONS_URL + "…";

var tab, browser, gBrowser;
var tbTabInfo, tbTab;

var trgWindow = Services.wm.getMostRecentWindow("navigator:browser")
    || app == "Thunderbird" && Services.wm.getMostRecentWindow("mail:3pane")
    || window;
var trgDocument = trgWindow.document;
var tabmail = trgDocument.getElementById("tabmail");

if(tabmail && app == "Thunderbird") { // Note: SeaMonkey doesn't support content tabs in mail window
    let addonsWin;
    let receivePong = function(subject, topic, data) {
        addonsWin = subject;
    };
    Services.obs.addObserver(receivePong, "EM-pong", false);
    Services.obs.notifyObservers(null, "EM-ping", "");
    Services.obs.removeObserver(receivePong, "EM-pong");
    if(addonsWin) {
        let rootWindow = addonsWin
            .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
            .getInterface(Components.interfaces.nsIWebNavigation)
            .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
            .rootTreeItem
            .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
            .getInterface(Components.interfaces.nsIDOMWindow);
        tabmail = rootWindow.document.getElementById("tabmail");
        tbTabInfo = tabmail.getBrowserForDocument(addonsWin);
        tbTab = tab = tbTabInfo.tabNode;
        processAddonsTab(addonsWin);
    }
    else {
        Services.obs.addObserver(function observer(subject, topic, data) {
            Services.obs.removeObserver(observer, topic);
            if(subject.document.readyState == "complete")
                processAddonsTab(subject);
            else {
                subject.addEventListener("load", function onLoad(e) {
                    subject.removeEventListener(e.type, onLoad, false);
                    processAddonsTab(subject);
                }, false);
            }
        }, "EM-loaded", false);
        // See openAddonsMgr() -> openContentTab()
        tbTabInfo = tabmail.openTab("contentTab", {
            contentPage: ADDONS_URL,
            clickHandler: "specialTabs.siteClickHandler(event, /addons\.mozilla\.org/);",
            background: true
        });
        tbTab = tab = tbTabInfo.tabNode;
        tbTab.collapsed = true;
        // Note: dontSelectHiddenTab() not implemented
    }
}
else if("gBrowser" in trgWindow && trgWindow.gBrowser.tabs) {
    let isPending = false;
    let ws = Services.wm.getEnumerator("navigator:browser");
    windowsLoop:
    while(ws.hasMoreElements()) {
        let w = ws.getNext();
        let tabs = w.gBrowser.tabs;
        for(let i = 0, l = tabs.length; i < l; ++i) {
            let t = tabs[i];
            if(
                !t.closing
                && t.linkedBrowser
                && t.linkedBrowser.currentURI.spec == ADDONS_URL
            ) {
                tab = t;
                break windowsLoop;
            }
        }
    }

    gBrowser = trgWindow.gBrowser;
    if(!tab) {
        tab = gBrowser.addTab(ADDONS_URL, {
            triggeringPrincipal: "Services" in window // Firefox 63+
                && Services.scriptSecurityManager
                && Services.scriptSecurityManager.getSystemPrincipal()
        });
        tab.collapsed = true;
        tab.closing = true; // See "visibleTabs" getter in chrome://browser/content/tabbrowser.xml
        trgWindow.addEventListener("TabSelect", dontSelectHiddenTab, false);
    }
    else if(
        tab.getAttribute("pending") == "true" // Gecko >= 9.0
        || tab.linkedBrowser.contentDocument.readyState == "uninitialized"
        // || tab.linkedBrowser.__SS_restoreState == 1
    )
        isPending = true;

    browser = tab.linkedBrowser;
    if(isPending || browser.webProgress.isLoadingDocument) {
        browser.addEventListener("load", processAddonsTab, true);
        if(isPending) {
            if(parseFloat(Services.appinfo.platformVersion) >= 41) {
                // Workaround to correctly restore pending tab
                // See https://github.com/Infocatcher/Custom_Buttons/issues/39
                let selTab = gBrowser.selectedTab;
                gBrowser.selectedTab = tab;
                gBrowser.selectedTab = selTab;
            }
            else {
                browser.reload();
            }
        }
    }
    else {
        processAddonsTab();
    }
}
else {
    progressIcon.restore();
    btn.tooltipText = tip;
    delete btn._cb_disabled;
    Services.prompt.alert(window, btn.label, "Error: Can't find supported window!");
    return;
}

function processAddonsTab(e) {
    var doc;
    if(e && e instanceof Components.interfaces.nsIDOMWindow) {
        doc = e.document;
    }
    else if(e) {
        doc = e.target;
        if(doc.location != ADDONS_URL)
            return;
        browser.removeEventListener(e.type, processAddonsTab, true);
    }
    else {
        doc = browser.contentDocument;
    }

    progressIcon.loading();
    var inProgress = $("updates-progress");
    btn.tooltipText = inProgress.getAttribute("value");

    var origIcon = tab.image;
    tab.image = image;

    var updEnabledPref = "extensions.update.enabled";
    var updEnabled = Services.prefs.getBoolPref(updEnabledPref);
    if(!updEnabled)
        Services.prefs.setBoolPref(updEnabledPref, true);

    var notFound = $("updates-noneFound");
    var updated = $("updates-installed");
    // Avoid getting false results from the past update check (may not be required for "noneFound")
    notFound.hidden = updated.hidden = true;

    $("cmd_findAllUpdates").doCommand();

    var waitTimer = setInterval(function() {
        if(!doc.defaultView || doc.defaultView.closed) {
            stopWait();
            notify("Tab with add-ons manager was closed!");
            return;
        }
        if(!inProgress.hidden)
             return;
        var autoUpdate = $("utils-autoUpdateDefault");
        var autoUpdateChecked = autoUpdate.getAttribute("checked") == "true";

        var found = $("updates-manualUpdatesFound-btn");
        if(
            autoUpdateChecked
                ? notFound.hidden && updated.hidden
                : notFound.hidden && found.hidden
        ) // Too early?
            return;

        stopWait();
        if(!tbTab)
            tab.closing = false;
        function removeTab() {
            if(!tab.collapsed)
                return;
            if(tbTab)
                tabmail.closeTab(tbTabInfo, true /*aNoUndo*/);
            else {
                gBrowser.removeTab(tab);
                (function forgetClosedTab(isSecondTry) {
                    var ss = "nsISessionStore" in Components.interfaces
                        ? (
                            Components.classes["@mozilla.org/browser/sessionstore;1"]
                            || Components.classes["@mozilla.org/suite/sessionstore;1"]
                        ).getService(Components.interfaces.nsISessionStore)
                        : SessionStore; // Firefox 61+ https://bugzilla.mozilla.org/show_bug.cgi?id=1450559
                    if(!("forgetClosedTab" in ss))
                        return;
                    var closedTabs = JSON.parse(ss.getClosedTabData(window));
                    for(let i = 0, l = closedTabs.length; i < l; ++i) {
                        let closedTab = closedTabs[i];
                        let state = closedTab.state;
                        if(state.entries[state.index - 1].url == ADDONS_URL) {
                            ss.forgetClosedTab(window, i);
                            return;
                        }
                    }
                    if(!isSecondTry) // May be needed in SeaMonkey
                        setTimeout(forgetClosedTab, 0, true);
                })();
            }
        }

        if(!updEnabled)
            Services.prefs.setBoolPref(updEnabledPref, false);

        if(!notFound.hidden) {
            removeTab();
            notify(notFound.getAttribute("value"));
            return;
        }
        if(autoUpdateChecked) {
            removeTab();
            notify(updated.getAttribute("value"));
            return;
        }

        tab.collapsed = false;
        $("categories").selectedItem = $("category-availableUpdates");
        var tabWin = tab.ownerDocument.defaultView;
        if(tbTab)
            tabmail.switchToTab(tbTabInfo);
        else
            tabWin.gBrowser.selectedTab = tab;
        setTimeout(function() {
            tabWin.focus();
            doc.defaultView.focus();
            $("addon-list").focus();
        }, 0);
    }, 50);
    function $(id) {
        return doc.getElementById(id);
    }
    function stopWait() {
        clearInterval(waitTimer);
        progressIcon.restore();
        btn.tooltipText = tip;
        if(tab.image == image)
            tab.image = origIcon;
        trgWindow.removeEventListener("TabSelect", dontSelectHiddenTab, false);
        setTimeout(function() {
            delete btn._cb_disabled;
        }, 500);
    }
    function notify(msg) {
        Components.classes["@mozilla.org/alerts-service;1"]
            .getService(Components.interfaces.nsIAlertsService)
            .showAlertNotification(
                Services.appinfo.name == "Firefox" && parseFloat(Services.appinfo.version) >= 57
                    ? "chrome://mozapps/skin/extensions/extensionGeneric.svg"
                    : "chrome://mozapps/skin/extensions/extensionGeneric.png",
                btn.label,
                msg, false, "", null
            );
    }
}
function dontSelectHiddenTab(e) {
    // <tab /><tab collapsed="true" />
    // Close first tab: collapsed tab becomes selected
    var trgTab = e.originalTarget || e.target;
    if(trgTab != tab)
        return;

    if(/\n(?:BrowserOpenAddonsMgr|toEM)@chrome:\/\//.test(new Error().stack)) {
        // User open Add-ons Manager, show tab
        trgWindow.removeEventListener("TabSelect", dontSelectHiddenTab, false);
        setTimeout(function() { // Hidden tab can't be selected, so select it manually...
            tab.collapsed = tab.closing = false;
            gBrowser.selectedTab = tab;
        }, 0);
    }

    function done(t) {
        if(!t.hidden && !t.closing) {
            e.preventDefault();
            e.stopPropagation();
            return gBrowser.selectedTab = t;
        }
        return false;
    }
    for(var t = tab.nextSibling; t; t = t.nextSibling)
        if(done(t))
            return;
    for(var t = tab.previousSibling; t; t = t.previousSibling)
        if(done(t))
            return;
}
function ProgressIcon(btn) {
    if(!(btn instanceof XULElement)) {
        this.loading = this.restore = function() {};
        return;
    }
    var app = Services.appinfo.name;
    var pv = parseFloat(Services.appinfo.platformVersion);
    if(app == "SeaMonkey")
        this.imgConnecting = this.imgLoading = "chrome://communicator/skin/icons/loading.gif";
    else if(app == "Thunderbird") {
        this.imgConnecting = "chrome://messenger/skin/icons/connecting.png";
        this.imgLoading = "chrome://messenger/skin/icons/loading.png";
    }
    else {
        this.imgConnecting = "chrome://browser/skin/tabbrowser/connecting.png";
        this.imgLoading = app == "Firefox" && pv >= 48
            ? "chrome://global/skin/icons/loading.png"
            : "chrome://browser/skin/tabbrowser/loading.png";
    }
    var useAnimation = app == "Firefox" && pv >= 32;
    var btnIcon = btn.ownerDocument.getAnonymousElementByAttribute(btn, "class", "toolbarbutton-icon")
                    || btn.getElementsByClassName("toolbarbutton-icon")[0];
    var origIcon = btnIcon.src;
    btnIcon.src = this.imgConnecting;
    if(useAnimation) {
        let cs = btnIcon.ownerDocument.defaultView.getComputedStyle(btnIcon, null);
        let s = btnIcon.style;
        s.margin = [cs.marginTop, cs.marginRight, cs.marginBottom, cs.marginLeft].join(" ");
        s.padding = [cs.paddingTop, cs.paddingRight, cs.paddingBottom, cs.paddingLeft].join(" ");
        s.width = cs.width;
        s.height = cs.height;
        s.boxShadow = "none";
        s.borderColor = s.background = "transparent";
        btnIcon.setAttribute("fadein", "true");
        btnIcon.setAttribute("busy", "true");
        btnIcon.classList.add("tab-throbber");
        btnIcon._restore = function() {
            delete btnIcon._restore;
            btnIcon.removeAttribute("busy");
            btnIcon.removeAttribute("progress");
            setTimeout(function() {
                btnIcon.classList.remove("tab-throbber");
                btnIcon.removeAttribute("style");
                btnIcon.removeAttribute("fadein");
            }, 0);
        };
    }
    this.loading = function() {
        btnIcon.src = this.imgLoading;
        if(useAnimation)
            btnIcon.setAttribute("progress", "true");
    };
    this.restore = function() {
        btnIcon.src = origIcon;
        if(useAnimation)
            btnIcon._restore();
    };
}
}).call(this);
//== Check for Addons Updates end
}


this.tooltipText = "Переключатель джетпаков" 
                   + "\n\nУправление:\nЛКМ – открыть меню" 
                   + "\nПКМ – проверить обновления"
                   + "\nСКМ – открыть страницу дополнений"
                   + "\nShift+ПКМ – меню кнопки"
                   + "\n\nВ меню: \nЛКМ – включить/выключить дополнение"
                   + "\nShift+ЛКМ – включить/выключить дополнение без закрытия меню"   
                   + "\nСКМ – открыть страницу дополнения в управлении дополнениями"                    
                   + "\nПКМ – открыть настройки дополнения (если есть)";


секция /*CODE*/
скрытый текст

Выделить код

Код:

if(!event.target) // Button's hotkey pressed
    this.open = true;

Отсутствует

 

№7927-09-2019 21:26:52

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 784
UA: Firefox 52.0

Re: [CB]Toggle Restartless Add-ons

Andrey_Krropotkin
Этот код работает! Благодарю! А можно сделать что бы отключенные дополнения отражались в конце списка?

Отсутствует

 

№8027-09-2019 21:36:49

Andrey_Krropotkin
Участник
 
Группа: Members
Зарегистрирован: 11-11-2011
Сообщений: 421
UA: unknown 0.0

Re: [CB]Toggle Restartless Add-ons

kokoss это не ко мне, это не мой код, я в него не вникал.

Отсутствует

 

№8127-09-2019 21:53:20

Infocatcher
Not found
 
Группа: Extensions
Зарегистрирован: 24-05-2007
Сообщений: 4321
UA: Firefox 56.0

Re: [CB]Toggle Restartless Add-ons

kokoss пишет

А можно сделать что бы отключенные дополнения отражались в конце списка?

В начале кода есть настройки, sort: { … disabled: 1 } переместит отключенные в конец списка:

Выделить код

Код:

var options = {
    …
    sort: {
        enabled:     0,
        clickToPlay: 0,
        disabled:    0
        // Sort order:
        // 0, 0, 0 - sort add-ons of each type alphabetically
        // 0, 0, 1 - show enabled add-ons (of each type) first
        // 0, 1, 2 - enabled add-ons, then click-to-play and then disabled
    },

Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела

Отсутствует

 

№8227-09-2019 22:36:11

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 784
UA: Firefox 52.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher
Andrey_Krropotkin
Большое спасибо за помощь :beer:

Отредактировано kokoss (27-09-2019 23:30:40)

Отсутствует

 

№8324-01-2020 22:46:05

voqabuhe
Участник
 
Группа: Members
Зарегистрирован: 06-12-2011
Сообщений: 2715
UA: Firefox 72.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher
А эту кнопку планируете обновить и когда, если планируете?

Отсутствует

 

№8424-01-2020 22:55:07

Infocatcher
Not found
 
Группа: Extensions
Зарегистрирован: 24-05-2007
Сообщений: 4321
UA: Firefox 56.0

Re: [CB]Toggle Restartless Add-ons

Есть тестовая:
Toggle Restartless Add-ons 0.1.3pre4 (2020-01-01)

Но у тестовых обновлены только непосредственно исходник (toggleRestartlessAddons.js) и установочная страница (toggleRestartlessAddons.html, которую можно скачать отдельно и открыть или скопировать custombutton:// ссылку).


Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела

Отсутствует

 

№8525-01-2020 03:50:48

voqabuhe
Участник
 
Группа: Members
Зарегистрирован: 06-12-2011
Сообщений: 2715
UA: Firefox 72.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher
Понял, работает. Спасибо

Отсутствует

 

№8623-02-2020 15:02:18

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 1147
UA: Firefox 52.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher

В Firefox 74 для метода XPIDatabase.updateAddonDisabledState()
изменили аргументы. Пока записал просто так:

скрытый текст

Выделить код

Код:

//g.XPIDatabase.updateAddonDisabledState(rawAddon, newDis);
        g.XPIDatabase.updateAddonDisabledState(
            rawAddon,
            g.XPIDatabase.updateAddonDisabledState.length == 1 // Firefox 74+
                ? {userDisabled: newDis}
                : newDis
        );

Отсутствует

 

№8726-02-2020 19:53:09

Infocatcher
Not found
 
Группа: Extensions
Зарегистрирован: 24-05-2007
Сообщений: 4321
UA: Firefox 56.0

Re: [CB]Toggle Restartless Add-ons

Dumby пишет

В Firefox 74 для метода XPIDatabase.updateAddonDisabledState()

Вот ведь…
Спасибо, обновил: https://github.com/Infocatcher/Custom_B … 09bdbc351b

Заодно обнаружил, что в Firefox 74.0b7 подозрительно себя ведет Firefox Screenshots: как бы выключается, но восстанавливается после перезапуска. А в консоли

Кондуит и Швамбрания…
sendRemoveListener on closed conduit screenshots@mozilla.org.33 ConduitsChild.jsm:108
    _send resource://gre/modules/ConduitsChild.jsm:108
    _send self-hosted:977
    removeListener resource://gre/modules/ExtensionChild.jsm:1138
    removeListener resource://gre/modules/ExtensionChild.jsm:1361
    onClicked chrome://browser/content/child/ext-menus.js:282
    removeListener resource://gre/modules/ExtensionCommon.jsm:2544
    revoke resource://gre/modules/ExtensionCommon.jsm:2566
    close resource://gre/modules/ExtensionCommon.jsm:2571
    unload resource://gre/modules/ExtensionCommon.jsm:910
    unload resource://gre/modules/ExtensionPageChild.jsm:261
    unload resource://gre/modules/ExtensionPageChild.jsm:310
    destroyExtensionContext resource://gre/modules/ExtensionPageChild.jsm:494
    observe resource://gre/modules/ExtensionPageChild.jsm:407


Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела

Отсутствует

 

№8827-02-2020 21:14:09

Infocatcher
Not found
 
Группа: Extensions
Зарегистрирован: 24-05-2007
Сообщений: 4321
UA: Firefox 56.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher пишет

подозрительно себя ведет Firefox Screenshots

Пришлось еще и extensions.screenshots.disabled переключать.


Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела

Отсутствует

 

№8927-02-2020 22:23:14

voqabuhe
Участник
 
Группа: Members
Зарегистрирован: 06-12-2011
Сообщений: 2715
UA: Firefox 73.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher пишет

Пришлось еще и extensions.screenshots.disabled переключать.

Нефига опять не пойму откуда её ставить то?

Отсутствует

 

№9028-02-2020 20:14:11

Infocatcher
Not found
 
Группа: Extensions
Зарегистрирован: 24-05-2007
Сообщений: 4321
UA: Firefox 56.0

Re: [CB]Toggle Restartless Add-ons

voqabuhe пишет

Нефига опять не пойму откуда её ставить то?

В общем случае – по инструкции.
В данном случае быстрее так (нужен toggleRestartlessAddons.js с внесенными изменениями):

скрытый текст
JWbSkIZ.png

Откроется измененный файл: https://github.com/Infocatcher/Custom_B … sAddons.js

z4EJgpR.png

И вот постоянная ссылка на версию с исправлением: https://raw.githubusercontent.com/Infoc … sAddons.js


Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела

Отсутствует

 

№9128-02-2020 20:42:32

voqabuhe
Участник
 
Группа: Members
Зарегистрирован: 06-12-2011
Сообщений: 2715
UA: Firefox 73.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher
Дык там же версия от 2020-01-01, а я пытался найти от 26-02-26/27, или вы просто дату не поменяли?

Отредактировано voqabuhe (28-02-2020 20:51:19)

Отсутствует

 

№9229-02-2020 08:37:39

momo2000
Участник
 
Группа: Members
Зарегистрирован: 03-09-2015
Сообщений: 77
UA: Firefox 68.0

Re: [CB]Toggle Restartless Add-ons

voqabuhe
да, дата старая и версия, надо смотреть, когда сделаны изменения, справа от toggleRestartlessAddons.js     Force disable Firefox Screenshots:  yesterday

Отредактировано momo2000 (29-02-2020 08:37:57)

Отсутствует

 

№9317-04-2020 08:06:57

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 1147
UA: Firefox 52.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher
В Firefox 76 удалили extensionGeneric-16.svg
̣
Сначала замена была однозначной:
chrome://mozapps/skin/extensions/extensionGeneric.svg
поскольку
chrome://mozapps/skin/extensions/extension.svg
выглядела плохо.
̣
Затем похлопотали, и стала выглядеть хорошо, осталось выбрать.

Отсутствует

 

№9417-04-2020 21:40:49

Infocatcher
Not found
 
Группа: Extensions
Зарегистрирован: 24-05-2007
Сообщений: 4321
UA: Firefox 56.0

Re: [CB]Toggle Restartless Add-ons

Dumby пишет

В Firefox 76 удалили extensionGeneric-16.svg …

Вот ведь иконисты…
Спасибо, обновил: https://github.com/Infocatcher/Custom_B … aed9ec6235


Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела

Отсутствует

 

№9522-04-2020 00:37:41

egorsemenov06
Участник
 
Группа: Members
Зарегистрирован: 12-06-2018
Сообщений: 135
UA: Firefox 75.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher
Сделайте пожалуйста Вашу кнопку для user_chrome_files

скрытый текст

Выделить код

Код:

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%3E%u0414%u043E%u043F%u043E%u043B%u043D%u0435%u043D%u0438%u044F%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bcharset%3Dutf-8%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAx0lEQVR42mP4//8/AzJ++fEFA0M8w38QBrHR5dExpoA9w3+RXAEwBrFJNuDRm4dwF4DYJBsAFowCGhBF2HawWvcel/8MYRANMAz3ApIYSI1hvR6GoQw8GRxwDYQwyBCsBoD9HAXxN14DsHiLAeSsm89v/kcOQJIMwBaAhAwAW2QPSSckGQAPWKgrwV4nxQtYDUAPRDgbS6Bi9QKKArTUh+4irIFIMJSjSDEAaNutF7fgikBhg+ICXwIGgMIDObmC2LCUiit7AwCKGTGbU4PnuwAAAABJRU5ErkJggg%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/toggleRestartlessAddons.js%0A//%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fid%3D57948%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Toggle_Restartless_Add-ons%0A%0A//%20Toggle%20Restartless%20Add-ons%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22initialization%22%20section%29%0A//%20Also%20the%20code%20can%20be%20used%20from%20main%20window%20context%20%28as%20Mouse%20Gestures%20code%2C%20for%20example%29%0A%0A//%20Also%20you%20can%20check%20for%20add-ons%20updates%20using%20right-click%3A%0A//%20copy%20all%20code%20from%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/blob/master/Check_for_Addons_Updates/checkForAddonsUpdates.js%0A//%20after%20%22//%3D%3D%20Check%20for%20Addons%20Updates%20begin%22%0A%0A//%20See%20%22var%20style%20%3D%20%22%20to%20modify%20styles%20for%20specific%20add-ons%0A%0A//%20%28c%29%20Infocatcher%202013-2019%0A//%20version%200.1.3pre4%20-%202020-01-01%0A%0Avar%20options%20%3D%20%7B%0A%09addonTypes%3A%20%5B%22extension%22%2C%20%22plugin%22%5D%2C%0A%09//%20Possible%20values%3A%20%22extension%22%2C%20%22plugin%22%0A%09//%20From%20extensions%3A%20%22userstyle%22%20%28Stylish%29%2C%20%22greasemonkey-user-script%22%20%28Greasemonkey%29%2C%20%22userscript%22%20%28Scriptish%29%0A%09//%20%28swap%20to%20reorder%20in%20the%20menu%29%0A%09showVersions%3A%200%2C%0A%09//%200%20-%20don%27t%20show%20versions%0A%09//%201%20-%20show%20after%20name%3A%20%22Addon%20Name%201.2%22%0A%09//%202%20-%20show%20as%20%22acceltext%22%20%28in%20place%20for%20hotkey%20text%29%0A%09showHidden%3A%201%2C%0A%09//%200%20%20-%20don%27t%20show%20hidden%20add-ons%0A%09//%20-1%20-%20show%20only%20enabled%20hidden%20add-ons%20%28e.g.%20to%20track%20new%20items%29%0A%09//%201%20%20-%20show%20all%20hidden%20add-ons%0A%09sort%3A%20%7B%0A%09%09enabled%3A%20%20%20%20%200%2C%0A%09%09clickToPlay%3A%200%2C%0A%09%09disabled%3A%20%20%20%201%0A%09%09//%20Sort%20order%3A%0A%09%09//%200%2C%200%2C%200%20-%20sort%20add-ons%20of%20each%20type%20alphabetically%0A%09%09//%200%2C%200%2C%201%20-%20show%20enabled%20add-ons%20%28of%20each%20type%29%20first%0A%09%09//%200%2C%201%2C%202%20-%20enabled%20add-ons%2C%20then%20click-to-play%20and%20then%20disabled%0A%09%7D%2C%0A%09closeMenu%3A%20false%2C%20//%20Close%20menu%20after%20left-click%0A%09closeMenuClickToPlay%3A%20false%20//%20Close%20menu%20after%20left-click%2C%20for%20click%20to%20play%20plugins%0A%09//%20Use%20Shift+click%20to%20invert%20closeMenu*%20behavior%0A%7D%3B%0A%0Avar%20xulns%20%3D%20%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%3B%0A%0Avar%20mp%20%3D%20document.createElementNS%28xulns%2C%20%22menupopup%22%29%3B%0Amp.setAttribute%28%22onpopupshowing%22%2C%20%22this.updateMenu%28%29%3B%22%29%3B%0Amp.setAttribute%28%22oncommand%22%2C%20%22this.handleEvent%28event%29%3B%22%29%3B%0Amp.setAttribute%28%22onmousedown%22%2C%20%22if%28event.button%20%3D%3D%200%29%20this.handleEvent%28event%29%3B%22%29%3B%0Amp.setAttribute%28%22onclick%22%2C%20%22if%28event.button%20%3E%200%29%20this.handleEvent%28event%29%3B%22%29%3B%0Amp.setAttribute%28%22oncontextmenu%22%2C%20%22return%20false%3B%22%29%3B%0Amp.setAttribute%28%22onpopuphidden%22%2C%20%22this.destroyMenu%28%29%3B%22%29%3B%0A%0Avar%20tb%20%3D%20this.parentNode%3B%0Aif%28tb%20%26%26%20tb.getAttribute%28%22orient%22%29%20%3D%3D%20%22vertical%22%29%20%7B%0A%09//%20https%3A//addons.mozilla.org/firefox/addon/vertical-toolbar/%0A%09var%20isRight%20%3D%20tb.parentNode.getAttribute%28%22placement%22%29%20%3D%3D%20%22right%22%3B%0A%09mp.setAttribute%28%22position%22%2C%20isRight%20%3F%20%22start_before%22%20%3A%20%22end_before%22%29%3B%0A%7D%0A%0Avar%20cleanupTimer%20%3D%200%3B%0Amp.updateMenu%20%3D%20function%28%29%20%7B%0A%09clearTimeout%28cleanupTimer%29%3B%0A%09addStyle%28%29%3B%0A%09getRestartlessAddons%28options.addonTypes%2C%20function%28addons%29%20%7B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%09%09var%20prevType%3B%0A%09%09function%20sortPosition%28addon%29%20%7B%0A%09%09%09if%28%22STATE_ASK_TO_ACTIVATE%22%20in%20AddonManager%20%26%26%20addon.userDisabled%20%3D%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%29%0A%09%09%09%09return%20options.sort.clickToPlay%3B%0A%09%09%09if%28addon.isActive%29%0A%09%09%09%09return%20options.sort.enabled%3B%0A%09%09%09return%20options.sort.disabled%3B%0A%09%09%7D%0A%09%09function%20key%28addon%29%20%7B%0A%09%09%09return%20options.addonTypes.indexOf%28addon.type%29%0A%09%09%09%09+%20%22%5Cn%22%20+%20sortPosition%28addon%29%0A%09%09%09%09+%20%22%5Cn%22%20+%20addon.name.toLowerCase%28%29%3B%0A%09%09%7D%0A%09%09addons.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09var%20ka%20%3D%20key%28a%29%3B%0A%09%09%09var%20kb%20%3D%20key%28b%29%3B%0A%09%09%09return%20ka%20%3D%3D%20kb%20%3F%200%20%3A%20ka%20%3C%20kb%20%3F%20-1%20%3A%201%3B%0A%09%09%7D%29.forEach%28function%28addon%29%20%7B%0A%09%09%09var%20type%20%3D%20addon.type%3B%0A%09%09%09if%28prevType%20%26%26%20type%20%21%3D%20prevType%29%0A%09%09%09%09df.appendChild%28document.createElementNS%28xulns%2C%20%22menuseparator%22%29%29%3B%0A%09%09%09prevType%20%3D%20type%3B%0A%09%09%09var%20icon%20%3D%20addon.iconURL%20%7C%7C%20addon.icon64URL%3B%0A%09%09%09var%20mi%20%3D%20document.createElementNS%28xulns%2C%20%22menuitem%22%29%3B%0A%09%09%09mi.className%20%3D%20%22menuitem-iconic%22%3B%0A%09%09%09var%20label%20%3D%20addon.name%3B%0A%09%09%09if%28options.showVersions%20%3D%3D%201%29%0A%09%09%09%09label%20+%3D%20%22%20%22%20+%20addon.version%3B%0A%09%09%09else%20if%28options.showVersions%20%3D%3D%202%29%0A%09%09%09%09mi.setAttribute%28%22acceltext%22%2C%20addon.version%29%3B%0A%09%09%09mi.setAttribute%28%22label%22%2C%20label%29%3B%0A%09%09%09mi.setAttribute%28%22image%22%2C%20icon%20%7C%7C%20mp.icons%5Btype%5D%20%7C%7C%20%22%22%29%3B%0A%09%09%09if%28%21icon%20%26%26%20mp.icons.useSVG%29%0A%09%09%09%09mi.style.fill%20%3D%20%22%2315c%22%3B%0A%09%09%09var%20tip%20%3D%20addon.description%20%7C%7C%20%22%22%3B%0A%09%09%09var%20delay%20%3D%20%22delayedStartupAddons%22%20in%20Services%0A%09%09%09%09%26%26%20Services.delayedStartupAddons%5Baddon.id%5D%20%7C%7C%20null%3B%0A%09%09%09var%20isDelayed%20%3D%20delay%20%21%3D%3D%20null%3B%0A%09%09%09mi.classList.toggle%28%22toggleRestartlessAddons-isDelayed%22%2C%20isDelayed%29%3B%0A%09%09%09if%28isDelayed%29%0A%09%09%09%09tip%20%3D%20%22%5BDelayed%20Startup%3A%20%22%20+%20delay.toLocaleString%28%29%20+%20%22%5D%22%20+%20%28tip%20%3F%20%22%5Cn%22%20+%20tip%20%3A%20%22%22%29%3B%0A%09%09%09tip%20%26%26%20mi.setAttribute%28%22tooltiptext%22%2C%20tip%29%3B%0A%09%09%09mi.classList.toggle%28%22toggleRestartlessAddons-isHidden%22%2C%20addon.hidden%20%7C%7C%20false%29%3B%0A%09%09%09setDisabled%28mi%2C%20addon.userDisabled%29%3B%0A%09%09%09mi._cbAddon%20%3D%20addon%3B%0A%09%09%09df.appendChild%28mi%29%3B%0A%09%09%7D%29%3B%0A%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09mp.appendChild%28df%29%3B%0A%09%7D%29%3B%0A%7D%3B%0Amp.handleEvent%20%3D%20function%28e%29%20%7B%0A%09var%20mi%20%3D%20e.target%3B%0A%09if%28%21%28%22_cbAddon%22%20in%20mi%29%29%0A%09%09return%3B%0A%09var%20addon%20%3D%20mi._cbAddon%3B%0A%09if%28e.type%20%3D%3D%20%22mousedown%22%29%20%7B%0A%09%09var%20closeMenu%20%3D%20isAskToActivateAddon%28addon%29%0A%09%09%09%3F%20options.closeMenuClickToPlay%0A%09%09%09%3A%20options.closeMenu%3B%0A%09%09if%28e.shiftKey%29%0A%09%09%09closeMenu%20%3D%20%21closeMenu%3B%0A%09%09mi.setAttribute%28%22closemenu%22%2C%20closeMenu%20%3F%20%22auto%22%20%3A%20%22none%22%29%3B%0A%09%09return%3B%0A%09%7D%0A%09var%20hasMdf%20%3D%20hasModifier%28e%29%3B%0A%09if%28e.type%20%3D%3D%20%22command%22%20%26%26%20%28%21hasMdf%20%7C%7C%20e.shiftKey%29%29%20%7B%0A%09%09let%20newDis%20%3D%20setNewDisabled%28addon%29%3B%0A%09%09setDisabled%28mi%2C%20newDis%29%3B%0A%09%7D%0A%09else%20if%28e.type%20%3D%3D%20%22command%22%20%26%26%20hasMdf%20%7C%7C%20e.type%20%3D%3D%20%22click%22%20%26%26%20e.button%20%3D%3D%201%29%20%7B%0A%09%09openAddonPage%28addon%29%3B%0A%09%09closeMenus%28mi%29%3B%0A%09%7D%0A%09else%20if%28e.type%20%3D%3D%20%22click%22%20%26%26%20e.button%20%3D%3D%202%29%20%7B%0A%09%09if%28openAddonOptions%28addon%29%29%0A%09%09%09closeMenus%28mi%29%3B%0A%09%7D%0A%7D%3B%0Amp.destroyMenu%20%3D%20function%28%29%20%7B%0A%09removeStyle%28%29%3B%0A%09clearTimeout%28cleanupTimer%29%3B%0A%09cleanupTimer%20%3D%20setTimeout%28function%28%29%20%7B%0A%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%7D%2C%205000%29%3B%0A%7D%3B%0Amp.icons%20%3D%20%7B%0A%09get%20platformVersion%28%29%20%7B%0A%09%09delete%20this.platformVersion%3B%0A%09%09return%20this.platformVersion%20%3D%20parseFloat%28Services.appinfo.platformVersion%29%3B%0A%09%7D%2C%0A%09get%20useSVG%28%29%20%7B%0A%09%09delete%20this.useSVG%3B%0A%09%09return%20this.useSVG%20%3D%20Services.appinfo.name%20%3D%3D%20%22Firefox%22%20%26%26%20this.platformVersion%20%3E%3D%2057%3B%0A%09%7D%2C%0A%09get%20plugin%28%29%20%7B%0A%09%09delete%20this.plugin%3B%0A%09%09return%20this.plugin%20%3D%20this.useSVG%0A%09%09%09%3F%20this.platformVersion%20%3E%3D%2065%0A%09%09%09%09%3F%20%22chrome%3A//global/skin/plugins/pluginGeneric.svg%22%0A%09%09%09%09%3A%20%22chrome%3A//mozapps/skin/plugins/pluginGeneric.svg%22%0A%09%09%09%3A%20%22chrome%3A//mozapps/skin/plugins/pluginGeneric-16.png%22%3B%0A%09%7D%2C%0A%09get%20extension%28%29%20%7B%0A%09%09delete%20this.extension%3B%0A%09%09return%20this.extension%20%3D%20this.useSVG%0A%09%09%09%3F%20this.platformVersion%20%3E%3D%2076%0A%09%09%09%09%3F%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric.svg%22%20//%20Or%20chrome%3A//mozapps/skin/extensions/extension.svg%0A%09%09%09%09%3A%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric-16.svg%22%0A%09%09%09%3A%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric-16.png%22%3B%0A%09%7D%0A%7D%3B%0Afunction%20isAskToActivateAddon%28addon%29%20%7B%0A%09return%20addon.type%20%3D%3D%20%22plugin%22%0A%09%09%26%26%20%22STATE_ASK_TO_ACTIVATE%22%20in%20AddonManager%0A%09%09%26%26%20Services.prefs.getBoolPref%28%22plugins.click_to_play%22%2C%20true%29%3B%0A%7D%0Afunction%20setNewDisabled%28addon%29%20%7B%0A%09var%20newDis%20%3D%20getNewDisabled%28addon%29%3B%0A%09var%20oldDis%20%3D%20addon.userDisabled%3B%0A%09try%20%7B%0A%09%09addon.userDisabled%20%3D%20newDis%3B%0A%09%7D%0A%09catch%28e%29%20%7B%20//%20Error%3A%20Cannot%20disable%20hidden%20add-on%20firefox@getpocket.com%0A%09%09_log%28%22Can%27t%20set%20addon.userDisabled%20to%20%22%20+%20newDis%20+%20%22%2C%20error%3A%5Cn%22%20+%20e%29%3B%0A%09%09if%28addon.hidden%29%0A%09%09%09setNewDisabledRaw%28addon%2C%20newDis%29%3B%0A%09%7D%0A%09var%20realDis%20%3D%20addon.userDisabled%3B%0A%09if%28realDis%20%21%3D%20newDis%20%26%26%20addon.type%20%3D%3D%20%22extension%22%29%20%7B%20//%20Firefox%2062+%3F%20Weird%20things%20happens%0A%09%09setNewDisabledRaw%28addon%2C%20newDis%29%3B%0A%09%09realDis%20%3D%20addon.userDisabled%3B%0A%09%7D%0A%09if%28realDis%20%21%3D%20newDis%29%20%7B%20//%20We%20can%27t%20enable%20vulnerable%20plugins%0A%09%09let%20err%20%3D%20%22Can%27t%20set%20addon.userDisabled%20to%20%22%20+%20newDis%20+%20%22%2C%20real%20value%3A%20%22%20+%20realDis%3B%0A%09%09if%28newDis%29%20%7B%0A%09%09%09_log%28err%20+%20%22%5CnSTATE_ASK_TO_ACTIVATE%20not%20supported%3F%22%29%3B%0A%09%09%09newDis%20%3D%20false%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09_log%28err%20+%20%22%5CnVulnerable%20plugin%3F%22%29%3B%0A%09%09%09if%28oldDis%20%3D%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%29%0A%09%09%09%09newDis%20%3D%20true%3B%0A%09%09%09else%0A%09%09%09%09newDis%20%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%3B%0A%09%09%7D%0A%09%09addon.userDisabled%20%3D%20newDis%3B%0A%09%7D%0A%09ensureSpecialDisabled%28addon%2C%20newDis%29%3B%0A%09return%20addon.userDisabled%3B%0A%7D%0Afunction%20getNewDisabled%28addon%29%20%7B%0A%09//%20disabled%20-%3E%20STATE_ASK_TO_ACTIVATE%20-%3E%20enabled%20-%3E%20...%0A%09var%20curDis%20%3D%20addon.userDisabled%3B%0A%09var%20newDis%3B%0A%09if%28%22STATE_ASK_TO_ACTIVATE%22%20in%20AddonManager%20%26%26%20curDis%20%3D%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%29%0A%09%09newDis%20%3D%20false%3B%0A%09else%20if%28%21curDis%29%0A%09%09newDis%20%3D%20true%3B%0A%09else%20%7B%0A%09%09if%28isAskToActivateAddon%28addon%29%29%0A%09%09%09newDis%20%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%3B%0A%09%09else%0A%09%09%09newDis%20%3D%20false%3B%0A%09%7D%0A%09return%20newDis%3B%0A%7D%0Afunction%20setNewDisabledRaw%28addon%2C%20newDis%29%20%7B%0A%09_log%28%22Let%27s%20try%20set%20addon.userDisabled%20using%20raw%20hack%22%29%3B%0A%09let%20g%20%3D%20Components.utils.import%28%22resource%3A//gre/modules/addons/XPIProvider.jsm%22%2C%20%7B%7D%29%3B%0A%09if%28%22XPIDatabase%22%20in%20g%20%26%26%20%22updateAddonDisabledState%22%20in%20g.XPIDatabase%29%20%7B%20//%20Firefox%2061+%0A%09%09let%20rawAddon%20%3D%20g.XPIDatabase.getAddons%28%29.find%28function%28rawAddon%29%20%7B%0A%09%09%09return%20rawAddon.id%20%3D%3D%20addon.id%3B%0A%09%09%7D%29%3B%0A%09%09g.XPIDatabase.updateAddonDisabledState%28%0A%09%09%09rawAddon%2C%0A%09%09%09g.XPIDatabase.updateAddonDisabledState.length%20%3D%3D%201%20//%20Firefox%2074+%0A%09%09%09%09%3F%20%7B%20userDisabled%3A%20newDis%20%7D%0A%09%09%09%09%3A%20newDis%0A%09%09%29%3B%0A%09%7D%0A%09else%20if%28%22eval%22%20in%20g%29%20%7B%20//%20See%20%22set%20userDisabled%28val%29%22%0A%09%09let%20addonFor%20%3D%20g.eval%28%22addonFor%22%29%3B%0A%09%09let%20rawAddon%20%3D%20addonFor%28addon%29%3B%0A%09%09//rawAddon.userDisabled%20%3D%20newDis%3B%0A%09%09g.XPIProvider.updateAddonDisabledState%28rawAddon%2C%20newDis%29%3B%0A%09%7D%0A%09else%20%7B%20//%20Firefox%2057+%3F%20See%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fpid%3D745272%23p745272%0A%09%09updateAddonDisabledState%28addon%2C%20newDis%29%3B%0A%09%7D%0A%7D%0Afunction%20updateAddonDisabledState%28addon%2C%20newDis%29%20%7B%0A%09var%20nsvo%20%3D%20Components.utils.import%28%22resource%3A//gre/modules/addons/XPIProvider.jsm%22%2C%20%7B%7D%29%3B%0A%09var%20key%20%3D%20%22_cbToggleRestartlessAddonsData%22%3B%0A%09var%20url%20%3D%20URL.createObjectURL%28new%20Blob%28%5B%0A%09%09%22XPIProvider.updateAddonDisabledState%28addonFor%28this.%22%20+%20key%20+%20%22%5B0%5D%29%2C%20this.%22%20+%20key%20+%20%22%5B1%5D%29%3B%20delete%20this.%22%20+%20key%20+%20%22%3B%22%0A%09%5D%29%29%3B%0A%09addDestructor%28function%28%29%20%7B%0A%09%09URL.revokeObjectURL%28url%29%3B%0A%09%7D%29%3B%0A%09%28updateAddonDisabledState%20%3D%20function%28addon%2C%20newDis%29%20%7B%0A%09%09nsvo%5Bkey%5D%20%3D%20%5Baddon%2C%20newDis%5D%3B%0A%09%09Services.scriptloader.loadSubScript%28url%2C%20nsvo%29%3B%0A%09%7D%29%28addon%2C%20newDis%29%3B%0A%7D%0Afunction%20setDisabled%28mi%2C%20disabled%29%20%7B%0A%09var%20askToActivate%20%3D%20%22STATE_ASK_TO_ACTIVATE%22%20in%20AddonManager%20%26%26%20disabled%20%3D%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%3B%0A%09var%20cl%20%3D%20mi.classList%3B%0A%09cl.toggle%28%22toggleRestartlessAddons-askToActivate%22%2C%20askToActivate%29%3B%0A%09cl.toggle%28%22toggleRestartlessAddons-disabled%22%2C%20disabled%20%26%26%20%21askToActivate%29%3B%0A%7D%0Afunction%20ensureSpecialDisabled%28addon%2C%20newDis%29%20%7B%0A%09if%28addon.id%20%3D%3D%20%22screenshots@mozilla.org%22%29%0A%09%09Services.prefs.setBoolPref%28%22extensions.screenshots.disabled%22%2C%20newDis%29%3B%0A%7D%0A%0Aif%28%0A%09this%20instanceof%20XULElement%20//%20Custom%20Buttons%0A%09%26%26%20typeof%20event%20%3D%3D%20%22object%22%0A%09%26%26%20%21%28%22type%22%20in%20event%29%20%26%26%20typeof%20_phase%20%3D%3D%20%22string%22%20%26%26%20_phase%20%3D%3D%20%22init%22%20//%20Initialization%0A%29%20%7B%0A%09this.type%20%3D%20%22menu%22%3B%0A%09this.orient%20%3D%20%22horizontal%22%3B%0A%09this.appendChild%28mp%29%3B%0A%0A%09this.onmouseover%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09return%3B%0A%09%09Array.prototype.some.call%28%0A%09%09%09this.parentNode.getElementsByTagName%28%22*%22%29%2C%0A%09%09%09function%28node%29%20%7B%0A%09%09%09%09if%28%0A%09%09%09%09%09node%20%21%3D%20this%0A%09%09%09%09%09%26%26%20node.namespaceURI%20%3D%3D%20xulns%0A%09%09%09%09%09//%20See%20https%3A//github.com/Infocatcher/Custom_Buttons/issues/28%0A%09%09%09%09%09//%26%26%20node.boxObject%0A%09%09%09%09%09//%26%26%20node.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%09%26%26%20%22open%22%20in%20node%0A%09%09%09%09%09%26%26%20node.open%0A%09%09%09%09%09%26%26%20node.getElementsByTagName%28%22menupopup%22%29.length%0A%09%09%09%09%29%20%7B%0A%09%09%09%09%09node.open%20%3D%20false%3B%0A%09%09%09%09%09this.open%20%3D%20true%3B%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%09%7D%0A%09%09%09%09return%20false%3B%0A%09%09%09%7D%2C%0A%09%09%09this%0A%09%09%29%3B%0A%09%7D%3B%0A%09this.onmousedown%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%3D%3D%20this%20%26%26%20e.button%20%3D%3D%200%20%26%26%20hasModifier%28e%29%29%0A%09%09%09e.preventDefault%28%29%3B%0A%09%7D%3B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%3D%3D%20this%20%26%26%20%21hasModifier%28e%29%20%26%26%20hasUpdater%28%29%29%0A%09%09%09e.preventDefault%28%29%3B%0A%09%7D%3B%0A%09this.onclick%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09return%3B%0A%09%09if%28e.button%20%3D%3D%200%20%26%26%20hasModifier%28e%29%20%7C%7C%20e.button%20%3D%3D%201%29%0A%09%09%09openAddonsManager%28%29%3B%0A%09%09else%20if%28e.button%20%3D%3D%202%20%26%26%20%21hasModifier%28e%29%20%26%26%20hasUpdater%28%29%29%0A%09%09%09checkForAddonsUpdates.call%28this%29%3B%0A%09%7D%3B%0A%7D%0Aelse%20%7B%20//%20Mouse%20gestures%20or%20something%20other...%0A%09let%20e%3B%0A%09if%28typeof%20event%20%3D%3D%20%22object%22%20%26%26%20event%20instanceof%20Event%20%26%26%20%22screenX%22%20in%20event%29%20//%20FireGestures%0A%09%09e%20%3D%20event%3B%0A%09else%20if%28%0A%09%09this%20instanceof%20Components.interfaces.nsIDOMChromeWindow%0A%09%09%26%26%20%22mgGestureState%22%20in%20window%20%26%26%20%22endEvent%22%20in%20mgGestureState%20//%20Mouse%20Gestures%20Redox%0A%09%29%0A%09%09e%20%3D%20mgGestureState.endEvent%3B%0A%09else%20%7B%0A%09%09let%20anchor%20%3D%20this%20instanceof%20XULElement%20%26%26%20this%0A%09%09%09%7C%7C%20window.gBrowser%20%26%26%20gBrowser.selectedBrowser%0A%09%09%09%7C%7C%20document.documentElement%3B%0A%09%09if%28%22boxObject%22%20in%20anchor%29%20%7B%0A%09%09%09let%20bo%20%3D%20anchor.boxObject%3B%0A%09%09%09e%20%3D%20%7B%0A%09%09%09%09screenX%3A%20bo.screenX%2C%0A%09%09%09%09screenY%3A%20bo.screenY%0A%09%09%09%7D%3B%0A%09%09%09if%28this%20instanceof%20XULElement%29%0A%09%09%09%09e.screenY%20+%3D%20bo.height%3B%0A%09%09%7D%0A%09%7D%0A%09if%28%21e%20%7C%7C%20%21%28%22screenX%22%20in%20e%29%29%0A%09%09throw%20new%20Error%28%22%5BToggle%20Restartless%20Add-ons%5D%3A%20Can%27t%20get%20event%20object%22%29%3B%0A%09document.documentElement.appendChild%28mp%29%3B%0A%09mp.addEventListener%28%22popuphidden%22%2C%20function%20destroy%28e%29%20%7B%0A%09%09mp.removeEventListener%28e.type%2C%20destroy%2C%20false%29%3B%0A%09%09setTimeout%28function%28%29%20%7B%0A%09%09%09mp.destroyMenu%28%29%3B%0A%09%09%09mp.parentNode.removeChild%28mp%29%3B%0A%09%09%7D%2C%200%29%3B%0A%09%7D%2C%20false%29%3B%0A%09mp.openPopupAtScreen%28e.screenX%2C%20e.screenY%29%3B%0A%7D%0A%0Afunction%20getRestartlessAddons%28addonTypes%2C%20callback%2C%20context%29%20%7B%0A%09if%28%21%28%22AddonManager%22%20in%20window%29%29%0A%09%09Components.utils.import%28%22resource%3A//gre/modules/AddonManager.jsm%22%29%3B%0A%09if%28%21%28%22Services%22%20in%20window%29%29%0A%09%09Components.utils.import%28%22resource%3A//gre/modules/Services.jsm%22%29%3B%0A%09var%20then%2C%20promise%20%3D%20AddonManager.getAddonsByTypes%28addonTypes%2C%20then%20%3D%20function%28addons%29%20%7B%0A%09%09callback.call%28context%2C%20addons.filter%28function%28addon%29%20%7B%0A%09%09%09var%20ops%20%3D%20addon.operationsRequiringRestart%3B%0A%09%09%09return%20%21addon.appDisabled%0A%09%09%09%09%26%26%20%21%28ops%20%26%20AddonManager.OP_NEEDS_RESTART_ENABLE%20%7C%7C%20ops%20%26%20AddonManager.OP_NEEDS_RESTART_DISABLE%29%0A%09%09%09%09%26%26%20%28%0A%09%09%09%09%09%21addon.hidden%0A%09%09%09%09%09%7C%7C%20options.showHidden%20%3E%200%0A%09%09%09%09%09%7C%7C%20options.showHidden%20%3D%3D%20-1%20%26%26%20%21addon.userDisabled%0A%09%09%09%09%29%0A%09%09%09%09%26%26%20%28addon.iconURL%20%7C%7C%20%22%22%29.substr%280%2C%2029%29%20%21%3D%20%22resource%3A//search-extensions/%22%3B%0A%09%09%7D%29%29%3B%0A%09%7D%29%3B%0A%09promise%20%26%26%20typeof%20promise.then%20%3D%3D%20%22function%22%20%26%26%20promise.then%28then%2C%20Components.utils.reportError%29%3B%20//%20Firefox%2061+%0A%7D%0Afunction%20openAddonOptions%28addon%29%20%7B%0A%09//%20Based%20on%20code%20from%20chrome%3A//mozapps/content/extensions/extensions.js%0A%09//%20Firefox%2021.0a1%20%282013-01-27%29%0A%09var%20optionsURL%20%3D%20addon.optionsURL%3B%0A%09if%28%21addon.isActive%20%7C%7C%20%21optionsURL%29%0A%09%09return%20false%3B%0A%09if%28addon.type%20%3D%3D%20%22plugin%22%29%20//%20No%20options%20for%20now%21%0A%09%09return%20false%3B%0A%09if%28%0A%09%09addon.optionsType%20%3D%3D%20%28AddonManager.OPTIONS_TYPE_INLINE%20%7C%7C%20NaN%29%0A%09%09%7C%7C%20addon.optionsType%20%3D%3D%20%28AddonManager.OPTIONS_TYPE_INLINE_INFO%20%7C%7C%20NaN%29%0A%09%09%7C%7C%20addon.optionsType%20%3D%3D%20%28AddonManager.OPTIONS_TYPE_INLINE_BROWSER%20%7C%7C%20NaN%29%0A%09%29%0A%09%09openAddonPage%28addon%2C%20true%29%3B%0A%09else%20if%28addon.optionsType%20%3D%3D%20AddonManager.OPTIONS_TYPE_TAB%20%26%26%20%22switchToTabHavingURI%22%20in%20window%29%0A%09%09switchToTabHavingURI%28optionsURL%2C%20true%29%3B%0A%09else%20%7B%0A%09%09let%20windows%20%3D%20Services.wm.getEnumerator%28null%29%3B%0A%09%09while%28windows.hasMoreElements%28%29%29%20%7B%0A%09%09%09let%20win%20%3D%20windows.getNext%28%29%3B%0A%09%09%09if%28win.document.documentURI%20%3D%3D%20optionsURL%29%20%7B%0A%09%09%09%09win.focus%28%29%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09//%20Note%3A%20original%20code%20checks%20browser.preferences.instantApply%20and%20may%20open%20modal%20windows%0A%09%09window.openDialog%28optionsURL%2C%20%22%22%2C%20%22chrome%2Ctitlebar%2Ctoolbar%2Ccenterscreen%2Cdialog%3Dno%22%29%3B%0A%09%7D%0A%09return%20true%3B%0A%7D%0Afunction%20openAddonsManager%28view%29%20%7B%0A%09var%20openAddonsMgr%20%3D%20window.BrowserOpenAddonsMgr%20//%20Firefox%0A%09%09%7C%7C%20window.openAddonsMgr%20//%20Thunderbird%0A%09%09%7C%7C%20window.toEM%3B%20//%20SeaMonkey%0A%09openAddonsMgr%28view%29%3B%0A%7D%0Afunction%20openAddonPage%28addon%2C%20scrollToPreferences%29%20%7B%0A%09var%20platformVersion%20%3D%20parseFloat%28%0A%09%09Services.appinfo.name%20%3D%3D%20%22Pale%20Moon%22%0A%09%09%09%3F%20Services.appinfo.version%0A%09%09%09%3A%20Services.appinfo.platformVersion%0A%09%29%3B%0A%09scrollToPreferences%20%3D%20scrollToPreferences%20%26%26%20platformVersion%20%3E%3D%2012%0A%09%09%3F%20%22/preferences%22%0A%09%09%3A%20%22%22%3B%0A%09openAddonsManager%28%22addons%3A//detail/%22%20+%20encodeURIComponent%28addon.id%29%20+%20scrollToPreferences%29%3B%0A%7D%0A%0Afunction%20hasModifier%28e%29%20%7B%0A%09return%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%3B%0A%7D%0A%0Afunction%20addStyle%28%29%20%7B%0A%09if%28addStyle.hasOwnProperty%28%22_style%22%29%29%0A%09%09return%3B%0A%09var%20style%20%3D%20%27%5C%0A%09%09.toggleRestartlessAddons-isDelayed%20%3E%20.menu-iconic-text%20%7B%5Cn%5C%0A%09%09%09opacity%3A%200.75%3B%5Cn%5C%0A%09%09%09color%3A%20%23070%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09.toggleRestartlessAddons-isHidden%20%3E%20.menu-iconic-text%20%7B%5Cn%5C%0A%09%09%09color%3A%20%23609%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09.toggleRestartlessAddons-disabled%20%3E%20.menu-iconic-left%20%7B%5Cn%5C%0A%09%09%09opacity%3A%200.4%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09.toggleRestartlessAddons-disabled%20%3E%20.menu-iconic-text%2C%5Cn%5C%0A%09%09.toggleRestartlessAddons-disabled%20%3E%20.menu-accel-container%20%7B%5Cn%5C%0A%09%09%09opacity%3A%200.5%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09.toggleRestartlessAddons-askToActivate%20%7B%5Cn%5C%0A%09%09%09color%3A%20-moz-nativehyperlinktext%3B%5Cn%5C%0A%09%09%7D%27%3B%0A%09addStyle._style%20%3D%20document.insertBefore%28%0A%09%09document.createProcessingInstruction%28%0A%09%09%09%22xml-stylesheet%22%2C%0A%09%09%09%27href%3D%22%27%20+%20%22data%3Atext/css%2C%22%0A%09%09%09%09+%20encodeURIComponent%28style%29%20+%20%27%22%20type%3D%22text/css%22%27%0A%09%09%29%2C%0A%09%09document.documentElement%0A%09%29%3B%0A%7D%0Afunction%20removeStyle%28%29%20%7B%0A%09if%28%21addStyle.hasOwnProperty%28%22_style%22%29%29%0A%09%09return%3B%0A%09var%20s%20%3D%20addStyle._style%3B%0A%09s.parentNode.removeChild%28s%29%3B%0A%09delete%20addStyle._style%3B%0A%7D%0Afunction%20closeMenus%28node%29%20%7B%0A%09//%20Based%20on%20function%20closeMenus%20from%20chrome%3A//browser/content/utilityOverlay.js%0A%09for%28%3B%20node%20%26%26%20%22tagName%22%20in%20node%3B%20node%20%3D%20node.parentNode%29%20%7B%0A%09%09if%28%0A%09%09%09node.namespaceURI%20%3D%3D%20%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%0A%09%09%09%26%26%20%28node.localName%20%3D%3D%20%22menupopup%22%20%7C%7C%20node.localName%20%3D%3D%20%22popup%22%29%0A%09%09%29%0A%09%09%09node.hidePopup%28%29%3B%0A%09%7D%0A%7D%0Afunction%20_log%28s%29%20%7B%0A%09if%28typeof%20LOG%20%3D%3D%20%22function%22%29%20//%20Custom%20Buttons%0A%09%09LOG%28s%29%3B%0A%09else%20//%20Or%20something%20else%0A%09%09Services.console.logStringMessage%28%22Toggle%20Restartless%20Add-ons%3A%20%22%20+%20s%29%3B%0A%7D%0A%0Afunction%20hasUpdater%28%29%20%7B%0A%09var%20has%20%3D%20checkForAddonsUpdates.toString%28%29.indexOf%28%22about%3Aaddons%22%29%20%21%3D%20-1%3B%0A%09hasUpdater%20%3D%20function%28%29%20%7B%0A%09%09return%20has%3B%0A%09%7D%3B%0A%09return%20has%3B%0A%7D%0Afunction%20checkForAddonsUpdates%28%29%20%7B%0A//%3D%3D%20Check%20for%20Addons%20Updates%20begin%0A//%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-2020%0A//%20version%200.1.6pre%20-%202020-01-24%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%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%28isPending%20%7C%7C%20browser.webProgress.isLoadingDocument%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%28parseFloat%28Services.appinfo.platformVersion%29%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%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%0A%09%09tab.setAttribute%28origAttr%2C%20tab.image%29%3B%0A%09tab.image%20%3D%20image%3B%0A%0A%09var%20updEnabledPref%20%3D%20%22extensions.update.enabled%22%3B%0A%09var%20updEnabled%20%3D%20Services.prefs.getBoolPref%28updEnabledPref%29%3B%0A%09if%28%21updEnabled%29%0A%09%09Services.prefs.setBoolPref%28updEnabledPref%2C%20true%29%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%09win.setTimeout%28processAddonsTab%2C%2020%2C%20win%29%3B%0A%09%09%09return%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%2C%0A%09%09set%20hidden%28h%29%20%7B%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%0A%09%09%09%09tabmail.closeTab%28tbTabInfo%2C%20true%20/*aNoUndo*/%29%3B%0A%09%09%09else%20%7B%0A%09%09%09%09gBrowser.removeTab%28tab%29%3B%0A%09%09%09%09%28function%20forgetClosedTab%28isSecondTry%29%20%7B%0A%09%09%09%09%09var%20ss%20%3D%20%22nsISessionStore%22%20in%20Components.interfaces%0A%09%09%09%09%09%09%3F%20%28%0A%09%09%09%09%09%09%09Components.classes%5B%22@mozilla.org/browser/sessionstore%3B1%22%5D%0A%09%09%09%09%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/suite/sessionstore%3B1%22%5D%0A%09%09%09%09%09%09%29.getService%28Components.interfaces.nsISessionStore%29%0A%09%09%09%09%09%09%3A%20SessionStore%3B%20//%20Firefox%2061+%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1450559%0A%09%09%09%09%09if%28%21%28%22forgetClosedTab%22%20in%20ss%29%29%0A%09%09%09%09%09%09return%3B%0A%09%09%09%09%09var%20closedTabs%20%3D%20JSON.parse%28ss.getClosedTabData%28window%29%29%3B%0A%09%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%09%09let%20closedTab%20%3D%20closedTabs%5Bi%5D%3B%0A%09%09%09%09%09%09let%20state%20%3D%20closedTab.state%3B%0A%09%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%09%09ss.forgetClosedTab%28window%2C%20i%29%3B%0A%09%09%09%09%09%09%09return%3B%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%09if%28%21isSecondTry%29%20//%20May%20be%20needed%20in%20SeaMonkey%0A%09%09%09%09%09%09setTimeout%28forgetClosedTab%2C%200%2C%20true%29%3B%0A%09%09%09%09%7D%29%28%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09if%28%21updEnabled%29%0A%09%09%09Services.prefs.setBoolPref%28updEnabledPref%2C%20false%29%3B%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%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%28vb%20%26%26%20cats.selectedItem%20%3D%3D%20upds%29%20//%20Only%20for%20Firefox%2072+%0A%09%09%09cats.selectedItem%20%3D%20%24%28%22category-extension%22%29%3B%20//%20Trick%20to%20force%20update%0A%09%09cats.selectedItem%20%3D%20upds%3B%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%22@mozilla.org/alerts-service%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIAlertsService%29%0A%09%09%09.showAlertNotification%28%0A%09%09%09%09Services.appinfo.name%20%3D%3D%20%22Firefox%22%20%26%26%20parseFloat%28Services.appinfo.version%29%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%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%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%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%0A//%3D%3D%20Check%20for%20Addons%20Updates%20end%0A%7D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%0Athis.tooltipText%20%3D%20%22%u041F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0430%u0442%u0435%u043B%u044C%20%u0434%u0436%u0435%u0442%u043F%u0430%u043A%u043E%u0432%22%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5Cn%5Cn%u0423%u043F%u0440%u0430%u0432%u043B%u0435%u043D%u0438%u0435%3A%5Cn%u041B%u041A%u041C%20%u2013%20%u043E%u0442%u043A%u0440%u044B%u0442%u044C%20%u043C%u0435%u043D%u044E%22%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5Cn%u041F%u041A%u041C%20%u2013%20%u043F%u0440%u043E%u0432%u0435%u0440%u0438%u0442%u044C%20%u043E%u0431%u043D%u043E%u0432%u043B%u0435%u043D%u0438%u044F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5Cn%u0421%u041A%u041C%20%u2013%20%u043E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0441%u0442%u0440%u0430%u043D%u0438%u0446%u0443%20%u0434%u043E%u043F%u043E%u043B%u043D%u0435%u043D%u0438%u0439%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5CnShift+%u041F%u041A%u041C%20%u2013%20%u043C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5Cn%5Cn%u0412%20%u043C%u0435%u043D%u044E%3A%20%5Cn%u041B%u041A%u041C%20%u2013%20%u0432%u043A%u043B%u044E%u0447%u0438%u0442%u044C/%u0432%u044B%u043A%u043B%u044E%u0447%u0438%u0442%u044C%20%u0434%u043E%u043F%u043E%u043B%u043D%u0435%u043D%u0438%u0435%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5CnShift+%u041B%u041A%u041C%20%u2013%20%u0432%u043A%u043B%u044E%u0447%u0438%u0442%u044C/%u0432%u044B%u043A%u043B%u044E%u0447%u0438%u0442%u044C%20%u0434%u043E%u043F%u043E%u043B%u043D%u0435%u043D%u0438%u0435%20%u0431%u0435%u0437%20%u0437%u0430%u043A%u0440%u044B%u0442%u0438%u044F%20%u043C%u0435%u043D%u044E%22%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5Cn%u0421%u041A%u041C%20%u2013%20%u043E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0441%u0442%u0440%u0430%u043D%u0438%u0446%u0443%20%u0434%u043E%u043F%u043E%u043B%u043D%u0435%u043D%u0438%u044F%20%u0432%20%u0443%u043F%u0440%u0430%u0432%u043B%u0435%u043D%u0438%u0438%20%u0434%u043E%u043F%u043E%u043B%u043D%u0435%u043D%u0438%u044F%u043C%u0438%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22%5Cn%u041F%u041A%u041C%20%u2013%20%u043E%u0442%u043A%u0440%u044B%u0442%u044C%20%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0438%20%u0434%u043E%u043F%u043E%u043B%u043D%u0435%u043D%u0438%u044F%20%28%u0435%u0441%u043B%u0438%20%u0435%u0441%u0442%u044C%29%22%3B%20%20%20%20%20%0A//%20Autoopen/close%20feature%0Avar%20openDelay%20%3D%20200%3B%0Avar%20closeDelay%20%3D%20350%3B%0A%0Avar%20_openTimer%20%3D%200%3B%0Avar%20_closeTimer%20%3D%200%3B%0Athis.onmouseover%20%3D%20function%28e%29%20%7B%0A%09clearTimeout%28_closeTimer%29%3B%0A%09if%28e.target%20%3D%3D%20this%20%26%26%20closeOtherMenus%28%29%29%20%7B%0A%09%09this.open%20%3D%20true%3B%0A%09%09return%3B%0A%09%7D%0A%09_openTimer%20%3D%20setTimeout%28function%28%29%20%7B%0A%09%09self.open%20%3D%20true%3B%0A%09%7D%2C%20openDelay%29%3B%0A%7D%3B%0Athis.onmouseout%20%3D%20function%28e%29%20%7B%0A%09clearTimeout%28_openTimer%29%3B%0A%09_closeTimer%20%3D%20setTimeout%28function%28%29%20%7B%0A%09%09if%28%21isContextOpened%28%29%29%0A%09%09%09self.open%20%3D%20false%3B%0A%09%7D%2C%20closeDelay%29%3B%0A%7D%3B%0Afunction%20closeOtherMenus%28%29%20%7B%0A%09return%20Array.prototype.some.call%28%0A%09%09self.parentNode.getElementsByTagName%28%22*%22%29%2C%0A%09%09function%28node%29%20%7B%0A%09%09%09if%28%0A%09%09%09%09node%20%21%3D%20self%0A%09%09%09%09%26%26%20node.namespaceURI%20%3D%3D%20xulns%0A%09%09%09%09//%20See%20https%3A//github.com/Infocatcher/Custom_Buttons/issues/28%0A%09%09%09%09//%26%26%20node.boxObject%0A%09%09%09%09//%26%26%20node.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%26%26%20%22open%22%20in%20node%0A%09%09%09%09%26%26%20node.open%0A%09%09%09%09%26%26%20node.getElementsByTagName%28%22menupopup%22%29.length%0A%09%09%09%29%20%7B%0A%09%09%09%09node.open%20%3D%20false%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%29%3B%0A%7D%0Afunction%20isContextOpened%28%29%20%7B%0A%09return%20inBtn%28document.popupNode%29%3B%0A%7D%0Afunction%20inBtn%28node%29%20%7B%0A%09for%28%3B%20node%3B%20node%20%3D%20node.parentNode%29%0A%09%09if%28node%20%3D%3D%20self%29%0A%09%09%09return%20true%3B%0A%09return%20false%3B%0A%7D%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5Bif%28%21event.target%29%20//%20Button%27s%20hotkey%20pressed%0A%20%20%20%20this.open%20%3D%20true%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

Отсутствует

 

№9622-04-2020 21:22:18

Infocatcher
Not found
 
Группа: Extensions
Зарегистрирован: 24-05-2007
Сообщений: 4321
UA: Firefox 56.0

Re: [CB]Toggle Restartless Add-ons

egorsemenov06 пишет

Сделайте пожалуйста Вашу кнопку для user_chrome_files

https://github.com/VitaliyVstyle/Vitali … _files.zip ?

Судя по описанию, надо в user_chrome_files/custom_scripts/custom_script.js вписать вот такое:

Выделить код

Код:

(function () { // Toggle Restartless Add-ons button
// Custom Buttons-like environment
var event = {};
var _phase = "init";

var id = "__cb_toggleRestartlessAddons";

CustomizableUI.createWidget({
	id: id,
	type: "custom",
	defaultArea: CustomizableUI.AREA_NAVBAR,
	onBuild: function(doc) {
		var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
		var btn = doc.createElementNS(XUL_NS, "toolbarbutton");
		var attrs = {
			id: id,
			class: "toolbarbutton-1 chromeclass-toolbar-additional",
			label: "Toggle Restartless Add-ons",
			tooltiptext: "Toggle Restartless Add-ons",
			style: 'list-style-image: url("chrome://branding/content/icon16.png");', // Set icon here
			__proto__: null
		};
		for(var p in attrs)
			btn.setAttribute(p, attrs[p]);
		doc.defaultView.setTimeout(function() {
			toggleRestartlessAddons.call(btn);
		}, 0);
		return btn;
	}
});

function toggleRestartlessAddons() {
	// Code from https://github.com/Infocatcher/Custom_Buttons/blob/master/Toggle_Restartless_Add-ons/toggleRestartlessAddons.js

}

})();

Вместо chrome://branding/content/icon16.png надо вписать длинный data:image… иконки.
И после «function toggleRestartlessAddons() {» вставить код инициализации кнопки.

Из консоли ошибок работает. Наверное, и из user_chrome_files запустится.


Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела

Отсутствует

 

№9722-04-2020 22:24:30

egorsemenov06
Участник
 
Группа: Members
Зарегистрирован: 12-06-2018
Сообщений: 135
UA: Firefox 75.0

Re: [CB]Toggle Restartless Add-ons

Infocatcher пишет
egorsemenov06 пишет

Сделайте пожалуйста Вашу кнопку для user_chrome_files

https://github.com/VitaliyVstyle/Vitali … _files.zip ?

Судя по описанию, надо в user_chrome_files/custom_scripts/custom_script.js вписать вот такое:

Выделить код

Код:

(function () { // Toggle Restartless Add-ons button
// Custom Buttons-like environment
var event = {};
var _phase = "init";

var id = "__cb_toggleRestartlessAddons";

CustomizableUI.createWidget({
	id: id,
	type: "custom",
	defaultArea: CustomizableUI.AREA_NAVBAR,
	onBuild: function(doc) {
		var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
		var btn = doc.createElementNS(XUL_NS, "toolbarbutton");
		var attrs = {
			id: id,
			class: "toolbarbutton-1 chromeclass-toolbar-additional",
			label: "Toggle Restartless Add-ons",
			tooltiptext: "Toggle Restartless Add-ons",
			style: 'list-style-image: url("chrome://branding/content/icon16.png");', // Set icon here
			__proto__: null
		};
		for(var p in attrs)
			btn.setAttribute(p, attrs[p]);
		doc.defaultView.setTimeout(function() {
			toggleRestartlessAddons.call(btn);
		}, 0);
		return btn;
	}
});

function toggleRestartlessAddons() {
	// Code from https://github.com/Infocatcher/Custom_Buttons/blob/master/Toggle_Restartless_Add-ons/toggleRestartlessAddons.js

}

})();

Вместо chrome://branding/content/icon16.png надо вписать длинный data:image… иконки.
И после «function toggleRestartlessAddons() {» вставить код инициализации кнопки.

Из консоли ошибок работает. Наверное, и из user_chrome_files запустится.

Увы но не запустилась

Отсутствует

 

№9822-04-2020 22:53:16

voqabuhe
Участник
 
Группа: Members
Зарегистрирован: 06-12-2011
Сообщений: 2715
UA: Firefox 75.0

Re: [CB]Toggle Restartless Add-ons

egorsemenov06
Extension Options Menu. Плохо  только что плагинов нет в списке.

Отредактировано voqabuhe (22-04-2020 22:53:46)

Отсутствует

 

№9922-04-2020 23:34:50

egorsemenov06
Участник
 
Группа: Members
Зарегистрирован: 12-06-2018
Сообщений: 135
UA: Firefox 75.0

Re: [CB]Toggle Restartless Add-ons

voqabuhe пишет

egorsemenov06
Extension Options Menu. Плохо  только что плагинов нет в списке.

а куда это надо вписывать?и работаетли на [firefox] 75.0

Отсутствует

 

№10022-04-2020 23:56:21

voqabuhe
Участник
 
Группа: Members
Зарегистрирован: 06-12-2011
Сообщений: 2715
UA: Firefox 75.0

Re: [CB]Toggle Restartless Add-ons

egorsemenov06
В папке  chrome создать файл Extension Options Menu.uc.js. и в него вписать. На 75 [firefox] работает.

Добавлено 23-04-2020 00:04:37
Если что непонятно, по ссылке которую я вам дал, вверху есть  • к этому сообщению •, там найдёте инструкцию.

Отредактировано voqabuhe (23-04-2020 00:06:15)

Отсутствует

 

Board footer

Powered by PunBB
Modified by Mozilla Russia
Copyright © 2004–2011 Mozilla Russia
Язык отображения форума: [Русский] [English]