А для "vlc.exe" %1 ---> такое написание не работает, как быть?
Например, для Daum PotPlayer'а так:
ищите в документации VLC параметры запуска командной строки и заменяйте "/add'" на нужную команду.
А еще как будет выглядеть команда для открытия адреса активной вкладки во внешней программе - в подмену этому:
Отсутствует
ищите в документации VLC параметры запуска командной строки и заменяйте "/add'" на нужную команду.
Все получилось, спасибо!
Отсутствует
Вот кнопка добавляющая к ссылкам подменю с прогами. LinkMenu. Тут мои проги, переделай на свои пути. это та кнопка сделанная некогда бритва_оккама , добавил иконку и иконки к прогам.
var icomnu = "data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg4OK04ODj/ODg4/zg4OK0AAAAAODg4rTg4OP84ODj/ODg4rQAAAAA4ODitODg4/zg4OP84ODitAAAAAAAAAAA8PDz/PDw8/zw8PP88PDz/AAAAADw8PP88PDz/PDw8/zw8PP8AAAAAPDw8/zw8PP88PDz/PDw8/wAAAAAAAAAAQEBA/0BAQP9AQED/QEBA/wAAAABAQED/QUFB/0FBQf9BQUH/AAAAAEFBQf9BQUH/QUFB/0FBQf8AAAAAAAAAAEVFRa1FRUX/RUVF/0VFRa0AAAAARUVFrUVFRf9FRUX/RUVFrQAAAABFRUWtRUVF/0VFRf9FRUWtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATk5OrU1NTf9NTU3/Tk5OrQAAAABOTk6tTU1N/01NTf9OTk6tAAAAAE5OTq1NTU3/TU1N/05OTq0AAAAAAAAAAFJSUv9SUlL/UlJS/1JSUv8AAAAAUlJS/1JSUv9SUlL/UlJS/wAAAABSUlL/U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W/70F8f/wov///uD////8/////v///////////////v////v///3X//Twlv/ZzUXx0M9PGAAAAAAAAAAA/7wAgv/YVv///dT////8//aaAP/2mgD////////////+9OP/+btU//7+9v/5+cT/3uJ+/8fSXocAAAAAAAAAAP+8AND/7Zf///7s/////v/2mgD/9poA///9+//70or/9p8M//aaAP/9/vD/+f3h/+Dwqf++1W3kt9h6AwAAAAD/vAD4//q4////+P//////9poA//aaAP/4qyr/9poA//aaAP/2mgD//P7v//j+7v/Z98H/t9p//67biEgAAAAA/7wA+P/6s/////j///////aaAP/2mgD/9poA//iyO//2mgD/9poA//n+8P/z/u7/1/za/7Himf+m3pWnAAAAAP68AdD+7o////7o/////v/2mgD/96ES//zYmf/9/vD/9poA//aaAP/0/u//7v7v/9396v+p7bn/n+Gh95nkrBH6vQiC+dlV///8xf////v/+b5c//325P/9/vH//P7w//aaAP/2mgD/7v7u/9n95v/U/e3/qvng9ZnjrNqT5bZo9cARFfDDHPH78JX//v3X//7+9//9/vH//P7x//n+8P/0/u//7v7u/+j+8f/i/vP/o/vk/5T76f+D9+U7jee+agAAAADpxCVT5s09/vHwlP/6+sn/+v3l//n+7//0/u//6f3q/9T85P/i/vL/4/73/7798v+B++7/dfvzhgAAAAAAAAAAAAAAANrLPVPT0E3w2+SF/97xqv/b+cf/2vzc/9796f+z+97/ovvj/7z98v/b/vr/hPv0/2z7+NoAAAAAAAAAAAAAAAAAAAAAy9FZFMLUZo261nTls9qD/67joP+o777/nPnd+o776P+B++//gfv0/4z8+v9m+/v/afv9MgAAAAAAAAAAAAAAAAAAAAAAAAAAsdqCA6rcjkqj35qqnOKl+JbksPuG89pddfv0jWz7+OBm+/z/aPv9/4D7/YYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJfksBKR5rpsjejBjYnpyAFm+/sBa/v9NoH7/YmT+/254B8AAMAPAACABwAAAAMAAAADAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAACAAQAAwAEAAOAAAAD4AAAA/wA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAA=="; var aria2ico = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABJUlEQVQ4y7WSPW7CQBBGn1GKpEiZ5A6QK6TlBFCmYalwhTZI7pb0sdzRuXLJBZCLNOlyECPRJoU/CckpWEfGgSIgRhppd37eftoZONOCY4k8z6vmvd/vB1zCjlKXy+WeguFweEEFaZreAZs6aIwJ0jTdU3Ag9mCM2VwBSOoB35PJ5LbOSvrzmjEmAFgsFl/AI/BeA7pAAZAkyRtg24AkSSognk6nL5KKNqAHrP15BtwDzy0BGTDzNWsPoFMDPJUoiipJI0krSXhfSRpFUVT5+kLSHqBbAwCcc1tJA9+YSxo457aN/ym86t0UrLVVS+5rHMfzZsBaOwdcq+6mA1CWZdtdGIa/gDAM52VZugN1OwXj8bg6cY+u6yl8AE//bP7Mskxnr/IPLt++0wEEu3MAAAAASUVORK5CYII="; (function openLinkAsMenu(){ const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var contextMenu = document.getElementById("contentAreaContextMenu"); var separator = document.getElementById("context-bookmarklink"); var eventTarget = null; var menu = document.createElementNS(kXULNS, "menu"); menu.id = "openLinkAsMenu"; menu.setAttribute("label", "Открыть в ..."); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", icomnu); menu.hidden = true; contextMenu.insertBefore(menu, document.getElementById("context-sep-open")); var menuPopup = document.createElementNS(kXULNS, "menupopup"); menu.appendChild(menuPopup); var lst = [ { label:"SMplayer", command:smplayOpen, image:smplayicon }, { label:"AIMP2 play", command:aimp2play, image:aimpicon }, { label:"Открыть в MxNitro (Blink)", command:mxNitroUrl, image:nitroico }, { label:"UmmyDownloader (ютуб)", command:ummyDownloader, image:ummyDlico }, { label:"Wget -x [Url download]", command:wgeturl, image:wgetico }, { label:"Wget -x -i [list download]", command:wgetlist, image:wgetico }, { label:"Aria2 download", command:aria2c, image:aria2ico }, { label:"DomainHosting View", command:domainHostView, image:domHVico } ]; for(var i = 0, m; m = lst[i]; i++){ var menuItem = document.createElementNS(kXULNS, "menuitem"); menuItem.setAttribute("label", m.label); menuItem.setAttribute("class", "menuitem-iconic"); // +1 menuItem.setAttribute("image", m.image); // +2 menuItem.setAttribute("type", "m.radio"); menuItem.addEventListener("command", m.command, false); menuItem.id = "context-Demo-Menu-" + m.label.toString(); menuPopup.appendChild(menuItem); } contextMenu.addEventListener("popupshowing", setMenuDisplay, false); function setMenuDisplay(aEvent) { document.getElementById("openLinkAsMenu").hidden = false; } function setMenuDisplay(aEvent) { if (gContextMenu.onLink) { document.getElementById("openLinkAsMenu").hidden = false; } else document.getElementById("openLinkAsMenu").hidden = true; } //------------------------ function smplayOpen(){ var urllink=gContextMenu.linkURL var pleerpath="C:\\0l0\\MyPROG\\FM\\TC\\SOFT\\MEDIA\\SMplayer\\smplayer.exe" startProcess(pleerpath,[urllink]); function startProcess(path, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("URL не найден", path); }; } //----------------------------------------------------------------------------- function aimp2play(){ var urllink=gContextMenu.linkURL var pleerpath="C:\\0l0\\TC\\SOFT\\MEDIA\\AIMP\\AIMP2.exe" startProcess(pleerpath,[urllink]); function startProcess(path, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("URL не найден", path); }; } // --------------------------------------------------------------------------------- function wgeturl(){ var urllink=gContextMenu.linkURL var wget= "c:\\Program Files\\UnixUtils\\bin\\wget.exe" var param="-с -nc" // alert(pleerpath); startProcess(wget,param,[urllink]); function startProcess(path, param, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("URL не найден", path); }; } //-------------------------------------------------------------------------------- function wgetlist(){ var urllink=gContextMenu.linkURL var pleerpath="c:\\Program Files\\UnixUtils\\bin\\wget.exe" var param="-xc -B -i" startProcess(pleerpath,param,[urllink]); function startProcess(path, param, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("URL не найден", path); }; } // --------------------------------------------------------------------------------- function mxNitroUrl() { var url = gContextMenu.linkURL; var file= Components.classes["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsIProperties). get("ProfD", Components.interfaces.nsIFile); file.append("Soft"); file.append("MxNitro"); file.append("MxNitro.exe"); startProcess(file.path,[url]); function startProcess(path, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("Программа не найдена. Ошибка в пути ☭", file.path); }; } // --------------------------------------------------------------------------------- function ummyDownloader() { var url = gContextMenu.linkURL; var file= Components.classes["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsIProperties). get("ProfD", Components.interfaces.nsIFile); file.append("Soft"); file.append("UmmyVideoDownloader"); file.append("UmmyVideoDownloader.exe"); startProcess(file.path,[url]); function startProcess(path, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("Программа не найдена. Ошибка в пути ☭", file.path); }; } // -------------------------------------------------------------------------------------------------------- function aria2c() { var url = gContextMenu.linkURL; var file= Components.classes["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsIProperties). get("ProfD", Components.interfaces.nsIFile); file.append("Soft"); file.append("Tools"); file.append("aria2.exe"); startProcess(file.path,[url]); function startProcess(path, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("Программа не найдена. Ошибка в пути ☭", file.path); }; } // -------------------------------------------------------------------------------------------------------- function domainHostView() { var url = gContextMenu.linkURL; var file = Services.dirsvc.get('ProfD', Ci.nsIFile); file.initWithPath(file.path + "\\Soft\\Tools\\DomainHostingView.exe"); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init(file); process.run(false, ["/StartDomain", url], 2); } // --------------------------------------------------------------------------------------------- // ================ end ================================ })();
А все, разобрался:
function smplayOpen(){ var urllink=gContextMenu.linkURL var pleerpath="C:\\Program Files\\SMPlayer\\smplayer.exe" var param="-add-to-playlist" startProcess(pleerpath,[param,urllink]); function startProcess(path, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("URL не найден", path); }; }
Отредактировано fokanik (29-07-2015 19:13:59)
Отсутствует
fokanik
Поставьте кнопку Custom_Buttons/CB_Source_Editor at master · Infocatcher/Custom_Buttons · GitHub:
и со встроенным будет неплохо (цвета - в зависимости от значения devtools.theme (dark/light)).
Отсутствует
Поставьте кнопку Custom_Buttons/CB_Source_Editor at master · Infocatcher/Custom_Buttons · GitHub:
и со встроенным будет неплохо (цвета - в зависимости от значения devtools.theme (dark/light)).
Завтра испытаю, а на сегодня хватит - всем спасибо за помощь.
------------------------------------------------------------------------------------------------------------------------------------------------------
Супер, спасибо!
Отредактировано fokanik (30-07-2015 16:12:15)
Отсутствует
Объясните еще, чем отличается код от инициализации? Вот этот код, например, работает отдельно как в коде, так и в инициализации:
this.setAttribute("context", ""); this.onclick = e => { var tab = gBrowser.selectedTab, pinned = tab.pinned; if (pinned && !e.button) return; if (e.button == 2 && (e.ctrlKey || e.shiftKey)) { gShowPopup(this); return; } var tabs = gBrowser.visibleTabs.filter(tab => !tab.pinned); if (!pinned) { var index = tabs.indexOf(tab); switch(e.button) { case 0: tabs = tabs.slice(0, index); break; case 1: tabs.splice(index, 1); break; case 2: tabs = tabs.slice(index + 1); } } for(var tab of tabs) gBrowser.removeTab(tab, {animate: false, byMouse: false}); }
Отредактировано fokanik (30-07-2015 16:20:43)
Отсутствует
Подскажите пожалуйста : какой код требуется вставить в кнопку для обновления "URL автоматической настройки сервиса прокси" аналогично нажатию кнопки "обновить" в "параметрах соединения", как это сделано, допустим, в дополнении Reload PAC button ( https://addons.mozilla.org/ru/firefox/a … pac-button ) ?
Может:
Cu.import("resource://gre/modules/Services.jsm"); Cc["@mozilla.org/network/protocol-proxy-service;1"].getService().reloadPAC();
Добавлено 30-07-2015 20:42:24
А как запретить меню у кнопки, а то залезут ведь
Рестарт.
Отредактировано bunda1 (30-07-2015 20:42:24)
Отсутствует
Уже нашел.
Отсутствует
(()=> { var menuitem = document.createElement("menuitem"); var contextMenu = document.getElementById("contentAreaContextMenu"); menuitem.id = "open-in"; menuitem.setAttribute("label", "Отправить в Download Master"); //видимое название, меняйте на свое menuitem.setAttribute("class", "menuitem-iconic"); // иконка для пукта контекстного меню в base64, меняйте на свою --> menuitem.setAttribute("image", "data:image/ico;base64,AAABAAEAGDAAAAEAIACICQAAFgAAACgAAAAYAAAAMAAAAAEAIAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFZUAAEAAAAfAAEAHx03AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYlkAAQAVACs+LwCtAAMAgAAAAC0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAGoNDAL3/oCCzPjwAtgAAAIAAGwAWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAig0YAtf+vL7T/7lCx/8oxpyU0AL4AAAByAC0AHZh6BQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEFHAAhTNACe/5ogzP/YQb//xyj//9Q05/+9Ja4BHQC5AAAAYwAqABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALzoABjwsAIP9hBDe/9tBxf/JLPv/xyz//8cs///WMu7tnhOvAA0AswAAAFcKMQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAD//D////g////4H///8Af//+AH///AA///gAH//4AA/+EAAP+AAAH/gAAP/wAAB/8AAAf/AAAD/wAAA/8AAAP/AAAD/wAAA/8AAAP/AAAD/wAAA/+AAAf/gYAH///gD/8="); document.getElementById("context-sep-open").parentNode.insertBefore( menuitem, document.getElementById("context-sep-open") ); addEventListener("popupshowing", ()=> menuitem.hidden = !gContextMenu.onLink, false, contextMenu ); addDestructor( ()=> contextMenu.removeChild(menuitem) ); addEventListener("command", function(e) { if ( e.button ) return; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); file.initWithPath("C:\\Program Files\\Download Master\\dmaster.exe"); //путь замените на свой process.init(file); process.run(false, [gContextMenu.getLinkURL()], 1); }, false, menuitem ); })();
Помогите прикрутить кнопку в меню - по клику на пустом месте страницы (как в google transliate), а то здесь только при нажатии на ссылку появляется, а нужно ,чтоб и тут, и там появлялась.
Должно значит две кнопки в меню разных быть, одна будет выделенную ссылку передавать, а вторая (клик по пустому полю) передавать адрес страницы:
var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); file.initWithPath("C:\\Program Files\\SMPlayer\\smplayer.exe"); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init( file ); process.run( false, ["-add-to-playlist", window.content.location.href], 2); var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); file.initWithPath("C:\\Program Files\\SMPlayer\\smplayer.exe"); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init( file ); process.run( false, ["-add-to-playlist", gContextMenu.linkURL], 2);
Только вот как
Отредактировано fokanik (31-07-2015 16:30:22)
Отсутствует
Если послать xmlhttprequest то по полученным заголовкам можно узнать кое-что нужное - тип файла, размер и т. д.
А есть подобный способ узнать допустим размеры картинки в пикселях, не загружая саму картинку?
Отсутствует
fokanik
(()=> { var menuitem = document.createElement("menuitem"); var contextMenu = document.getElementById("contentAreaContextMenu"); menuitem.id = "open-in"; menuitem.setAttribute("label", "Отправить в Download Master"); //видимое название, меняйте на свое menuitem.setAttribute("class", "menuitem-iconic"); // иконка для пукта контекстного меню в base64, меняйте на свою --> menuitem.setAttribute("image", "data:image/ico;base64,AAABAAEAGDAAAAEAIACICQAAFgAAACgAAAAYAAAAMAAAAAEAIAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFZUAAEAAAAfAAEAHx03AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYlkAAQAVACs+LwCtAAMAgAAAAC0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAGoNDAL3/oCCzPjwAtgAAAIAAGwAWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAig0YAtf+vL7T/7lCx/8oxpyU0AL4AAAByAC0AHZh6BQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEFHAAhTNACe/5ogzP/YQb//xyj//9Q05/+9Ja4BHQC5AAAAYwAqABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALzoABjwsAIP9hBDe/9tBxf/JLPv/xyz//8cs///WMu7tnhOvAA0AswAAAFcKMQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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62njeqloIb/raKG/2p1b//H7fv/Knzt/2+0//96uv//fLr//329//+Ewf//iMb//4nH//+Oyv//b7D//zF87f8+ifb/TJP2xSpmra4AGDQRAAAAAAAAAAB/fWoxgHhi1Kylje6looj/qKCD/X2JhP3Z/f//MoDu/Xy6//19vf//gL///YbH//+Lx//9iMf//YnG//2W0f//fLf//SVw4f06g+n/RInmxR9Wm5YAGjceAAAAAAAAAACAfWs1fXhi2Kylie6loIT/pZ6B/ZiekP3o////W6D2/YbH//2Nyv//kM7//ZrT//+d1P/9oNj//aXZ//2v4///c7D//SRw2/1Wnfr/Zaz/xDJ1xLEAGDQaAAAAAAAAAACAfW0qb2hT1qijjveqpY3/rKOI/3x/cP/r////TJX1/3y9//+V0///ltH//5XR//+d0///otn//6fb//+q3v//Y6P9/z+L8/9Qlvj/RIvpxCBbo5UBGzcYAAAAAAAAAACDf2sea2hW0Lq/t/+/xsH/vb21/ZabkP3O6ej/b8z//XXO//288///xPj//cf6//+v5v/9quD//azj//216f//Zar//TqD4/5MkPD4UJXwsCdlsKABGzcWAAAAAAAAAACBgW0HVFFBnrW5sP/Hzsn/xszH/rWwnf6vydH/hLXw/xNZsv99ufv/uvP//ub////m///90////c////3t////i+n//Xze//4/htz3LGu11iVgpZ8AFS8EAAAAAAAAAAAAAAAAdXBeZXNrVPOBfGD3gHpe9ouAZvgyMiTpf5aex1Z3kDwva6qrS4jM9dT///9vo9v/NGun/2J/kf9TeJH/SW2R/0tqhv9oc33/VJjY/iVdllEAAAAAAAAAAAAAAAAAAAAAhoZ3FHByZlhrcmtia3NvYmt1cmR6iY1EAAAAAAAAAACQtdYFMWWeY1SY2L1JcqX/x6Jr/v/6ff3/4Vj//+FG/f/YKP96RADmAExqd2uVxA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+w2xQyQ0xo/4EA9/aNIP74hhX/+oYQ/f+EDf+GRgCDA0s/AwAAAAAAAAAAAAAAAAAAAAD//D////g////4H///8Af//+AH///AA///gAH//4AA/+EAAP+AAAH/gAAP/wAAB/8AAAf/AAAD/wAAA/8AAAP/AAAD/wAAA/8AAAP/AAAD/wAAA/+AAAf/gYAH///gD/8="); document.getElementById("context-sep-open").parentNode.insertBefore( menuitem, document.getElementById("context-sep-open") ); addEventListener("popupshowing", ()=> menuitem.hidden = !gContextMenu, false, contextMenu ); addDestructor( ()=> contextMenu.removeChild(menuitem) ); addEventListener("command", function(e) { if ( e.button ) return; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); file.initWithPath("C:\\Program Files\\Download Master\\dmaster.exe"); //путь замените на свой process.init(file); // Если меню вызвать на ссылке - в dm будет передана она. Иначе - адрес текущей страницы if (!gContextMenu.onLink) { process.run(false, [content.location.href], 1); } else { process.run(false, [gContextMenu.getLinkURL()], 1); }; }, false, menuitem ); })();
Отсутствует
turbot
Можно вместо:
использовать:
Отредактировано bunda1 (31-07-2015 20:57:18)
Отсутствует
bunda1 пишетmenuitem.onclick = function() { ........ };
Так ссылка вообще не хочет передаваться.
Ну да , нужно e в function()
((contextMenu)=> { var menuitem = contextMenu.insertBefore(document.createElement("menuitem"), document.getElementById("context-sep-open") ); menuitem.id = "open-in"; menuitem.setAttribute("label", "Отправить в Download Master"); //видимое название, меняйте на свое menuitem.setAttribute("class", "menuitem-iconic"); // иконка для пукта контекстного меню в base64, меняйте на свою --> menuitem.setAttribute("image", "data:image/ico;base64,AAABAAEAGDAAAAEAIACICQAAFgAAACgAAAAYAAAAMAAAAAEAIAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFZUAAEAAAAfAAEAHx03AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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A//9oAP//agD//38A//+LAP+iPADvfTwArcReAJvtehCiXUYAUAAAAAAAAAAAVlhRSEREObQ/QzzYPkQ82kNGP9svNjTGAAUifAAAJUUAACAkAAUtQAAaVH8DKlHJekk6/3c/L/18Pij/pUEG/d4/AP9eDQDhAAAATgAAAAAAAAAAAAAAAAAAAABqa2ACUE48l5WQd7qwrJXzqKKG/7Snhv8KEhr8RmJ96xM5XsIAIk6uGlGO2lGO0fesydj/ssnG/6PJ2f+Ewvj/VJPg/zpgmP8kQVj6ABISnAASIiIAAAAAAAAAAAAAAABta14dYFlJpbW1pZQ6OjL4hIh9/qKjmv2Am6L/eK/u/id12/9vre3/kdT//8fm8/+w1vD9m8fw/aPE3P29ysf/WJ3w/Sd9/f9Olv/fOXe/4wAOMl4AAAAAAAAAAAAAAABvb2Aob2pUqKqjibJ1cFv/lY53/X2Bd/211N7/NoHr/UGQ//2V1v//js7//YTH//93vP/9eLz//nq9//19wf//UZb7/S967f5Jk//uRojc0gAgR4UFGzQIAAAAAAAAAABycGMud3BZr6qjidyspY3/r6eI/Wt3cP211OX/N4Tt/Wut//14uf//d7f//Xy6//99vf/9gb///YTB//2Jx///Zqj//Shw3v4sdeD5OX/bvidiosIFGjIOAAAAAAAAAAB4d2gwgHpjw62njeqloIb/raKG/2p1b//H7fv/Knzt/2+0//96uv//fLr//329//+Ewf//iMb//4nH//+Oyv//b7D//zF87f8+ifb/TJP2xSpmra4AGDQRAAAAAAAAAAB/fWoxgHhi1Kylje6looj/qKCD/X2JhP3Z/f//MoDu/Xy6//19vf//gL///YbH//+Lx//9iMf//YnG//2W0f//fLf//SVw4f06g+n/RInmxR9Wm5YAGjceAAAAAAAAAACAfWs1fXhi2Kylie6loIT/pZ6B/ZiekP3o////W6D2/YbH//2Nyv//kM7//ZrT//+d1P/9oNj//aXZ//2v4///c7D//SRw2/1Wnfr/Zaz/xDJ1xLEAGDQaAAAAAAAAAACAfW0qb2hT1qijjveqpY3/rKOI/3x/cP/r////TJX1/3y9//+V0///ltH//5XR//+d0///otn//6fb//+q3v//Y6P9/z+L8/9Qlvj/RIvpxCBbo5UBGzcYAAAAAAAAAACDf2sea2hW0Lq/t/+/xsH/vb21/ZabkP3O6ej/b8z//XXO//288///xPj//cf6//+v5v/9quD//azj//216f//Zar//TqD4/5MkPD4UJXwsCdlsKABGzcWAAAAAAAAAACBgW0HVFFBnrW5sP/Hzsn/xszH/rWwnf6vydH/hLXw/xNZsv99ufv/uvP//ub////m///90////c////3t////i+n//Xze//4/htz3LGu11iVgpZ8AFS8EAAAAAAAAAAAAAAAAdXBeZXNrVPOBfGD3gHpe9ouAZvgyMiTpf5aex1Z3kDwva6qrS4jM9dT///9vo9v/NGun/2J/kf9TeJH/SW2R/0tqhv9oc33/VJjY/iVdllEAAAAAAAAAAAAAAAAAAAAAhoZ3FHByZlhrcmtia3NvYmt1cmR6iY1EAAAAAAAAAACQtdYFMWWeY1SY2L1JcqX/x6Jr/v/6ff3/4Vj//+FG/f/YKP96RADmAExqd2uVxA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+w2xQyQ0xo/4EA9/aNIP74hhX/+oYQ/f+EDf+GRgCDA0s/AwAAAAAAAAAAAAAAAAAAAAD//D////g////4H///8Af//+AH///AA///gAH//4AA/+EAAP+AAAH/gAAP/wAAB/8AAAf/AAAD/wAAA/8AAAP/AAAD/wAAA/8AAAP/AAAD/wAAA/+AAAf/gYAH///gD/8="); addEventListener("popupshowing", ()=> menuitem.hidden = !gContextMenu, false, contextMenu ); addDestructor( ()=> contextMenu.removeChild(menuitem) ); menuitem.onclick = function(e) { if ( e.button ) return; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); file.initWithPath("C:\\Program Files\\Download Master\\dmaster.exe"); //путь замените на свой process.init(file); // Если меню вызвать на ссылке - в dm будет передана она. Иначе - адрес текущей страницы !gContextMenu.onLink ? process.run(false, [content.location.href], 1) : process.run(false, [gContextMenu.getLinkURL()], 1); }; })(document.getElementById("contentAreaContextMenu"));
Отредактировано bunda1 (01-08-2015 00:15:08)
Отсутствует
А - е - это, что за знак, блин, да где справку-то брать? Тут эти кнопки на пяти языках разных что-ли пишутся - не пойму?
e это event смотри тут Объект события
Добавлено 31-07-2015 21:13:02
А такой справки нету и я тоже не смогу объяснить потому что медленно пишу на русском.
Отредактировано bunda1 (31-07-2015 21:13:02)
Отсутствует