ETH官方钱包

前往
大廳
主題

火狐UC腳本:AddMenuPlus規則-閱讀模式

—— | 2016-04-20 15:01:54 | 巴幣 0 | 人氣 258

火狐內建的是獨立的,小書籤(Bookmarklet)合併在一起,滑鼠左中右鍵切換。
本來是要把內建的合併在一起,但怎麼用就是不行。
//當前頁面
new function () {
    var items = [

{
        label: "閱讀模式",
        id: 'reader_mode',
        condition: "normal",
        insertAfter: "RIL_context_savePage",
        oncommand: function() {ReaderParent.toggleReaderMode(event);},
        image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACJUlEQVQ4jZXMTW/ScADH8X88aDIv+kK87A1oTLx6I5kHOdY3wNtQk0l4sNvIxjTLkLENKhAYDCYVWigwBmUtUBgPbRlsThpiYuLPgzqt4cAOn8v38CWaUl7SO9UXN3HeEam+XH6aTAbukUu1PviqSdOJLs/tiypNx7262Kpkn5B+ozRJMH5EAltzCQe2kIkHMeycDGpCeomcnRYMn3cVm7QTmyv/oGfz0g589L+HplTUGn/0nIx6NePsVECnnp+hMLP35SJG3Zp6kktZybBTMQT2AFwqAi4d/SUVQTmXgK6UocscNClnMmwWMP4z0JRj4yi2h3jogwmbYKA2i9AbPHSZMxk2hf8H+zhg/CazBtpvNxvIPDQph4HIYqQUcTWoY6LJuBicquVcwkq0dsXIHISQDAdMsodhqM0S9AaPgchCEeKYjtv4MR3h+0RHIx9TIz7aSs7Pqka9eIRq/hDVfOqaKKTRrLAQ+Ti46BZKyQCmoza+XXTR4KNgd91qxOuyknFPNPqNInqyYNKVCmgdZ3Cc3kc+to0aG8ZlV4TMhfF5141PO0418s5lJd169kpvFaErJRNVzqNZiEPMBCFmgpByYYhsCBzjQTa4AnaP7jFe+hnxeZxvd7zuUGCDZkw8rr/WXYzf47y2s+4Mbq/aX6657YtkzW5fpF+/eUQ76cfz2nA4HnpeuR84HI77ZHl5+Q5FUQs2m+3uvCiKWrBYLLcJIbd+AlNJDDwtGwHgAAAAAElFTkSuQmCC"
},{        
        label:"乾淨閱讀",
        tooltiptext: "左鍵:Clippablen中鍵:Instapapern右鍵:Readability",
        image:" data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAaVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnbPKNAAAAI3RSTlMA+O/0xi/p4ZeFUUEI49HMcGhGPigUDurVubi0qomBdFosGkgxKCAAAABlSURBVBjTrYvHDcQwEMS4ypJzvOjYf5GGXIP5ITAY8gxnl26XqZuyo3jlLAzqVUkLhfTw93PpAuwyYj75LaZRAM2X+gegbX8PxlBoC8GBirk/IEhd6QGS9m9ZAGxs5+xpW0ce4QLyDgO0EbBIEQAAAABJRU5ErkJggg==",
        onclick: function(e){
        switch(e.button){
        case 0:
        gBrowser.loadURI("javascript:(function(){x=document.createElement('SCRIPT');x.type='text/javascript';x.src='http://brettterpstra.com/share/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(x);y=document.createElement('LINK');y.rel='stylesheet';y.href='http://brettterpstra.com/share/readability.css?x='+(Math.random());y.type='text/css';y.media='screen';document.getElementsByTagName('head')[0].appendChild(y);})();");
        break;
        
        case 1:
        gBrowser.loadURI("javascript:function%20iptxt(){var%20d=document;try{if(!d.body)throw(0);window.location='http://www.instapaper.com/text?u='+encodeURIComponent(d.location.href);}catch(e){alert('Please%20wait%20until%20the%20page%20has%20loaded.');}}iptxt();void(0)");
        break;
        
        case 2:
        gBrowser.loadURI("javascript:(%28function%28%29%7Bwindow.baseUrl%3D%27http%3A//www.readability.com%27%3Bwindow.readabilityToken%3D%27%27%3Bvar%20s%3Ddocument.createElement%28%27script%27%29%3Bs.setAttribute%28%27type%27%2C%27text/javascript%27%29%3Bs.setAttribute%28%27charset%27%2C%27UTF-8%27%29%3Bs.setAttribute%28%27src%27%2CbaseUrl%2B%27/bookmarklet/read.js%27%29%3Bdocument.documentElement.appendChild%28s%29%3B%7D%29%28%29)");
        break;
        }
        },
        
},

];
    
var menu = PageMenu({
        label: "閱讀輔助工具",
        condition: 'normal',
        insertBefore: 'context-openlinkincurrent',
        image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAiklEQVQ4je3SIQ7CcAzF4Y8Fj5hBYpEkOBSXWIKY5VQoOAYaw8QMB9gJMBgcCLpkIeEPyQQInmn7fknzmpRvaxB1jhWWmIbXYI8jZi/YNgujwgVr5BijxBm7J5Z3WNUmuSVSJlmWgB/pv+AXFgw7/QYLTGJucHjH2gQ1Tigw8vi2IrxrgtV9L+ivO97LHdW2qVgKAAAAAElFTkSuQmCC"
        });
        menu(items);
};

創作回應

更多創作