333ywb
小狐狸
小狐狸
  • UID27284
  • 注册日期2008-12-03
  • 最后登录2019-11-08
  • 发帖数93
  • 经验102枚
  • 威望0点
  • 贡献值100点
  • 好评度0点
  • 社区居民
  • 忠实会员
阅读:1705回复:9

【已解决】升级Firefox Nightly 69.0a1后此UC脚本失效!

楼主#
更多 发布于:2019-06-01 10:49
下列脚本是在_addmenu中,此部分脚本失效,

不知道是不是跟 addMenuPlus.uc 有没有关系,

如果有我在贴出来,以便大神修改

谢谢!@lonely_8

1楼和主楼这两处脚本都是在标签页右键下的功能失效的
new function () {
    var items = [
    {label:"复制当前标签【标题】",
    oncommand: function() {addMenu.copy(addMenu.convertText("%TITLE%"));},
    image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAXElEQVQ4jWNgGCzgPxZMSA2GJKkWEmXAfwYGBg9yDfBgYGCYCcXEWogCjjIwMChDaZIBssY8KCYJ5DGghjhJrlBmwPTjTKg4ToCsAVvAeaCJ0S8dkGQARUl54AAAWsMsNkwmkt8AAAAASUVORK5CYII="},
    {label:"复制当前标签【地址】",oncommand: function() {addMenu.copy(addMenu.convertText("%URL%"));},image:""},
    {label:"复制当前标签标题和地址",
    oncommand: function() {addMenu.copy(addMenu.convertText("%TITLE%\n%URL%"));},image:""},
    {label:"复制当前标签源代码",oncommand: function() {addMenu.copy(addMenu.convertText( '<a href="%URL%" target="_blank">%TITLES%</a>'));},image:""},
{},
{label:"复制所有标签标题",oncommand: function() {(function(){
                        var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
            var titles = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                titles += tab.label + "\n";
            });
            gClipboardHelper.copyString(titles);   
    })();},image:""},
        {label:"复制所有标签地址",oncommand: function() {(function(){
            var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
            var URLs = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                var url = gBrowser.getBrowserForTab(tab).currentURI.spec;
                URLs += url + "\n";
            });
            gClipboardHelper.copyString(URLs);      
    })();},image:""},
        {label:"复制所有标签标题和地址",oncommand: function() {(function() {
            var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
                                                var txt = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                 var url = gBrowser.getBrowserForTab(tab).currentURI.spec;
                txt += tab.label + "\n" + url + "\n";
            });
            gClipboardHelper.copyString(txt); 
        })();},image:""},
        {label:"复制所有标签HTML链接",oncommand: function() {(function() {
            var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
            var txt = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                 var url = gBrowser.getBrowserForTab(tab).currentURI.spec;
                txt += "<a href=" + "\""+ url +"\" "+  "target=\"_blank\">" +  tab.label + "</a>"+ ""+ "\r";
            });
            gClipboardHelper.copyString(txt);  
        })();},image:""},
      
    {},
    {
        label:"复制 Favicon 的 URL",
        text:"%FAVICON%",
        image:" "
    }, {
        label:"复制 Favicon 的 Base64",
        text:"%FAVICON_BASE64%",
        image:" "
    }
    ];
    var menu = TabMenu({id:"context_TabInfoCopy",onpopupshowing: syncHidden});
    menu(items);
};
333ywb
小狐狸
小狐狸
  • UID27284
  • 注册日期2008-12-03
  • 最后登录2019-11-08
  • 发帖数93
  • 经验102枚
  • 威望0点
  • 贡献值100点
  • 好评度0点
  • 社区居民
  • 忠实会员
1楼#
发布于:2019-06-01 11:07
下列代码也失效了,请大神帮忙!


// ==UserScript==
// @name           OpenWith.uc.js
// @description    用其他浏览器打开页面、链接、书签及标签
// @author         ding
// @include        main
// @version        2018.2.3.1
// @homepageURL    https://bbs.kafan.cn/thread-2114879-1-1.html
// @startup        window.OpenWithManager.init();
// @shutdown       window.OpenWithManager.destroy();
// @note           适配Firefox57+
// ==/UserScript==
location.href.startsWith('chrome://browser/content/browser.x') && (function () {
 
    const MENU_NAME = "用其它浏览器打开";
 
    //是否使用二级菜单
    const USE_MENU_AREA = true; //页面
    const USE_MENU_TAB = false; //标签
    const USE_MENU_PLACE = false; //书签
 
    function getFirefoxPath(){//firefox.exe所在路径
        return OS.Constants.Path.libDir;
    }
    function getRootPath() {//firefox所在盘路径
        var path = getFirefoxPath();
        var index = path.indexOf(":");
        return path.substring(0,index+1);
    }
    //修改内容后请将脚本改名来保证加载的是最新,或使用无缓存的userChrome.js
    var browsers = {
        IE: {
            enable: true,
            name: "IE",
            path: "C:\\Program Files\\Internet Explorer\\iexplore.exe",
            image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACYklEQVRIic1VIWxTYRD+RcUW2u7/73UJYqJiJBMIBGKiAjExgUBMIBCICQRiYhLxEgSiCS9pe/ezIJATkxMViBeCWEJFxdJ17+4nOCYmJgiZmCji0Xav+/u6EhK45Mx77767+767e0r9r1YN44UllC1Dbt+QHBvkK4NyAcRHAfHGXGA67GpAt6lbshOgs5okNsTnQDIAkgFY7gfoLLSSbSCOwHK/jG71VsABJm+A5HIE5nFN8r60l1SGcQaTmm7JTj44JU8yVc5wg3IRID8fxeclMLb/OOU09dsmAZJB2Z481WFXQ5N3/eCY1AD5h0HuapJ4HvC0E74yyPXK29OH3gRguQ/EEZB7nQ3+PR3YKyrsFQPiDbCuMy1JNYwXvLwDcQToNif4baswLNwICMMCkPvoS3Jdj0yCMrrVdJ7HH9/B3t1pei02ZMWvEx/d+Hj53dd7AfFhpvoWf5oGPjSD0vZ08VM1ZHmCf/dhXlHzvGhP7o/AS81k7W+CA8lAR/1HM6s3xOeaJP4jR36glFKq3JB1oOS7txJ0X2ZpMNPSuc9rtVvNi19syIqOutXrnpk8QDkzyFfaStO/OO6zdw+UUksoW74xHd2i0l5SAZIBWD5QYVjQKOLtxPJB5gRjrwitZNu7Ayhno00OiDdSMeWZUumhy7015L6BdZ28Ixhg/+WYnibvpjQktbEmk3doHucoyyGdvgCSweRvbmr7ed0h12+IpKNuFUguhxoMn5cbsq5JYkA5m7lQJHFmqSZtBJae5EOD0jbI9VIzWRu+N8h1g9I2JMdgXceQ2w9a/Oo6tf/EfgHBDz2KquCX5wAAAABJRU5ErkJggg=="
        },
        Chrome: {
            enable: true,
            name: "Chrome",
            path: "D:\\Cent Browser\\chrome.exe",
            image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADDUlEQVRIiaWWP2jcVhjAfzothoRyww0ebgohQyFrW8dSquBwelfOkKFT4uEgITiQIYVCxwpCuOikc+hQMmTwkKHQQil46OghLbSF4CFxAgmJkHTYJY59kuyczjmCMsjx+Y90vrQffOP7/d573/c+HgyJJY2iN8lsW2XeO8ujtorTVnE8lef+JPe9M9TbGuVhjMxY1hj3VO54Kh1fJTki+22VuysapZHgjoLmq6yNAN6XnkrHVfl6KNxVmfFV+h8L33uaoZIdwX+FDyQT1PaTDa3InH7y3wrHvLP8+n8lnsrf/gSnBwJTGNjVBYD253wxZLHvKyyOkt4ksyncrn5KS3+MJd5h6RcB/Enu74FuOgrGkkZxpC45FGblMrZIsEVCU/8dY7rU1ih7KrGvsvlCQUmvcalI063RdGsYr45/WB5vyDNbr+V6VsYbKNCq/LArsEWCXfkGwFEwHAUDgIYvMN0Oppfs5BoN9zxAHBVu9cJCkpXbUeFnsCpL+wViDUMrLmqMLWqMYSyPH4APJMZKaWWFUp6gF0pPoVl5dkCQYIvG7hU2/EsZ8DQbLy4BxIH0PEfQh5b++JDAEj6mfg4Ay53JFdz2LwJ0Q/nPLEEcSatg608zTpBgiV/S4i6Pc9vrH4Z7mxivjicJY71A6mQKAskBW5/PFNgioSG09Jq8WUx3dQB3HW55dYA3gXwlrwZxJD+AlqjnCizxD3PVL3dqcRLz5fVU1i4D9AJOdEP5jzzBVsB3YGjjWHqcK7F1B3PqQtYT2g75PreDIultP2Ji5zWLRr5g9zSrWPoitj4P0F2n3AulOL9FWRhsJR0XD4+U2CLBrl5NW7Nwd0j/P+lHnDkwMqYuYOn9IwQP0vGAkg8vJG8C+Ur2XGpVr2Hr65nwptig9VUtWeeTXshvmfCOFHUjvs2G70qmathiLaPY9wC2Xsv1THggdfJ3fjCM6RKW+GnPAOxgTJeiiFPbofzXvoEWSJvdoPBjN+Sz0eB7w6yWsfQbNEQdIO4UbsaR5MeB5PRCFnobzHbXh39b3gMjWp3Cjd87mAAAAABJRU5ErkJggg=="
        },
        Edge: {
            enable: true,
            name: "Edge",
            path: "microsoft-edge",
            image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACGUlEQVRIibVWr28TcRR/4kQX2vW+7yoQiMoJBAKBqKhATCD4ExATkxMENfFNJknWZL33vkGQCgQJE4glTCAqJiYqlqwp1/u+bzKxBASiAlExUQS90vau15aVT/Lc+34+7/cdwBIoimuK7Ftke6lIBopkgMZ10NhTDOO90ru4sowjEz7HLxW7G2QZLbGhH8rB6szUKwZsz1YgnrGA7dnybKhXVOQu1iWfmLG3leP+08VlMdLMeqjY/vRZ2mhcS5GcI8mPxSKuA1p7afJGVJ+LJkJ2R4riWspZay8g+wpZhlkiZe7vpwVY2sgyUmTvsBlp0NoDrT0/lIPMiACgzP39zIxJBjP92DqRR2PyK5/sk6QfyO4rsm3ktQ2Nvc1semgPJ05BaA8VuQugXhEA4AH1HqJxHWQZbZ/IszyBgOIPCxp+OuXkTEIOAOCTfJ44ktv1G1F9kSmS8+zBkO7fMKbIFcW1fx7TOctMOWn2fxGovOmX0LjvmxKovO+XZgRKzXhnU+TIMkyXZ37ZWEZV3S7kTdFaKJpvj1Np5t2WdVHV7UJ63NzHjQkAACiWbtbSrFKqqm4XlIle5DqNj1jGfbFX2LSvJ6ckgdZewPY5GtdCsr8Wzn+CMl8rxfLlXvN//GkrVwTJ7Sqydxvd4Hn4jaie+2G5rwDA+KqyvVxnuZDd0coC0yVD41qKpavY3Uzbn18Y18Iw3ps+mgl+A9E4JERQR7sXAAAAAElFTkSuQmCC"
        },
        Opera: {
            enable: false,
            name: "Opera",
            path: "",
            image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACbklEQVRIibVWMWhUQRAd+X9mP5oixAi5u53ZHxDEzkIbEQSJ0XQqiBYqFhYWohYWVjbW1mmEYKOghcUVdl6RRgh46t393c2JKSKkSCEaYpAosUi8mNzuT5p82O7Ne/NmZ+YvQMnXzLPcGrzjhepOyFrGJSe4YoXmHKvptqj73SHQZRxRYs84ZRlXndBa2bGMq55xqpln+a7IvcApx2qxj4zVoheqe6G6FVroF8NvhWRjpeSdSno+lLXVaaORw+A/XCOHQavTRshNwcmFILkdgdNe8H0wc60mtuNbkp51TF8DZSvanJ7rE3CGXodq7A2+iDkuWE0G70Wnja3ZV9NxK/gjfJHqXkzA15LrwaQYf7cqycXN2pv0SbRLqul4TGA2h2OxuILV5GYmTN0YsAMwEBMAAAh2nNCaY5oHAIDuEOiyPi8jBwCwQnOx2O4QaGgZOBkDeMafawD7Sh0I2ah7k52BQrKxvXLQZroKn7SaiAvg950EPGM7WoEqXQHPeKJkzyzvJOCEvsTiZyUbWx/7kqW2owDTfCy2twCdoTfRMo2qI1Hy4f1Vy7gcblM13QN2jHoQHZiSDekqeDwaV6PHPWAxCsZK+jYI1upuTKBTS24GyQ2+m63A0S3gtiQ3HOOfQMDLmEDB+CyYVA1vhy1r9TRi+fJ2rNXJJSv4q681DT7vAqigwMbaCEwmNv//JTbzLHeCzb62FlroHILDMcfrdc0PjFjGVmAmlizjjGWccYIrAZd21w+ADweh5iV96ISKsjWy3o702ev00UeTje6KfIsbgIGOpmtW6JXbeLZYxiXP1PVC9bZJbvkqDJdx/AXIjI6YTkGZ/AAAAABJRU5ErkJggg=="
        },
        FireFox: {
            enable: false,
            name: "FireFox",
            path: "",
            image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAFEUlEQVRIiY2VeUyTZxzHX0mWzYVJL6gwzDgqDMvYFo1RtzjQ6jbjCAmloPVAe5e2+pbSQsGBB+dEzZhXaR1UcKIUOqiiRXe4P83iDgleCK5Mndpx2NoplO/+qKsCtfNJfv+8yfv5PL/jeR6CCLayToRS82w5dNJ2NFJz6koE2fmQTnY8ZpK2fjrZ0clQdEpnCi3RQRkBV9E5OoW0krGFXdfpWzsRLFL0J5xR+daaUKV1XlDmpdwYym1xFINBfrvgzXybhb61E3TSBoamC+FaOyJ03YgoPOcLXTfCtXYwNF1IVJhxuo6PA7XkHVnB9jyUpb4WUNAvZpWdFS+TRaptg/+BI3Td2Ld9PS5UL0BMke2ZYErQBMfxc91qXDd8PPFTEafZWZ2yaJpgQMIa6dmY7OWqqiEkS5FfpMHlLxIAE4GvKnICgqn8RtA2NGGRaA8aSvlwNi/Hn0aOt69iydXvc2OeZXIvix06IEhAX24iHBKWP4bL6Bj6kvLCnYfnd4Gh6gSV34hD23Lx8OQyuK0cDJpWjD/Yu7DRL1DKtfxbormT4A4JC6O7qBitCMNRYSZUCj0yFLtfLFN34Z7ZJ3C3czB8NHXcLzBrNt+cCndIWHDXvIHR8jD08JLRk5MC+5olfiBD1QGa4DjCNWf831rK+XBbOfBYFsPVthxDpg/SiLb1KyOuSJInAglclWHw7KPC2VaBuw06ZG5r8E8RhWcEhWsAde3XiNDaEVF4DgplPtxWDh63sOGxLMbFuvSDRKv0EzIQ3CFhwVnMBEwELtdmIk733BRp7b7ar2v0SfgNYMjaUKkV+QVPjsXix/LPrhNNW7JPB4IPlzIwYQiBtz4EtTs3TKo3I68dFJ4RtA1NoHANoHANoG1sxv1mzlNBEsaaotBSwhsiDmlEl6bC7+si8Zc2Er+vScE8nQXv67+ZLJC3g5JV74dTuAZE5Rx42uBlGG9iwttIRTGp8BB25cq7gUrTm8NGrzQZqfr66VNTcBbh6i5Qsk1+QRy/Du72NHhOzgeOhODJEQqOiVeNEadUq/qmCu6oozEgTMCgLB6P6l5Hw84MFJWqcKbiQ9yqica1mjikFppAF7b4JftLsuGxLMJ4k69vj2rDYBBmegi5emfxtB7I4nFLNBc3Nr4NhywOTv1sOIuZeKBn4o56DvoL4lBVIvSVS2EFhWvAkyNUPDLPw9ihVwETgeEyOmSCLbcJlq6V3SdNCjhFNzclojeH7TsHvGT0ZCfjmCADb2lP+ctFl1rAyd3m2/XuUHgNIYCJwA1NPBJFRhNBEATxgyLt8YtG1SFhYZ9iE1aoD4Nd0DqtH8zsw/itPBYjO2iAkQBMBP7ZOxMHBOmgya1zCIIgiHKV6GAwgUPCgkWxGuvUVYjWdSGy0I7UAhPE5Hb8In0Xfxcz4aqaBZh8gl+LE1AtXvfgubsUM6zK1aP/J3FIWOiTJuGqlA2HhIU/5CyM7KBhwhACz96Z8B4Owdj+V2ATLYVZnJE/6brmaap418RJAa+MgKdcPxsTT+vtqpoFGGdgZAcNg7J47BJvuhjw0THmcUs65B+/lOS2IhauqlkY+jwcDmk87pJzcEacikrp5tagT2e6ujqtQ/mp62UzcUhYuCBcCIeEhT2q3Mqg8EnZKNeaz+ct9QYDD0gS0C1Ygv3irMF+Ucx7Lw1/fmmVGkWjgnvzZF66+zvZR+Pn5Uu99Sq+a7dqc79Rlm3ulb0zP9j//wKuxGyC6r7XUQAAAABJRU5ErkJggg=="
        },
 
        others: {
            enable: false,
            name: "",
            path: "",
            image: ""
        },
 
        all: {
            enable: true,
            name: "所有浏览器",
            image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVQ4T21TXUgUURT+zswuZZruTBRRFJHOvgRR0EMRCQkVQWUEai9WD+LWjtpDQfVQLRQYPUSFd0xSCMJ+pCIMC1+rh+itzMC964MIRRYzu2WitjsnZqZ1t637cOGce8937ved7xJKli5SawA0MfE+AJvAnAXoPYhfECsPbLNmsriEFgIxVaFR5i6AegIK+eBCo7cx4yII0uGqZpgrpr1ccPGmXKSF+C2BNpa+iMGvnCmjDgnKgpkiluxQiJrtLLajw5jzATQr2UOg1tJivyvQ7cSNePFZRCSPEWGbE4/GqFKkalTwGBGUUgAX6IWrXlZCuXL7uPGx+FyzkvdzrJwnTchOIpz9X/d8LsdoyJjGo3wcsVLtBD4NoJ90IYeZ2CZWvoD45D8aMEYc0yho0/NpiZadHgawFYRR0kXyiW1GDy3tGo+GFXfsj9qjv3LYqYa5VnHJdEyjLg+sCfmQyJ/KjD8FTcinjmkcRICcIaJQsXCRrmRtui36cgHAkhMErPVjxnefgm0ae7w4YqWOKuyeADANoueuqz5Ot62fKKali5Rnsn4CVAa/I3+ECt3Iq1zZO6mH5mY7mHABjHmALjlfqzuRIDcPpIvUdRDvYuAZRbrlZmJqdeI1XudgXZss0xfP+hyDl/IQcuo5p716pAAi+7KqciUwkkjeYsa9v7gKOUiE/fkCF6hPx41BL64ScrcKNNqm0RJYuYfDek7ehkJXFwwzwKr2LeVxbWLm144Z3RHoJA8Q8yknVLEXsVUzhU+T4JC2fPwMK+6PdHllH46s/KlbsgHAAAgJAG/gogUKPtjL5jvRuGHeH2Opccq6x1aXuephJncLQE1gZDzDABiaU8N3ZmLrPhfX/AYp2hIKQjp+9wAAAABJRU5ErkJggg=="
        }
    };
 
    if (window.OpenWithManager) {
        window.OpenWithManager.destroy();
        delete window.OpenWithManager;
    }
 
    function $(id) {
        return document.getElementById(id);
    }
 
    window.OpenWithManager = {
        useMenu: false,
        getTypeDesc: function (type) {
            switch (type) {
                case "page":
                    return "本页";
                case "link":
                    return "链接";
                //case "tab": return "标签";
                //case "bm": return "书签";
            }
            return "";
        },
        buildMenuName: function (label, type) {
            return "用 " + label + " 打开" + this.getTypeDesc(type);
        },
        attachNode: function (anchorNode, node) {
            if (this.useMenu) {
                anchorNode.appendChild(node);
            } else {
                anchorNode.parentNode.insertBefore(node, anchorNode);
            }
        },
        createMenuPopup: function (anchorNode, type) {
            let menu = document.createXULElement("menu");
            menu.setAttribute("label", MENU_NAME);
            menu.setAttribute("id", "openwith-menu-" + type);
            menu.setAttribute("class", "menu-iconic openwith-menu open-" + type);
            menu.setAttribute("image", browsers.all.image);
            anchorNode.parentNode.insertBefore(menu, anchorNode);
 
            let popup = document.createXULElement("menupopup");
            popup.id = "openwith-popup-" + type;
            menu.appendChild(popup);
            return popup;
        },
        createMenuItem: function (anchorNode, id, browser, type) {
            let menuitem = document.createXULElement("menuitem");
            menuitem.id = "openwith-m-" + type + "-" + id;
            menuitem.setAttribute("label", this.buildMenuName(browser.name, type));
            menuitem.setAttribute("oncommand", "OpenWithManager.openWithOtherBrowser(this,'" + id + "','" + type + "')");
            menuitem.setAttribute("class", "menuitem-iconic openwith-menuitem open-" + type);
            if (browser.image) {
                menuitem.setAttribute("image", browser.image);
            }
            this.attachNode(anchorNode, menuitem);
        },
        createBrowserMenu: function (anchorNode, type) {
            for (let key in browsers) {
                try {
                    if (browsers[key].enable) {
                        this.createMenuItem(anchorNode, key, browsers[key], type);
                    }
                } catch (e) {
                    alert(e.message);
                }
            }
        },
        //contentAreaContextMenu
        initContentAreaMenu: function () {
            var inspos = $("inspect-separator");
            let sep = document.createXULElement("menuseparator");
            sep.setAttribute("class", "openwith-menuitem");
            inspos.parentNode.insertBefore(sep, inspos);
            this.useMenu = USE_MENU_AREA;
 
            var anchorNode;
            if (this.useMenu) {
                anchorNode = this.createMenuPopup(inspos, "area");
            } else {
                anchorNode = inspos;
            }
            //链接部分
            this.createBrowserMenu(anchorNode, "link");
 
            let sepLink = document.createXULElement("menuseparator");
            sepLink.setAttribute("class", "open-link openwith-menuitem");
            this.attachNode(anchorNode, sepLink);
 
            //控制链接菜单的显示
            inspos.parentNode.addEventListener("popupshowing", this, false);
 
            //页面部分
            this.createBrowserMenu(anchorNode, "page");
        },
        //tabContextMenu
        initTabContextMenu: function () {
 
            var inspos = $("context_closeTabOptions") || $("context_closeOtherTabs") 
            let sep = document.createXULElement("menuseparator");
            sep.setAttribute("class", "openwith-menuitem");
            inspos.parentNode.insertBefore(sep, inspos.nextSibling);
 
            this.useMenu = USE_MENU_TAB;
 
            var anchorNode;
            if (this.useMenu) {
                anchorNode = this.createMenuPopup(sep.nextSibling, "tab");
            } else {
                anchorNode = sep.nextSibling;
            }
            this.createBrowserMenu(anchorNode, "tab");
 
        },
        //placesContext
        initPlacesContextMenu: function () {
 
            var inspos = $("placesContext_openSeparator");
            //let sep = document.createXULElement("menuseparator");
            //inspos.parentNode.insertBefore(sep, inspos);
 
            this.useMenu = USE_MENU_PLACE;
            var anchorNode;
            if (this.useMenu) {
                anchorNode = this.createMenuPopup(inspos, "place");
            } else {
                anchorNode = inspos;
            }
            this.createBrowserMenu(anchorNode, "place");
 
            //文件夹显示
            inspos.parentNode.addEventListener("popupshowing",this, false);
        },
        handleEvent: function (event) {
            if(event.target.id=="placesContext"){
                var isFloder = false;
                try {
                    let selectedNode = PlacesUIUtils.getViewForNode(event.target.ownerDocument.popupNode).selectedNode;
                    isFloder = !selectedNode || selectedNode.hasChildren;
                } catch (e) {
                }
                let menus = $("placesContext").querySelectorAll(".open-place");
                for (let menu of menus) {
                    if (isFloder) {
                        menu.hidden = true;
                    } else {
                        menu.hidden = false;
                        menu.disabled = false;
                    }
                }
            }
            if(event.target.id=="contentAreaContextMenu"){
                let menus = $("contentAreaContextMenu").querySelectorAll(".open-link");
                for (let menu of menus) {
                    if (gContextMenu.onLink) {
                        menu.hidden = false;
                    } else {
                        menu.hidden = true;
                    }
                }
            }
 
        },
        init: function () {
 
            //contentAreaContextMenu
            this.initContentAreaMenu();
 
            //tabContextMenu
            this.initTabContextMenu();
 
            //placesContext
            this.initPlacesContextMenu();
 
        },
        destroy:function () {
            $("contentAreaContextMenu").removeEventListener("popupshowing", this, false);
            $("placesContext_openSeparator").removeEventListener("popupshowing", this, false);
 
            let menus = document.querySelectorAll(".openwith-menu"),
                menuitems = document.querySelectorAll(".openwith-menuitem");
            for(let menuitem of menuitems){
                menuitem.parentNode.removeChild(menuitem);
            }
            for(let menu of menus){
                menu.parentNode.removeChild(menu);
            }
        },
        openWithBrowser: function (url, path) {
            if (!path) {
                alert("浏览器路径未设置 ");
                return;
            }
            if (path == "microsoft-edge") {
                //edge用url打开
                var cmdUrl = path + ":" + url;
                let win = window.openDialog(cmdUrl, "", "chrome");
                win.close();
                return;
            }
 
            let clientApp = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
            clientApp.initWithPath(path);
            if (!clientApp.exists()) {
                alert("浏览器路径错误: " + path);
                return;
            }
            try {
                let ss = Cc["@mozilla.org/browser/shell-service;1"]
                    .getService(Ci.nsIShellService);
                ss.openApplicationWithURI(clientApp, url);
            } catch (e) {
                let p = Cc["@mozilla.org/process/util;1"]
                    .createInstance(Ci.nsIProcess);
                p.init(clientApp);
                p.run(false, [url], 1);
            }
        },
        openWithOtherBrowser : function (obj, id, type) {
            var url;
            switch (type) {
                case "page":
                    url = gBrowser.currentURI.spec;
                    break;
                case "link":
                    url = gContextMenu.linkURL;
                    break;
                case "tab": {
                    let tab = document.popupNode && document.popupNode.localName == "tab" ? document.popupNode : null;
                    let bw = tab && tab.linkedBrowser;
                    url = bw && bw.documentURI.spec;
                }
                    break;
                case "place":
                    url = PlacesUIUtils.getViewForNode(document.popupNode).selectedNode.uri;
                    break;
            }
            if (url) {
                if (id == "all") {
                    for (let key in browsers) {
                        let browser = browsers[key];
                        if (browser.enable && key != "all" && browser.path) {
                            this.openWithBrowser(url, browser.path);
                        }
                    }
                } else {
                    let browser = browsers[id];
                    this.openWithBrowser(url, browser.path);
                }
            }
        }
 
    };
    OpenWithManager.init();
})();
lonely_8
狐狸大王
狐狸大王
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2019-11-07
  • 发帖数491
  • 经验254枚
  • 威望0点
  • 贡献值76点
  • 好评度77点
  • 社区居民
  • 忠实会员
2楼#
发布于:2019-06-01 23:50
主楼的脚本不完整没法判断哪里有问题。

1 楼的脚本
303行改成
let tab = TabContextMenu.contextTab;
333ywb
小狐狸
小狐狸
  • UID27284
  • 注册日期2008-12-03
  • 最后登录2019-11-08
  • 发帖数93
  • 经验102枚
  • 威望0点
  • 贡献值100点
  • 好评度0点
  • 社区居民
  • 忠实会员
3楼#
发布于:2019-06-02 00:00
lonely_8:主楼的脚本不完整没法判断哪里有问题。

1 楼的脚本
303行改成
let tab = TabContextMenu.contextTab;
回到原帖
1楼的脚本问题已经解决
主楼的就是那一段脚本有问题,失效了


完整的脚本如下:


//添加标签右键菜单项
new function () {
    var items = [
{
label : "关闭重复标签",
id:"context_CloseSameTab",
    image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAkUlEQVQ4jc3SPQrDMAwF4G/Kks1rT5MDhRwgB+vaHsFTltwlHaqCMXFTSCkVCMzTz3uSxT9ahxEZW3gOrDsqvmDFFQP68CGwNXKazCvmNwQzllZwDBYhOxWxFBjcMe01yCG1LEjVW+Tsqtg8561ZazV9oea7DU6P8OkSbxpLPP2NnDykUskUTK8lLoEdnvLv7QFhATCavYcOYgAAAABJRU5ErkJggg==",
oncommand : function () {
    var num = gBrowser.browsers.length;
    var msg = "";
    for (var i = 0; i < num; i++)
    {
        var a = gBrowser.getBrowserAtIndex(i);
        try
        {
            for (var j = 0; j < num; j++)
            {
                if (j != i)
                {
                    var b = gBrowser.getBrowserAtIndex(j);
                    if (a.currentURI.spec == b.currentURI.spec)
                    {
                        //gBrowser.alert(a.currentURI.spec);
                        if (msg != "")
                            msg += "\n";
                        msg += b.currentURI.spec;
                        gBrowser.removeTab(gBrowser.tabContainer.childNodes[j]);
                        num--;
                        j--;
                        //Not executing "i--" because there won't be tabs equal before the one on i
                    }
                }
            }
        }
        catch(e)
        {
            Components.utils.reportError(e);
        }
    }
    if (msg != ""){
        //alert("\u5173\u95ED\u7684\u91CD\u590D\u6807\u7B7E\u9875:\n\n" + msg);
        }
    else
        alert("\u6CA1\u6709\u91CD\u590D\u6807\u7B7E\u9875");
},
},{
    command:"context_closeTabsToTheEnd",
    image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOUlEQVQ4jWNgGGzgPxQPNwPyGBhyGRgY/kNp8lwAMySTgaGNGAPwYnwuoZoLsGqmKAyIBQNvwBAEAIkvKboNt20DAAAAAElFTkSuQmCC"
    },{
    command:"context_closeLeftTabs",
    image:"",
    },
    {
        label: "关闭左侧标签",
    id:"context_closeTabsToTheFirst",
        image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAABuAABpAAAAAACOszMyAAAAA3RSTlMAbYYu/vchAAAAH0lEQVQI12NABswHkIkSIMF0AUiw//8PYkHF0NWhAgAbAQzws7ptnwAAAABJRU5ErkJggg==",
        oncommand: function closeTabsToTheFirst() { for (let i = TabContextMenu.contextTab._tPos - 1; i >= 0; i--) if (!gBrowser.tabs<i>.pinned){ gBrowser.removeTab(gBrowser.tabs<i>, {animate: true});}}
},
{
        command:"context_closeOtherTabs",
    image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAATElEQVQ4jdXSQQrAMAhE0edxs0iOkWvbVQsFs2m7aD64cWQcRH5NkEFuYjDoQQ76yqCaAY1ZCVWC06Qxb40ndS18leCTG6zY7A/25QBZhDm3YCnePQAAAABJRU5ErkJggg==",
    },
{
        label: "关闭所有标签",
    id:"context_closeAllTabs",
        oncommand: "gBrowser.removeAllTabsBut(gBrowser.mCurrentTab); gBrowser.removeCurrentTab();",
    image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAP0lEQVQ4jWNgGHbgPwMDgz0eeXuoGoIKsBmCT46gQqI1Y9NAsmZ0Q8jSTLEBFHmBokCkOBqpkpAIAbJihHYAAKNEHEuIZ/qnAAAAAElFTkSuQmCC",
    },
  
    ];
    var menu = TabMenu({id:"context_CloseTab", onpopupshowing: syncHidden});
    menu(items);
};
  
  
new function () {
    var items = [
    {label:"复制当前标签【标题】",
    oncommand: function() {addMenu.copy(addMenu.convertText("%TITLE%"));},
    image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAXElEQVQ4jWNgGCzgPxZMSA2GJKkWEmXAfwYGBg9yDfBgYGCYCcXEWogCjjIwMChDaZIBssY8KCYJ5DGghjhJrlBmwPTjTKg4ToCsAVvAeaCJ0S8dkGQARUl54AAAWsMsNkwmkt8AAAAASUVORK5CYII="},
    {label:"复制当前标签【地址】",oncommand: function() {addMenu.copy(addMenu.convertText("%URL%"));},image:""},
    {label:"复制当前标签标题和地址",
    oncommand: function() {addMenu.copy(addMenu.convertText("%TITLE%\n%URL%"));},image:""},
    {label:"复制当前标签源代码",oncommand: function() {addMenu.copy(addMenu.convertText( '<a href="%URL%" target="_blank">%TITLES%</a>'));},image:""},
{},
{label:"复制所有标签标题",oncommand: function() {(function(){
                        var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
            var titles = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                titles += tab.label + "\n";
            });
            gClipboardHelper.copyString(titles);   
    })();},image:""},
        {label:"复制所有标签地址",oncommand: function() {(function(){
            var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
            var URLs = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                var url = gBrowser.getBrowserForTab(tab).currentURI.spec;
                URLs += url + "\n";
            });
            gClipboardHelper.copyString(URLs);      
    })();},image:""},
        {label:"复制所有标签标题和地址",oncommand: function() {(function() {
            var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
                                                var txt = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                 var url = gBrowser.getBrowserForTab(tab).currentURI.spec;
                txt += tab.label + "\n" + url + "\n";
            });
            gClipboardHelper.copyString(txt); 
        })();},image:""},
        {label:"复制所有标签HTML链接",oncommand: function() {(function() {
            var gClipboardHelper = Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper);
            var txt = "";
            Array.slice(gBrowser.tabContainer.childNodes).forEach(function(tab) {
                 var url = gBrowser.getBrowserForTab(tab).currentURI.spec;
                txt += "<a href=" + "\""+ url +"\" "+  "target=\"_blank\">" +  tab.label + "</a>"+ ""+ "\r";
            });
            gClipboardHelper.copyString(txt);  
        })();},image:""},
  
    {},
    {
        label:"复制 Favicon 的 URL",
        text:"%FAVICON%",
        image:" "
    }, {
        label:"复制 Favicon 的 Base64",
        text:"%FAVICON_BASE64%",
        image:" "
    }
    ];
    var menu = TabMenu({id:"context_TabInfoCopy",onpopupshowing: syncHidden});
    menu(items);
};
  
  
  
  
  
  
//复制链接文本地址
new function () {
    var items = [
    {
        label:"复制链接地址(A)",
        command:"context-copylink",
        image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFklEQVQ4T6XTvSuGURzG8c+zGxnIoCgbCyUGiUnJSylSDFIGmZWUEjbFaFCUmESUxcugsBhkpSz4FwwGnTp33Y/u57nVfbbz8vv+znWd65QUHKWC9f4DaMc2OvCGTRwnjfMAwzjEMg7Qi10sYS9AqgFGY9EIrlNSJ7GK1jxAExpwj3p8RUhbXKupBOjGJ95jwRzW0IifKGcIXVmAfpxiBicIxTvowyMSTwbivMyDQLxB0HiGBWxhEFcYw36c32W9wgPOsYG6KGEq3iicb0Ft0jkL8I1OvMTNxLgefKQ8Kcte+hlfsYKj1IngSZAzgYus1KYBszFl87jFNNYxjstKkf8bpGBgSFkznrCI52r/JS/KuX+tMOAX/9gzEZGy3OQAAAAASUVORK5CYII="
    },
    {
        label:"复制链接文本",
        text:"%LINK_TEXT%",
        image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA/0lEQVQ4T6XTsStFYRjH8c/9SzDJYJDFIAausitGBgOLwT/AYuCKQSmjhUERmxR/giiMymIUmQz06L11ei+9p+5bZzrP++37/H7nNHR5GpX7OxiqwfvAHD5jtgp4xi5uC5Br9CHmOwDzuCkAvkuAcaz9AblCE0VA1wY9WEgGF9jObIoGEU5vuvSKpwwQhtFCvKsV4gQ2U3BnaOGhDc1rzFsYxSmWECFOYj+F+Vt3CXCOExwistnAJabTGkXAPRaxh/cEiN2PMFjH4BiPaecRrGIZY/8ZvCGeOF9YwR0OkvoUZjCMl9xgFgOVyqLv9aQa30V/qnSrXWEOqPEjdo78AAIxShEhs/7CAAAAAElFTkSuQmCC"
    },
    {
        label:"复制链接文本+地址",
        text:"%LINK_TEXT%\n%l",
        image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAPklEQVQ4jWNgoCL4TyQWwGcAIQtgNFZDiDUAp1piDEDGBA3A6VdCBhAKRIIGEAOGqAuINoBiFwysAaRg6gAAE7tI6EZZDKkAAAAASUVORK5CYII="
    },
    {
    label: "复制链接源代码",
    tooltiptext: "左键:HTML代码\n中键:UBB代码\n右键:MD代码",
    onclick: function(event) {
        var formats = [
           '<a href="%l" target="_blank">%LINK_TEXT%</a>',
            "<a href="%RLINK_OR_URL%">%RLT_OR_UT%</a>",
            "[%RLT_OR_UT%](%RLINK_OR_URL%)",
        ];
        var str = addMenu.convertText(formats[event.button]);
        addMenu.copy(str);
        if (event.button === 1) { // 中键点击后自动关闭菜单
            document.getElementById("contentAreaContextMenu").hidePopup();
        }
    },
    image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEUAAAAAAABmZmbc3Ny3t7eRkZE6OjpRDxSxAAAAAXRSTlMAQObYZgAAADJJREFUCNdjwASCECDAIADhY2UwMQoKsgqAGUyMJiAGoyATYzJMhEEYxhDAoh1hBQYAAPxVA4qkxzcpAAAAAElFTkSuQmCC"
},
      
          
          
          
];
    var menu = PageMenu({ condition:'link', insertBefore:'context-openlink',icon:'image',   image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABdklEQVQ4T43TPUiXURTH8Y9pJSpFIEKamxAYhEO1ikOQFAlODTkIgr1gRQSlEA2CvUCUREWBEjQ4FYHoII7i4mpLU0VDRNbQC9WgceI88OchX+723Ht/33t+v3OeKltbO9CGarzB70JWtQX9cTzHnrz7Ew9wI0CbAU6neBUv8AsnEnYTI5sBDqAD77CQFezGMprRtB4g9g+hDq/xuWT1Ic7hWBkQ30O4gtYURfkvcQYruTeFU2VAiCfQjz94gm3owy7cwVV0YT470VJUUCmOFp3EXL4WlYzhPA5jBjtxGfcKwFk8wg90YwmjKfyaoEg/rGzHJAawFoB6fEQtOrGI+7iYoFk0YhA1eJwB/uMG4GiW+yz9x35TZhBWIodYa7iN4cqOBKAHr3A3068834v9GVj0/lt5cgOwD2/xHgfxPS8dQUva+LDeyBchjuMCvmAaDehNi9ey9P8yCkC05RYuVdz6hOt4utEPV57EeLk9RzdsxRRuuP4CTWBJwwkoqucAAAAASUVORK5CYII=",onpopupshowing: syncHidden });
    menu(items);
    items.forEach(function(it){
        if (it.command)
            css('#contentAreaContextMenu[addMenu~="link"] #' + it.command + '{ display: none !important; }')
    });
};
  
  
//图片
new function () {
    var items = [
    {command: 'context-saveimage',
     image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAnElEQVQ4jWNgGCzgAwMDw38S8XtkA/6TYel/bJwEqMn7GRgYBAgYsAGbAR8YGBgMoJIFBAxAkYcZcIGBgWE91BUOeDQvYMDhBQGoyQ5Ql2AzpABqEVYDYCCBAeKdD1A2DARAxQTwGQDTbADFFxgYGOZD2Q+gNIalyLGArAjmrQNQNQlY9GAYgCv6DND4eMOAGICih5yk/IEMS2kAABDmRWASmruSAAAAAElFTkSuQmCC"
    },
    {command: 'context-reloadimage'},
    {command: 'context-copyimage'},
    {
        label:"复制图片 Base64",
        text:"%IMAGE_BASE64%",
        image:" "
    },
    {command: 'context-copyimage-contents'},
    {command: 'context-viewimageinfo'},
  
    {},
        {
    label: "以图识图",
    tooltiptext: "谷歌/百度/搜狗/tineye",
    condition: "image",
    image: " ",
    oncommand: function() {
        var url = encodeURIComponent(gContextMenu.mediaURL || gContextMenu.imageURL || gContextMenu.bgImageURL);
        gBrowser.addTrustedTab('http://www.google.com/searchbyimage?image_url=' + url);
        gBrowser.addTrustedTab('http://image.baidu.com/pcdutu?queryImageUrl=' + url);
        gBrowser.addTrustedTab('http://pic.sogou.com/ris?query=' + url);
        gBrowser.addTrustedTab('http://www.tineye.com/search/?pluginver=firefox-1.0&sort=size&order=desc&url=' + url);
    }
},];
      
    var menu = PageMenu({ condition:'image', id:'context-copyimage_new',insertAfter:'context-viewimage', icon:'image',  image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAQCAYAAAAbBi9cAAABqUlEQVQ4T7WTO0gDQRCG/9lNULAQUQRBNF6SixYicuYKsRYrbWwELaKWqWxsLLQQH51Ya5HGUgVBBAtRRDT4KDUPLAw2FmKKJODdjlyCcD5OouBWy87MN49/luBx9JCZIHCb22xDDGcy5/nvQsgTFOyLg0ST214oyZVc7qzovGma0eYTctK528wbpIfMeS/Yt5lttQWBJhBNgShW9mFsUiRs8m9AYDUCiC4Qlt1x/wKavUtfrFZbna4ZAyTlSdlfqQF3RbNQ6hREi47NYkxks8mHTs3oVkLGCBxkxrEiK5HJXD9pmlEvBPVWEsurjyBL7bIUY45JFLH+Wms1SPLdArgH+ADAMIieX/Kl/ro6f+MH1VzD/tKaHoouEGH6Lp1sdbQJBAK1Nf7mJ4Dn2FaXnq19nlEkaK6w4N5UOjn4Pjs9bN6AsQNlH/4CFB1ioj1AxSB4n1mOCvAav6oeZ5eqBgEgPRidIYElgPxgLjDTeCp7sf2jal7yt7cbLT6f6CgW1c3j42XBadMTxOBDMJ1Wu0flD/3+RT7tUbWMr35lUCh69HdCJdJijr8BP9bKXB0KZjgAAAAASUVORK5CYII=",onpopupshowing: syncHidden});
    menu(items);
    items.forEach(function(it){
        if (it.command)
            css('#contentAreaContextMenu[addMenu~="image"] #' + it.command + '{ display: none !important; }')
    });
};
  
//快捷回复
new function(){
    var items = [
        {
        label: "当前日期 & 时间",
        condition: "input",
        position: 2,
        oncommand: function() {
            var localnow = new Date();
            var yy = localnow.getFullYear();
            var mm = localnow.getMonth()+1;
            if(mm < 10) mm = '0' + mm;
            var dd = localnow.getDate();
            if(dd < 10) dd = '0' + dd;
            var hh = localnow.getHours();
            if(hh < 10) hh = '0' + hh;
            var mi = localnow.getMinutes();
            if(mi < 10) mi = '0' + mi;
            var localnowstr = '【' + yy + '.' + mm + '.' + dd + ' & ' + hh + ':' + mi + '】';
            addMenu.copy(localnowstr);
            goDoCommand("cmd_paste");},
        image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADASURBVDhPtZPNCYQwEIVTi/V4yE0I5ObVElKBhdhAzmIDKcACUsfbvGEM7G4WNqz7YJifzPuMguYWWWv3EuiMXe0CgHMO2hrWrdBjOadH25sA8zx3xRtAy6/1H0DOGSEEjOOIdV3rAmvOYox11gSklMSoiziOA9u2YRgGyZyd5ym7TcAlgkoC88ttBMriI0AXqqkLoNerS9SyLPDeg9+ntHIrzpsAfVINgq7XYRBWsqgJ6NGTZ5qm7p+JHrX/ImMenDoO+LcxQdwAAAAASUVORK5CYII="
        },
        {label:"Outlook~~~",input_text: "xxxxxx@outlook.com",accesskey: "1",image:" "},
        {label:"Gmail~~~",input_text: "xxxxxx@gmail.com",accesskey: "2",image:" "},
        {label:"xxxxxx",input_text: "xxxxxx@outlook.com",accesskey: "3",image:" "},
        {},
        {label:"数字补丁.exe", input_text: "<font color="White">数字补丁.exe</font>",accesskey: "H",image:" "},
        {label:"谢谢你的解答~~~", input_text: "非常感谢您的解答!!!",accesskey: "T",image:" "},
        {label:"亲,要的就是~~~", input_text: "亲,要的就是这个,非常感谢!!!",accesskey: "D",image:" "},
        {label:"不用客气~~~", input_text: "不用客气,大家互相帮助……\n\u256E\uFF08\u256F\u25C7\u2570\uFF09\u256D",accesskey: "Y",image:" "},
        {label:"看起来很不错~~~", input_text: "看起来很不错哦,收藏备用~~~\n谢谢LZ啦!!!",accesskey: "G",image:" "},
        {label:"谢谢楼主分享~~~", input_text: "谢谢楼主的分享!这个绝对要顶!!!",accesskey: "F",image:" "},
        {label:"楼上正解~~~", input_text: "楼上正解……\u0285\uFF08\u00B4\u25D4\u0C6A\u25D4\uFF09\u0283",accesskey: "R",image:" "},
        {label:"坐等楼下解答~~~", input_text: "坐等楼下高手解答~~~⊙_⊙",accesskey: "V",image:" "},
        {},
        {label:"这个要支持~~~", input_text: "很好、很强大,这个一定得支持!!!",accesskey: "A",image:" "},
        {label:"不明真相的~~~", input_text: "不明真相的围观群众~~~\u0285\uFF08\u00B4\u25D4\u0C6A\u25D4\uFF09\u0283",accesskey: "S",image:" "},
        {label:"没图没真相~~~", input_text: "没图没真相,纯支持下了~~~",accesskey: "C",image:" "},
        {label:"不明觉厉~~~", input_text: "虽然不知道LZ在说什么但是感觉很厉害的样子\n\u2606\u002E\u3002\u002E\u003A\u002A\u0028\u563F\u00B4\u0414\uFF40\u563F\u0029\u002E\u3002\u002E\u003A\u002A\u2606",accesskey: "B",image:" "},
        {label:"嘿嘿~~~", input_text: "\u2606\u002E\u3002\u002E\u003A\u002A\u0028\u563F\u00B4\u0414\uFF40\u563F\u0029\u002E\u3002\u002E\u003A\u002A\u2606",accesskey: "X",image:" "}
    ];
    var menu = PageMenu({
        label:"快速回复...",
        condition:"input",
        accesskey: "W",
        position: 1,
        image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA7UlEQVQ4jbWS0Y2EMAxEUwIl8GlpXiSXQAlbwpVAB5RACZRACZRACSmBEvZ+nBPLaoGPPUuRosQez4yd0n+FmbU55wfQmVl7q8jdG2AAtjhLnA14AsNpR2AFFkl+/JfkkiZgfWMUnZec83jFEhgklSN6D8zu3tyRCswvcoA55/y4U5xSSmHuvGdQzKwNKWtFj05r5Pzpj7xtz2AFuvh4Sprqu6Ti7k0AbGbWSvIKXCmNnwzc+1LvwPCSHyPcgO5Kf4yzvI0a6CrFM/MklY+GB3If2zhI+pHU55zHsyU7ApQdwFRnXk2+1Hd3mb4WvyyoZJEMizeNAAAAAElFTkSuQmCC",
        oncommand: function(event){
            var input_text = event.target.getAttribute('input_text');
            if(input_text) {
                addMenu.copy(input_text);
                goDoCommand("cmd_paste");
            }
        }
    });
    menu(items);
};
  
  
  
//隐藏相同项。必须,不能删除
function syncHidden(event) {
    Array.slice(event.target.children).forEach(function(elem){
        var command = elem.getAttribute('command');
        if (!command) return;
        var original = document.getElementById(command);
        if (!original) {
                elem.hidden = true;
                return;
        };
        elem.hidden = original.hidden;
        elem.collapsed = original.collapsed;
        elem.disabled = original.disabled;
    });
};</i></i>
333ywb
小狐狸
小狐狸
  • UID27284
  • 注册日期2008-12-03
  • 最后登录2019-11-08
  • 发帖数93
  • 经验102枚
  • 威望0点
  • 贡献值100点
  • 好评度0点
  • 社区居民
  • 忠实会员
4楼#
发布于:2019-06-02 00:17
addMenuPlus69.uc.rar


3楼脚本要工作是跟此附件里的脚本有关系,会不会是这个脚本的问题,
请大神@lonely_8 查验,以便处理,谢谢
lonely_8
狐狸大王
狐狸大王
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2019-11-07
  • 发帖数491
  • 经验254枚
  • 威望0点
  • 贡献值76点
  • 好评度77点
  • 社区居民
  • 忠实会员
5楼#
发布于:2019-06-02 12:56
333ywb:3楼脚本要工作是跟此附件里的脚本有关系,会不会是这个脚本的问题,
请大神@lonely_8 查验,以便处理,谢谢
回到原帖
这个脚本 867 行,跟 1 楼的脚本一样的改法。
333ywb
小狐狸
小狐狸
  • UID27284
  • 注册日期2008-12-03
  • 最后登录2019-11-08
  • 发帖数93
  • 经验102枚
  • 威望0点
  • 贡献值100点
  • 好评度0点
  • 社区居民
  • 忠实会员
6楼#
发布于:2019-06-02 13:17
lonely_8:这个脚本 867 行,跟 1 楼的脚本一样的改法。回到原帖
谢谢大神的再次帮助,主楼的脚本也正常工作了,谢谢
wenshanliren
小狐狸
小狐狸
  • UID28120
  • 注册日期2009-02-27
  • 最后登录2019-09-12
  • 发帖数39
  • 经验68枚
  • 威望0点
  • 贡献值52点
  • 好评度1点
  • 社区居民
7楼#
发布于:2019-06-10 20:54
lonely_8:主楼的脚本不完整没法判断哪里有问题。

1 楼的脚本
303行改成
let tab = TabContextMenu.contextTab;
回到原帖
 大大有空帮忙看下升级67.0.1后用的UC脚本新增按钮无效,UC使用参考的是https://github.com/Endor8/userChrome.js/tree/master/userChrome 上配置的UC
// 导航栏添加XX-net按钮
(function () {
    CustomizableUI.createWidget({
        id : "XX-net",
        label : "XX-net",
        tooltiptext : "XX-net",
        onClick : function (event) {
                var path ="D:\\Tools\\XX-Net\\start.vbs";   var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);file.initWithPath(path.replace(/^\./, Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("SysD", Components.interfaces.nsIFile).path));file.launch();
        }
    });
 
    var cssStr = '@-moz-document url("chrome://browser/content/browser.xul"){'
         + '#XX-net .toolbarbutton-icon {'
         + 'list-style-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAA6lBMVEUAAABCSpP/ywBTV5r/ygB5cKTsvRLbtB9maqX/4QBBSqL/ygBRV5+qj0v6xwTasR4pOKxNU5f/ygD/0wD/ygD/0gBCRoT/ygD/3wA3Q6ZkZaJSV5n/2gBITJJRVpc+RJEqPsJMUJP/zgBNUJOAdWr/ygBvc41QV4bltRVTU3//ywBWW5flthRHS39JTpNTVodvda1SVqB8gq8tOZmSgFr/3gD/ygBFS5ZKUJhGTJr/1ABITpX/2wD/zgAaML5LUZtDSZX/2AArO7EuPqhPVqJIUaBFTJ89Q5xASZlgXYR3bnDrwhD70gP/zABLwy68AAAANnRSTlMAg3RRJhgWBQT9+vjr4ODf3trUysXAtLOwq6imo52Wlo2MjIeEdnFuamdlX1ZSTUxANCkkGQ+gSVWCAAAAnElEQVQY002OVQ7CUBQFLy20xd3d3eE+qeO6/+0QaGje/M0kJzmwaAYCIRBYXnSnAiKDK70NQaTA9NMaQC3mMpJXYg6NaJBHRMULmzNh5ZGLGPyPxvRwf5k4AZ/W8emaNRBIGvzdE3wWRuNhyb7vuGnELZ35jxMcS5CySdpTNcsxuoctoaTxC0pH6n8fTAllcxCpEmKvxKB123X5Az3DE3nS1LPdAAAAAElFTkSuQmCC)'
         + '}}';
    var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
    var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
    sss.loadAndRegisterSheet(ios.newURI("data:text/css;base64," + btoa(cssStr), null, null), sss.USER_SHEET);
})();
 
// 三道杠添加重启按钮
(function()
{
    var quitBtn = document.getElementById("appMenu-quit-button");
    if (!quitBtn) return;
 
    var restartBtn = document.createElement("toolbarbutton");
    restartBtn.setAttribute("label", "\u91CD\u65B0\u542F\u52A8");
    restartBtn.setAttribute("class", "subviewbutton subviewbutton-iconic");
    restartBtn.setAttribute("id", "restart-button");
 
    restartBtn.addEventListener("command", function()
    {
        const APP_START = Components.classes['@mozilla.org/toolkit/app-startup;1']
            .getService(Components.interfaces.nsIAppStartup);
        APP_START.quit(APP_START.eRestart | APP_START.eAttemptQuit);
    }, false);
    quitBtn.parentNode.insertBefore(restartBtn, quitBtn);
})();
 
// 三道杠添加配置文件夹
(function()
{
    var customizeBtn = document.getElementById("appMenu-customize-button");
    if (!customizeBtn) return;
 
    var ChromeBtn = document.createElement("toolbarbutton");
    ChromeBtn.setAttribute("label", "\u914D\u7F6E\u6587\u4EF6\u5939");
    ChromeBtn.setAttribute("class", "subviewbutton subviewbutton-iconic");
    ChromeBtn.setAttribute("id", "Chrome-button");
 
    ChromeBtn.addEventListener("command", function()
    {
        var canvas = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("UChrm", Components.interfaces.nsIFile).reveal();
    }, false);
    customizeBtn.parentNode.insertBefore(ChromeBtn, customizeBtn);
})();
 
// 自动恢复地址栏地址显示
{if (location == "chrome://browser/content/browser.xul") {
    var ub = document.getElementById("urlbar");
    ub.addEventListener("blur", function () {
        this.handleRevert();
    }, false);
}
};
 
// 刷新按钮移动到地址栏
(function() {
    function moveReloadIntoURL() {
        try {
            var btn0 = document.getElementById("pageActionButton");
            var btn1 = document.getElementById("reload-button");
            if (!btn0 || !btn1) return;
 
            var btn = document.createElement("toolbarbutton");
            btn.style.margin = '0px';
            btn.setAttribute("id", "stop_reload_button");
            btn.setAttribute("class", btn1.getAttribute("class"));
 
            btn.addEventListener("command", function(e) {
                var btn = document.getElementById("reload-button");
                if (btn && btn.getAttribute('displaystop'))
                    BrowserStop();
                else
                    BrowserReload();
            }, false);
            btn0.parentNode.insertBefore(btn, btn0);
 
            btn1.addEventListener('DOMAttrModified', reloadBtnAttr);
            reloadBtnAttr(); btn1.parentNode.hidden = true;
        }catch(e){ alert(e) }
    }
 
    function reloadBtnAttr(e) {
        btn = document.getElementById("stop_reload_button");
        if (btn && (!e || e.attrName=='displaystop')) {
            var newVal = e ? e.newValue : document.getElementById(
                "reload-button").getAttribute('displaystop');
           if (newVal)
                btn.style.listStyleImage = "url('chrome://browser/skin/stop.svg')";
            else
                btn.style.listStyleImage = "url('chrome://browser/skin/reload.svg')";
        }
    }
 
    moveReloadIntoURL();
})();
 
// 右键地址栏刷新按钮强制刷新
    (function() {
        var UndoClosedTabs = document.getElementById('stop_reload_button');
        if (!UndoClosedTabs) return;
        UndoClosedTabs.addEventListener("click", function(event) {
            if (event.button == 2) {
                event.preventDefault();
                BrowserReloadSkipCache();
            }
        }, false);
    })();
lonely_8
狐狸大王
狐狸大王
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2019-11-07
  • 发帖数491
  • 经验254枚
  • 威望0点
  • 贡献值76点
  • 好评度77点
  • 社区居民
  • 忠实会员
8楼#
发布于:2019-06-10 23:54
wenshanliren:大大有空帮忙看下升级67.0.1后用的UC脚本新增按钮无效,UC使用参考的是https://github.com/Endor8/userChrome.js/tree/master/userChrome 上配置的UC
// 导航栏添加XX-...
回到原帖
我这测试没问题,
这个脚本添加的按钮默认在“定制”里,
如果不在,试试排除冲突。
wenshanliren
小狐狸
小狐狸
  • UID28120
  • 注册日期2009-02-27
  • 最后登录2019-09-12
  • 发帖数39
  • 经验68枚
  • 威望0点
  • 贡献值52点
  • 好评度1点
  • 社区居民
9楼#
发布于:2019-06-12 20:37
lonely_8:我这测试没问题,
这个脚本添加的按钮默认在“定制”里,
如果不在,试试排除冲突。
回到原帖
已解决,居然是JS文档的编码问题,前一个版本正常的
游客

返回顶部