Как можно отследить событие, когда закрывается выпадающий список подсказок в строке поиска браузера?
Это панель с id = PopupAutoComplete
Я прочитал что есть атрибут onpopuphiding. Но как его использовать для этой задачи, не знаю.
Пример:
addEventListener('popuphidden', (e, el = e.target)=> { alert(el.id); }, true, document.getElementById('PopupAutoComplete'));
Отсутствует
Есть такой код создающий подменю основного контекстного меню.
var this_=this; // иконки для меню var inssmicon="data:image/gif;base64,R0lGODlhEAAQAO4EAP/mIEA0EHFZHPriIP///4llEH1pMObCGPreIObGGPbWHO7y8u7y7vLWHOLi2v/iIO7KGObm3p2RbY1xFKqddcrGtpmFTKWZcdKhDHllLOa6FM7KvsqZDLaJDLKRFNalDPbaHMrGus7Kus6hDLqhGKWVZaGVcZ2NaeKyEJV5FKGRYb6dEOK2EHVhKObi3qV9DMKlGJ2NTJV9FLaRENqqDGlQEK6NFHFZGMKlFN6yEOLCGK6BCLKBCPLOGMaqFN6+FOrCFJ2NYap9CN62EJmNZZ2RaZF1EOa+FPLSGJWBSI1tEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAXIAEsAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAAHx4BLgoOEhYQLGxcGNwYmIguGERQpOAk9PysTFBGEDjEkDQIBAwECBx4WDoIMJTAgAQQEArEBpyoMSyEyDbABpb4EASxKFUtFPgi9v71AHSdLBgkDCbOysQIoCSMZSwIQAwAJvhC+CQhAHwLQOggA7u8AA0gHHNxFKwrt8AAIECg8z0KkMFfA3YMBIApowFCgGAMVHg4g8UVRw4cXQXAtcWDBhoYDBVoUyIHhRRJVgyJcmNBhBA0OOwpQcGEIkQQDNVqY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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkyAEEALAAAAAAQABAAAAe9gEGCg4SFhBAXJwY9BjYzhkEUEhk5FhVAHBoSFIQINT4HBQUMAwQCHR4Iggk3ODEKAQEAsQoCLSYJQRM7Bw8Av8ADMCkuJUEgOgPAyw+mIRFBBhayy8AEASgLQQoNBbHf4AIMCtEyBdW/BaYj2iAcBMrVAw0YJNATGQID8Q8FAxUOVmwwlsBEBwEHCMA70MABAxERcgVB4IGHAwEYBWBgIYKGqkEUTmgIgULFCBIbJPwwhOiDgRcLPkyAQCgQADs="; (function InsertSmileMenu(){ //--проверяем наличие меню перед созданием и если есть удаляем if (document.getElementById("InsertSmileMenu")){ var mi=document.getElementById("InsertSmileMenu") var mn=mi.parentNode mi.parentNode.removeChild(mi); } //-----------------создаём меню-------- const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var contextMenu = document.getElementById("contentAreaContextMenu"); var separator = document.getElementById("context-paste"); //указываем id элемента контекстного меню после которого появится наш пункт var eventTarget = null; var menu = document.createElementNS(kXULNS, "menu"); menu.id = "InsertSmileMenu"; menu.setAttribute("label", "Смайлы"); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", inssmicon); menu.hidden = false; contextMenu.insertBefore(menu, separator ); var menuPopup = document.createElementNS(kXULNS, "menupopup"); menu.appendChild(menuPopup); //--- создание подменю - не забываем что после последнего пункта,перед ] запятой НЕТ! var lst = [ { label:"smile", command:command1, image:icon01 }, { label:"biggrin", command:command2, image:icon02 }, { label:"rofl", command:command3, image:icon03 }, { label:"facepalm", command:command4, image:icon04 }, { label:"shok", command:command5, image:icon05 }, { label:"fool", command:command6, image:icon06 }, { label:"good", command:command7, image:icon07 }, { label:"negative", command:command8, image:icon08 }, { label:"scratch", command:command9, image:icon09 }, { label:"ok", command:command10, image:icon10 }, { label:"dash", command:command11, image:icon11 }, { label:"po rukam", command:command12, image:icon12 }, { label:"brag", command:command13, image:icon13 } ]; for(var i = 0, m; m = lst[i]; i++){ if (m.label=="separator"){ var menuItem = document.createElementNS(kXULNS, "menuseparator"); menuPopup.appendChild(menuItem); } else{ var menuItem = document.createElementNS(kXULNS, "menuitem"); menuItem.setAttribute("label", m.label); menuItem.setAttribute("class", "menuitem-iconic"); menuItem.setAttribute("image", m.image); menuItem.setAttribute("type", "m.radio"); menuItem.addEventListener("command", m.command, false); menuPopup.appendChild(menuItem); } } //-----------------------ниже два разных варианта вставки текста - проверь какой из них рабочий на новой лисе и используй его------------------------- //----------------------------------------------------- function command1(){ var text = "[img]http://www.kolobok.us/smiles/icq/smile.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command2(){ var text = "[img]http://www.kolobok.us/smiles/icq/biggrin.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command3(){ var text = "[img]http://www.kolobok.us/smiles/icq/rofl.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command4(){ var text = "[img]http://www.priorovod.ru/attachment.php?attachmentid=105228&d=1397160038[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command5(){ var text = "[img]http://www.kolobok.us/smiles/icq/shok.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command6(){ var text = "[img]http://www.kolobok.us/smiles/big_standart/fool.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command7(){ var text = "[img]http://www.kolobok.us/smiles/big_standart/good2.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command8(){ var text = "[img]http://www.kolobok.us/smiles/big_standart/negative.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command9(){ var text = "[img]http://www.kolobok.us/smiles/big_standart/scratch_one-s_head.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command10(){ var text = "[img]http://www.kolobok.us/smiles/big_standart/ok.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command11(){ var text = "[img]http://www.kolobok.us/smiles/big_madhouse/dash2.gif[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command12(){ var text = "[img]http://www.priorovod.ru/attachment.php?attachmentid=108361&d=1408373664[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //----------------------------------------------------- function command13(){ var text = "[img]http://www.priorovod.ru/attachment.php?attachmentid=108857&d=1410001749[/img]"; var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); if(controller && controller.isCommandEnabled(cmd)) { controller = controller.QueryInterface(Components.interfaces.nsICommandController); var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] .createInstance(Components.interfaces.nsICommandParams); params.setStringValue("state_data", text); controller.doCommandWithParams(cmd, params); } } //------------------------------------------------------ //------------------------------------------------------------------------- })();
Отсутствует
Есть такой код создающий подменю основного контекстного меню.
Проблема в том, что это подменю отображается везде, а надо чтобы только в текстовых полях. Как это можно сделать?
Ну а если так:
// Добавить подменю "Смайлики" в контекстном меню текстовых полей, от 06.09.2015. ............. ((contextMenu, paste)=> { var array = [ ["smile", "http://www.kolobok.us/smiles/icq/smile.gif", "data:image/gif;base64,R0lGODlhEAAQAO4EAP/mIEA0EHFZHPriIP///4llEH1pMObCGPreIObGGPbWHO7y8u7y7vLWHOLi2v/iIO7KGObm3p2RbY1xFKqddcrGtpmFTKWZcdKhDHllLOa6FM7KvsqZDLaJDLKRFNalDPbaHMrGus7Kus6hDLqhGKWVZaGVcZ2NaeKyEJV5FKGRYb6dEOK2EHVhKObi3qV9DMKlGJ2NTJV9FLaRENqqDGlQEK6NFHFZGMKlFN6yEOLC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ioUgyCIym6UjCYKkIqhoEAIfkEBRAAUgAsAgACAAkABgAAByGAUoJOLYKGTyIUFIIpUlBRKBwcho2RkoYVgpKXk4abhoEAOw=="], ["facepalm", "http://www.priorovod.ru/attachment.php?attachmentid=105228&d=1397160038", "data:image/gif;base64,R0lGODlhEAAQAO4CAP/mIEIQEP////bWHHNaGAAAAd6hAOrCFH1pMOLi2salGGVIBO7y8u7y7qWZccrGtvriIHllLObm3vreIObGGO7KGPLSGJR7EHFZHJ2RabaJDMqZDM6hDI1tEJ2RbaGRYcrGus7Kuua+FN62ENalDJmFTNKhDHFZGNahDJ2NYea6FObCFKWVZcaqFJmNZerGFJWBSLaREOLCGPreHN6yEOKyEL6dEJF1EHVhKGlQENqqDJV9FK6NFIllEJ2Naebi3ollDLKBCKV9DK6BCM7Kvqp9CKGVcf/iIJ2NTKqZcfLWHPLOGMKlGKqddfraHLaNELKRFPbaHN6+FI1xFJV5FLqhGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUOAFYAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAAHwYBWgoOEhYQMRA4IJwhGIQyGEk1UCgEBUpYKEoQJSFUKF5aiFwoJgg0sTFEEAqKWAgQfDVYgO0pHrAKturAdD1YZLRMAAASWAJYEBxo+VggUEMTS0gMHHBFWGBXR09QHJBjOMjPdxBAWIhvYGTYDwwAGCwULBhU1QS5WDzcU7gYFAAEaQAHkV4MPMVZYoDfAQoV4RVLMspKgBI8RB14cEEHDhBAYpgZJcNBBAwcdG4b0cPDDEIMQHiLkwOEBBKRBgQAAIfkEBQ4AVgAsAAABAA8ADwAAB7mAVoIMRA4IJwhGIQyCjRJNCgEBS5IKSRKNCUgKF5KeFwolCVYNLEwEAp6SAgRPHw0gO0qoAqm1rCMdDxktEwAEkgCSBAMHGj4IFBAAzM3MxRwRGBXLzs3FJBgIMjPWzBAWIhsRGTYDvgYLBQsGThU1QS4PNxQDBgX4+AYqKEAPDR9irGA3YICFdCSKpGhgJUEJHiMOvDgggoYJITBGCZLgoIMGDjo2DOnh4EejQSE8RMiBwwMIRoICAQAh+QQFDgBWACwAAAEADwAPAAAHuYBWggxEDggnCEYhDIKNEgoBARSRClNJEo0JCheRnRcKUCUJVg0sBAKdkQIEK08fDSA7pwKotKsWIx0PGS0TBJEAkQRHAwcaPggUEADMzczFHBEYFcvOzcUkGAgyM9bMEBYiGxEZNgMTBgsFCwZHThU1QS4PNxQGBfj4BksqKEAPDT7EYDegYDoVJIqkaGAlQQkeIw68OCCChgkhMEYJkuCggwYOOjYM6eHgR6NBITxEyIHDAwhGggIBACH5BAkOAFYALAAAAAAQABAAAAfCgFaCg4SFhAxEDggnCEYhDIYSTQoBAUuVCkkShAlICheVoRcKJQmCDSxMBAKhlQIETx8NViA7SqsCrLmvIx0PVhktEwAElQCVBAMHGj5WCBQQANLT0socEVYYFdHU08okGM4yM93SEBYiG9gZNgPDBgsFCwZOFTVBLlYPNxQDBgUAARpQgQLIrwYfYqyYN2CABXgkiqSYZSVBCR4jDrw4IIKGCSEwTA2S4KCDBg46Ngzp4eCHIQYhPETIgcMDCEiDAgEAOw=="], ["shok", "http://www.kolobok.us/smiles/icq/shok.gif", "data:image/gif;base64,R0lGODlhEAAQAO4BAP/mIP///31pMEA0EHllLPreIPbWHO7y8vriIOLi2p2RbXFZHO7y7v/iIPLWHObm3u7KGM7KvqWZcY1xFObCGJmFTMrGtubGGIllENalDM6hDN62EMqZDOa6FLKRFOrCFPLOGLaJDKGRYcKlGMrGuqWVZZ2NaaV9DJV5FK6NFOLCGNqqDKGVbWlQENKhDLqhGM7KutahDKqZcXFZGKqddeKyEJ2NYbaREJ2NTMaqFK6BCJV9FObi3rKBCKp9CJF1EJmNZea+FP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ZJlZgEAgAh+QQJGQBMACwAAAAADwAQAAAHv4ADA0yEhYaFBoMRDUE4IiJCEBMRhIkNBwkhJBwlLS4aBw1MiQdEFQQICBgEHCZIBwyCNBUKAgC3CAoPLBoXiSEEtre4FDIgPIkVDh7DtwIKHUM/iSsFy80AuhIqCQHe2Le6FgUBAuYB2AgEC0Un3eYCAQ4Fty8zHzs15eYEAQwOqigssGDDRzcCBHoEKECAQowFMDIcubAvXgEUHRZ8sJAhxYER3bzpAGFEggQgN3KEGjWIwQQIGwoU2CCJEpNAADs="], ["po rukam", "http://www.priorovod.ru/attachment.php?attachmentid=108361&d=1408373664", "data:image/gif;base64,R0lGODlhEAAQAJkBAGZOHv/SIP/OIAAAACH5BAkKAAMAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAACOZxvgKjrvFQbk1oQsHQ660dlnncAUqelDSpiGRPEsgAIbxkLuv5FuU56YGy0TYRiqihBpQSH+XQUAAA7"], ["brag", "http://www.priorovod.ru/attachment.php?attachmentid=108857&d=1410001749", "data:image/gif;base64,R0lGODlhEAAQAO4QAP/mIEA0EObCGPreIPbWHPriIH1pMPLWHOLi2u7y7nFZHHllLNalDO7KGOa6FP/iIO7y8p2NaaqddcrGuubm3vLOGObGGM7Kvt6yEJV5FI1xFIllEL6dELKRFJmFTJ2RbZ2RabaJDKV9DMqZDLKBCMrGtqGRYaWZcc6hDN62ENqqDNahDNKhDLaNEI1tEGlQEPLSGPbaHOLCGM7KupWBSJ2NTKGVbaWVZcKlGMKlFMaqFJV9FK6NFHFZGLqhGObi3t6+FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkyAEEALAAAAAAQABAAAAe9gEGCg4SFhBAXJwY9BjYzhkEUEhk5FhVAHBoSFIQINT4HBQUMAwQCHR4Iggk3ODEKAQEAsQoCLSYJQRM7Bw8Av8ADMCkuJUEgOgPAyw+mIRFBBhayy8AEASgLQQoNBbHf4AIMCtEyBdW/BaYj2iAcBMrVAw0YJNATGQID8Q8FAxUOVmwwlsBEBwEHCMA70MABAxERcgVB4IGHAwEYBWBgIYKGqkEUTmgIgULFCBIbJPwwhOiDgRcLPkyAQCgQADs="] ] var menu = contextMenu.insertBefore(document.createElement("menu"), paste); menu.setAttribute("label", "Смайлы"); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", array[0][2]); addEventListener("popupshowing", ()=> menu.hidden = paste.hidden, true, contextMenu); addDestructor(()=> contextMenu.removeChild(menu) ); var menuPopup = menu.appendChild( document.createElement("menupopup") ); array.forEach(function(m) { var mItem = menuPopup.appendChild(document.createElement("menuitem")); mItem.setAttribute("class", "menuitem-iconic"); mItem.setAttribute("image", m[2]); mItem.setAttribute("label", m[0]); mItem.value = m[1]; }); menuPopup.onclick =(e)=> { var cmd = "cmd_insertText"; var controller = document.commandDispatcher.getControllerForCommand(cmd); var controller = controller.QueryInterface(Ci.nsICommandController); var params = Cc["@mozilla.org/embedcomp/command-params;1"].createInstance(Ci.nsICommandParams); params.setStringValue("state_data", "[img]" + e.target.value + "[/img]"); controller.doCommandWithParams(cmd, params); }; })(document.getElementById("contentAreaContextMenu"), document.getElementById("context-paste"));
или так: 26-08-2015 22:03:08
или даже так: 30-03-2016 21:54:06
Отсутствует
hartumov пишетКак можно отследить событие, когда закрывается выпадающий список подсказок в строке поиска браузера?
Это панель с id = PopupAutoComplete
Я прочитал что есть атрибут onpopuphiding. Но как его использовать для этой задачи, не знаю.Пример:
Выделить кодКод:
addEventListener('popuphidden', (e, el = e.target)=> { alert(el.id); }, true, document.getElementById('PopupAutoComplete'));
Спасибо, bunda1.
А отчего это может быть. Если открыта эта панель id = PopupAutoComplete то щелчок ЛКМ в поисковой строке не вызывает событие onclick. Только после того как панель скроется, щелчок на том же месте уже даёт onclick.
Я пробовал
Отсутствует
bunda1
Спасибо. Вроде искал, но видимо плохо. Оставлю 06.09.2015, лучше один раз нормально настроить, чем постоянно на сплющенные смотреть. При каких условиях появляется второй столбец или как его добавить?
======
Еще интересует кнопка примерный аналог неработающих Add-on's (Firefox), Add-on's (Дополнения) и их вариации.
Только, хотелось бы меню с возможностью доступа к настройкам расширений, а не вкл/выкл. Например вот так это реализовано в кнопке "Расширения" (2-я из 3-х в Custom Button Maker на русском) от codefisher:
Отредактировано _zt (28-09-2016 19:12:34)
Отсутствует
Только, хотелось бы меню с возможностью доступа к настройкам расширений, а не вкл/выкл.
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%u0411%u044B%u0441%u0442%u0440%u044B%u0439%20%u0434%u043E%u0441%u0442%u0443%u043F%20%u043A%20%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0430%u043C%20%u0440%u0430%u0441%u0448%u0438%u0440%u0435%u043D%u0438%u0439%20%5BExtensions%20Options%20Menu%5D%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABVUlEQVQ4y2P4//8/AyWYoALpQsb9ftPM/4tnM+4nywCQ5s5jRf8d+7T+k2VAxHzH/TUHkv57TDMgzgWyJYz74xZ6/E9Y4vU/ZaXv/9Jd0f/LDkb+j13v8N9xmtp/oy6J/xqN/P+5Ihj2YzUApHnxtb7/My83/e8+W/C/9nj8//yD/v+T99j/D99u8N9nk/J/h9Vi/+Vq2P5jNQBkMz7NTuvE/1ut5v0vV8+M3QCQs3Fptlsh+l93Ktd/pTaW/wKpjAgDYFEFCjCQn3HZDNLME8tYANLDEcrgADcAFlWg0AYFGC5nK3ew/McaC6BEAopnUFSBQhubZpMVbP81JrFgdwEyBkUVup9BNoM0681hBdMYYYCMQfGMzc8gGqQZ5BIQxhkLoEQCimeQs0E2IcuB+CDNxkvZ/ktX4jAAlMJAiQRkA8iZML+CaBAfJA7SDOTvJyovEMIAruB4gKjNkYMAAAAASUVORK5CYII%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B/*%0A%20*%20%20This%20Source%20Code%20Form%20is%20subject%20to%20the%20terms%20of%20the%20Mozilla%20Public%0A%20*%20%20License%2C%20v.%202.0.%20If%20a%20copy%20of%20the%20MPL%20was%20not%20distributed%20with%20this%0A%20*%20%20file%2C%20You%20can%20obtain%20one%20at%20http%3A//mozilla.org/MPL/2.0/.%0A%20*/%0A%0Afunction%20%24%28aId%29%20%7B%0A%20%20return%20document.getElementById%28aId%29%3B%0A%7D%0A%0Afunction%20%24xml%28aXML%29%20%7B%0A%20%20return%20%28new%20DOMParser%29.parseFromString%28aXML%2C%20%22application/xml%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.documentElement%3B%0A%7D%0A%0Afunction%20sort%28aArray%29%20%7B%0A%20%20aArray.sort%28function%28a%2C%20b%29%20%7B%0A%20%20%20%20a%20%3D%20a.name.toLowerCase%28%29%3B%0A%20%20%20%20b%20%3D%20b.name.toLowerCase%28%29%3B%0A%20%20%20%20if%20%28a%20%3C%20b%29%20return%20-1%3B%0A%20%20%20%20if%20%28a%20%3E%20b%29%20return%201%3B%0A%20%20%20%20return%200%3B%0A%20%20%7D%29%0A%7D%0A%0Afunction%20openAM%28aView%29%20%7B%0A%20%20if%20%28%22toEM%22%20in%20window%29%20%7B%0A%20%20%20%20toEM%28aView%29%3B%0A%20%20%7D%20else%20if%20%28%22openAddonsMgr%22%20in%20window%29%20%7B%0A%20%20%20%20openAddonsMgr%28aView%29%3B%0A%20%20%7D%20else%20%7B%0A%20%20%20%20BrowserOpenAddonsMgr%28aView%29%3B%0A%20%20%7D%0A%7D%0A%0Athis.openOption%20%3D%20function%28aId%29%20%7B%0A%20%20AddonManager.getAddonByID%28aId%2C%20function%28aAddon%29%20%7B%0A%20%20%20%20if%20%28aAddon.optionsType%20%26%26%20%28parseInt%28aAddon.optionsType%29%20%3E%201%29%29%20%7B%0A%20%20%20%20%20%20switch%20%28parseInt%28aAddon.optionsType%29%29%20%7B%0A%20%20%20%20%20%20%20%20case%203%3A%0A%20%20%20%20%20%20%20%20%20%20switchToTabHavingURI%28aAddon.optionsURL%2C%20true%29%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%202%3A%0A%20%20%20%20%20%20%20%20%20%20openAM%28%22addons%3A//detail/%22%20+%20encodeURIComponent%28aAddon.id%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20+%20%22/preferences%22%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20openDialog%28aAddon.optionsURL%2C%20%22%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22chrome%2C%20dialog%2C%20close%2C%20minimizable%2C%20%22%20+%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22titlebar%2C%20toolbar%2C%20scrollbars%2C%20centerscreen%22%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%29%0A%7D%0A%0Athis.setStatus%20%3D%20function%28aString%29%20%7B%0A%20%20XULBrowserWindow.setOverLink%28aString%29%3B%0A%7D%0A%0Athis.onclick%20%3D%20function%20inspectExtensions%28aEvent%29%20%7B%0A%20%20switch%20%28aEvent.button%29%20%7B%0A%20%20%20%20case%200%3A%0A%20%20%20%20%20%20if%20%28aEvent.ctrlKey%29%20%7B%0A%20%20%20%20%20%20%20%20aEvent.preventDefault%28%29%3B%0A%20%20%20%20%20%20%20%20if%20%28typeof%20inspectObject%20%21%3D%20%22function%22%29%20return%3B%0A%20%20%20%20%20%20%20%20AddonManager.getAllAddons%28function%28aAddons%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20extensions%20%3D%20%5B%5D%3B%0A%20%20%20%20%20%20%20%20%20%20aAddons.forEach%28function%28aAddon%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28aAddon.type%20%3D%3D%20%22extension%22%20%26%26%20aAddon.isActive%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20extensions.push%28aAddon%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%29%0A%20%20%20%20%20%20%20%20%20%20sort%28extensions%29%3B%0A%20%20%20%20%20%20%20%20%20%20inspectObject%28extensions%29%3B%0A%20%20%20%20%20%20%20%20%7D%29%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20case%201%3A%0A%20%20%20%20%20%20var%20prefs%20%3D%20Services.prefs.getBranch%28%22custombuttons.searchAddons%22%20+%20%22.%22%29%3B%0A%20%20%20%20%20%20var%20text%20%3D%20%22%22%3B%0A%20%20%20%20%20%20try%20%7B%0A%20%20%20%20%20%20%20%20text%20%3D%20prefs.getCharPref%28%22search%22%29%3B%0A%20%20%20%20%20%20%7D%20catch%28ex%29%20%7B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20query%20%3D%20custombuttons.promptBox%28%22Search%20add-ons%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Enter%20add-on%20name%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%2C%20null%29%3B%0A%20%20%20%20%20%20if%20%28%21query%5B0%5D%29%20return%3B%0A%20%20%20%20%20%20prefs.setCharPref%28%22search%22%2C%20query%5B1%5D%29%3B%0A%20%20%20%20%20%20openAM%28%22addons%3A//search/%22%20+%20encodeURIComponent%28query%5B1%5D%29%29%3B%0A%0A%20%20%20%20default%3A%0A%20%20%7D%0A%7D%0A%0Athis.addonsMgr%20%3D%20function%28aPopup%2C%20aCallback%29%20%7B%0A%20%20AddonManager.getAllAddons%28function%28aAddons%29%20%7B%0A%20%20%20%20var%20extensions%20%3D%20%5B%5D%3B%0A%20%20%20%20aAddons.forEach%28function%28aAddon%29%20%7B%0A%20%20%20%20%20%20/*aAddon.toString%20%3D%20function%28%29%20%7B%0A%20%20%20%20%20%20%20%20%22use%20strict%22%3B%0A%20%20%20%20%20%20%20%20return%20this.name%3B%0A%20%20%20%20%20%20%7D*/%0A%20%20%20%20%20%20if%20%28%28aAddon.type%20%3D%3D%20%22extension%22%29%20%26%26%0A%20%20%20%20%20%20%20%20%20%20%28aAddon.optionsURL%20%21%3D%20null%29%20%26%26%0A%20%20%20%20%20%20%20%20%20%20aAddon.isActive%29%20%7B%0A%20%20%20%20%20%20%20%20extensions.push%28aAddon%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%29%0A%20%20%20%20sort%28extensions%29%3B%0A%20%20%20%20aCallback%28aPopup%2C%20extensions%29%3B%0A%20%20%7D%29%0A%7D%0A%0Afunction%20getExtensionObject%28aId%2C%20aCallback%29%20%7B%0A%20%20AddonManager.getAllAddons%28function%28aAddons%29%20%7B%0A%20%20%20%20aAddons.forEach%28function%28aAddon%29%20%7B%0A%20%20%20%20%20%20if%20%28aAddon.id%20%3D%3D%20aId%29%20%7B%0A%20%20%20%20%20%20%20%20aCallback%28aAddon%29%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%29%0A%20%20%7D%29%0A%7D%0A%0Afunction%20htmlEntities%28aString%29%20%7B%0A%20%20return%20aString.replace%28/%26/g%2C%20%22%26amp%3B%22%29.replace%28/%3C/g%2C%20%22%26lt%3B%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%28/%3E/g%2C%20%22%26gt%3B%22%29.replace%28/%22/g%2C%20%22%26quot%3B%22%29%3B%0A%7D%0A%0Afunction%20addItem%28aNode%2C%20aId%2C%20aLabel%2C%20aURL%2C%20aIcon%2C%20aHomePage%2C%20aDesc%29%20%7B%0A%20%20let%20mi%20%3D%20aNode.appendChild%28document.createElement%28%22menuitem%22%29%29%3B%0A%20%20%20%20%20%20mi.setAttribute%28%22GUID%22%2C%20aId%29%3B%0A%20%20%20%20%20%20mi.className%20%3D%20%22menuitem-iconic%22%3B%0A%20%20%20%20%20%20mi.setAttribute%28%22label%22%2C%20aLabel%29%3B%0A%20%20%20%20%20%20mi.statusText%20%3D%20aURL%3B%0A%20%20%20%20%20%20mi.setAttribute%28%22image%22%2C%20aIcon%29%3B%0A%20%20%20%20%20%20mi.setAttribute%28%22homepage%22%2C%20aHomePage%29%3B%0A%20%20%20%20%20%20mi.tooltipText%20%3D%20aDesc%3B%0A%7D%0A%0Athis.populate%20%3D%20function%28aPopup%2C%20aExtensions%29%20%7B%0A%20%20while%20%28aPopup.lastChild%29%20aPopup.removeChild%28aPopup.lastChild%29%3B%0A%20%20if%20%28%28navigator.platform%20%3D%3D%20%22Win32%22%29%20%26%26%20%28aExtensions.length%20%3E%2020%29%29%20%7B%0A%20%20%20%20var%20hbox%20%20%3D%20aPopup.appendChild%28document.createElement%28%22hbox%22%29%29%3B%0A%20%20%20%20var%20vbox1%20%3D%20hbox.appendChild%28document.createElement%28%22vbox%22%29%29%3B%0A%20%20%20%20var%20vbox2%20%3D%20hbox.appendChild%28document.createElement%28%22vbox%22%29%29%3B%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20aExtensions.length%3B%20i++%29%20%7B%0A%20%20%20%20%20%20let%20vbox%20%3D%20%28i%20%3C%20parseInt%28aExtensions.length%20/%202%29%29%20%3F%20vbox1%20%3A%20vbox2%3B%0A%20%20%20%20%20%20let%20ext%20%3D%20aExtensions%5Bi%5D%3B%0A%20%20%20%20%20%20addItem%28vbox%2C%20ext.id%2C%20ext.name%20+%20%22%20%22%20+%20ext.version%2C%20ext.optionsURL%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28ext.iconURL%20%3F%20ext.iconURL%20%3A%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric-16.png%22%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28ext.homepageURL%20%3F%20ext.homepageURL%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20ext.reviewURL%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3F%20ext.reviewURL.replace%28/%5C/reviews/%2C%20%22%22%29.toString%28%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20%22http%3A//www.google.com/search%3Fq%3D%22%20+%20ext.name%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext.description%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%20else%20%7B%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20aExtensions.length%3B%20i++%29%20%7B%0A%20%20%20%20%20%20let%20ext%20%3D%20aExtensions%5Bi%5D%3B%0A%20%20%20%20%20%20addItem%28aPopup%2C%20ext.id%2C%20ext.name%20+%20%22%20%22%20+%20ext.version%2C%20ext.optionsURL%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28ext.iconURL%20%3F%20ext.iconURL%20%3A%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric-16.png%22%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28ext.homepageURL%20%3F%20ext.homepageURL%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20ext.reviewURL%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3F%20ext.reviewURL.replace%28/%5C/reviews/%2C%20%22%22%29.toString%28%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20%22http%3A//www.google.com/search%3Fq%3D%22%20+%20ext.name%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ext.description%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A%0Avar%20popup%20%3D%20document.createElement%28%22menupopup%22%29%3B%0Apopup.setAttribute%28%22context%22%2C%20%22cb-extensions-menu%22%29%3B%0Apopup.setAttribute%28%22oncommand%22%2C%20%22event.stopPropagation%28%29%3B%20%22%20+%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22this.parentNode.openOption%28%22%20+%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22event.target.getAttribute%28%27GUID%27%29%29%3B%22%29%3B%0Apopup.setAttribute%28%22onmouseover%22%2C%20%22this.parentNode.setStatus%28%22%20+%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22event.target.statusText%29%3B%22%29%3B%0Apopup.setAttribute%28%22onmouseout%22%2C%20%22this.parentNode.setStatus%28%27%27%29%3B%22%29%3B%0Apopup.setAttribute%28%22onpopupshowing%22%2C%20%22this.parentNode.addonsMgr%28%22%20+%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22this%2C%20this.parentNode.populate%29%3B%22%29%3B%0A%0A//this.addonsMgr%28popup%2C%20this.populate%29%3B%0A%0Athis.appendChild%28popup%29%3B%0Athis.type%20%3D%20%22menu%22%3B%0A%0A//---------------------------------%0A%0Athis.copyId%20%3D%20function%28aId%29%20%7B%0A%20%20Cc%5B%22@mozilla.org/widget/clipboardhelper%3B1%22%5D.%0A%20%20getService%28Ci.nsIClipboardHelper%29.copyString%28aId%29%3B%0A%7D%0A%0Athis.goHome%20%3D%20function%28aURL%29%20%7B%0A%20%20gBrowser.loadOneTab%28aURL%29%3B%0A%7D%0A%0Athis.inspect%20%3D%20function%28aId%29%20%7B%0A%20%20getExtensionObject%28aId%2C%20inspectObject%29%3B%0A%7D%0A%0Athis.explore%20%3D%20function%28aId%29%20%7B%0A%20%20var%20dir%20%3D%20Services.dirsvc.get%28%22ProfD%22%2C%20Ci.nsIFile%29%3B%0A%20%20dir.append%28%22extensions%22%29%3B%0A%20%20dir.append%28aId%29%3B%0A%20%20var%20nsLocalFile%20%3D%20Components.Constructor%28%22@mozilla.org/file/local%3B1%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22nsILocalFile%22%2C%20%22initWithPath%22%29%3B%0A%20%20%28new%20nsLocalFile%28dir.path%20+%20%28dir.exists%28%29%20%3F%20%22%22%20%3A%20%22.xpi%22%29%29%29.reveal%28%29%3B%0A%7D%0A%0Aif%20%28%24%28%22cb-extensions-menu%22%29%29%20%7B%0A%20%20%24%28%22cb-extensions-menu%22%29.parentNode.removeChild%28%24%28%22cb-extensions-menu%22%29%29%3B%0A%7D%0A%0Athis.checkForDOMI%20%3D%20function%28aEvent%29%20%7B%0A%20%20if%20%28typeof%20inspectObject%20%21%3D%20%22function%22%29%20%7B%0A%20%20%20%20aEvent.target.getElementsByTagName%28%22menuitem%22%29%5B2%5D.hidden%20%3D%20true%3B%0A%20%20%7D%0A%7D%0A%0Avar%20popupset%20%3D%20document.getElementById%28%22mainPopupSet%22%29%3B%0Avar%20context%20%3D%20popupset.appendChild%28%24xml%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%3Cmenupopup%20xmlns%3D%22%27%20+%20xulns%20+%20%27%22%20id%3D%22cb-extensions-menu%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onclick%3D%22event.stopPropagation%28%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onpopupshowing%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.checkForDOMI%28event%29%3B%22%3E%3Cmenuitem%20label%3D%22Visit%20Home%20Page%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseover%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28document.popupNode.getAttribute%28%5C%27homepage%5C%27%29%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseout%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28%5C%27%5C%27%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27oncommand%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.goHome%28document.popupNode.getAttribute%28%5C%27homepage%5C%27%29%29%3B%22/%3E%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%3Cmenuitem%20label%3D%22Copy%20GUID%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseover%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28document.popupNode.getAttribute%28%5C%27GUID%5C%27%29%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseout%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28%5C%27%5C%27%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27oncommand%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.copyId%28document.popupNode.getAttribute%28%5C%27GUID%5C%27%29%29%3B%22/%3E%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%3Cmenuitem%20label%3D%22Inspect%20Extension%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseover%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28document.popupNode.getAttribute%28%5C%27GUID%5C%27%29%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseout%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28%5C%27%5C%27%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27oncommand%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.inspect%28document.popupNode.getAttribute%28%5C%27GUID%5C%27%29%29%3B%22/%3E%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%3Cmenuitem%20label%3D%22Browse%20Install%20Directory%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseover%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28document.popupNode.getAttribute%28%5C%27GUID%5C%27%29%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27onmouseout%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.setStatus%28%5C%27%5C%27%29%3B%22%20%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27oncommand%3D%22document.getElementById%28%5C%27%27%20+%20this.id%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%5C%27%29.explore%28document.popupNode.getAttribute%28%5C%27GUID%5C%27%29%29%3B%22/%3E%27%0A%20%20%20%20%20%20%20%20%20%20%20%20+%20%27%3C/menupopup%3E%27%29%29%3B%0A%0A%0A/*%0A//%20%u0441%u043A%u0440%u044B%u0442%u0438%u0435%20%u0434%u0440%u043E%u043F%u043C%u0430%u0440%u043A%u0435%u0440%u0430%20%u0443%20%u043A%u043D%u043E%u043F%u043A%u0438-%u043C%u0435%u043D%u044E%28%u0432%20%u0438%u043D%u0438%u0446%u0438%u0430%u043B%u0438%u0437%u0430%u0446%u0438%u044E%29%0Avar%20that%20%3D%20this%3B%0Athis.hideDropMarker%20%3D%20function%28%29%20%7B%0A%20%20var%20dropMarker%20%3D%20document.getAnonymousElementByAttribute%28that%2C%20%22class%22%2C%20%22toolbarbutton-menu-dropmarker%22%29%3B%0A%20%20if%20%28dropMarker%29%20%7B%0A%20%20%20%20dropMarker.setAttribute%28%22hidden%22%2C%20%22true%22%29%3B%0A%20%20%7D%20else%20%7B%0A%20%20%20%20setTimeout%28that.hideDropMarker%2C%2010%29%3B%0A%20%20%7D%0A%7D%0Athis.hideDropMarker%28%29%3B%0A*/%0A%0A//%20%u041F%u043E%u0434%u0441%u043A%u0430%u0437%u043A%u0430%20%u0434%u043B%u044F%20%u043A%u043D%u043E%u043F%u043A%u0438%20..........%20%0Athis.tooltipText%20%3D%20this.Help%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%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%u0411%u044B%u0441%u0442%u0440%u044B%u0439%20%u0434%u043E%u0441%u0442%u0443%u043F%20%u043A%20%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0430%u043C%20%u0440%u0430%u0441%u0448%u0438%u0440%u0435%u043D%u0438%u0439%20%u0443%20%u043A%u043E%u0442%u043E%u0440%u044B%u0445%20%u0435%u0441%u0442%u044C%20%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0438%0A---------------------------------------------------------------%0A%u041B%u041A%u041C%20-%20%u0432%u044B%u0437%u043E%u0432%u0435%u0442%20%u043E%u043A%u043D%u043E%20%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0438%20%u0440%u0430%u0441%u0448%u0438%u0440%u0435%u043D%u0438%u044F.%0A%u0421%u041A%u041C%20-%20%u043F%u043E%u0438%u0441%u043A%20%u0440%u0430%u0441%u0448%u0438%u0440%u0435%u043D%u0438%u0439.%0A%0A%0A%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E
Отсутствует
Uxapb, ну да, то что надо.
Просьба к знатокам, прикрутить сюда вызов окна дополнений, именно окна, по правой кнопке или СКМ, поиск можно вообще убрать. И будет просто идеально.
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function $(aId) { return document.getElementById(aId); } function $xml(aXML) { return (new DOMParser).parseFromString(aXML, "application/xml") .documentElement; } function sort(aArray) { aArray.sort(function(a, b) { a = a.name.toLowerCase(); b = b.name.toLowerCase(); if (a < b) return -1; if (a > b) return 1; return 0; }) } function openAM(aView) { if ("toEM" in window) { toEM(aView); } else if ("openAddonsMgr" in window) { openAddonsMgr(aView); } else { BrowserOpenAddonsMgr(aView); } } this.openOption = function(aId) { AddonManager.getAddonByID(aId, function(aAddon) { if (aAddon.optionsType && (parseInt(aAddon.optionsType) > 1)) { switch (parseInt(aAddon.optionsType)) { case 3: switchToTabHavingURI(aAddon.optionsURL, true); break; case 2: openAM("addons://detail/" + encodeURIComponent(aAddon.id) + "/preferences"); } } else { openDialog(aAddon.optionsURL, "", "chrome, dialog, close, minimizable, " + "titlebar, toolbar, scrollbars, centerscreen"); } }) } this.setStatus = function(aString) { XULBrowserWindow.setOverLink(aString); } this.onclick = function inspectExtensions(aEvent) { switch (aEvent.button) { case 0: if (aEvent.ctrlKey) { aEvent.preventDefault(); if (typeof inspectObject != "function") return; AddonManager.getAllAddons(function(aAddons) { var extensions = []; aAddons.forEach(function(aAddon) { if (aAddon.type == "extension" && aAddon.isActive) { extensions.push(aAddon); } }) sort(extensions); inspectObject(extensions); }) } break; case 1: var prefs = Services.prefs.getBranch("custombuttons.searchAddons" + "."); var text = ""; try { text = prefs.getCharPref("search"); } catch(ex) { } var query = custombuttons.promptBox("Search add-ons", "Enter add-on name", text, null); if (!query[0]) return; prefs.setCharPref("search", query[1]); openAM("addons://search/" + encodeURIComponent(query[1])); default: } } this.addonsMgr = function(aPopup, aCallback) { AddonManager.getAllAddons(function(aAddons) { var extensions = []; aAddons.forEach(function(aAddon) { /*aAddon.toString = function() { "use strict"; return this.name; }*/ if ((aAddon.type == "extension") && (aAddon.optionsURL != null) && aAddon.isActive) { extensions.push(aAddon); } }) sort(extensions); aCallback(aPopup, extensions); }) } function getExtensionObject(aId, aCallback) { AddonManager.getAllAddons(function(aAddons) { aAddons.forEach(function(aAddon) { if (aAddon.id == aId) { aCallback(aAddon); return; } }) }) } function htmlEntities(aString) { return aString.replace(/&/g, "&").replace(/</g, "<") .replace(/>/g, ">").replace(/"/g, """); } function addItem(aNode, aId, aLabel, aURL, aIcon, aHomePage, aDesc) { let mi = aNode.appendChild(document.createElement("menuitem")); mi.setAttribute("GUID", aId); mi.className = "menuitem-iconic"; mi.setAttribute("label", aLabel); mi.statusText = aURL; mi.setAttribute("image", aIcon); mi.setAttribute("homepage", aHomePage); mi.tooltipText = aDesc; } this.populate = function(aPopup, aExtensions) { while (aPopup.lastChild) aPopup.removeChild(aPopup.lastChild); if ((navigator.platform == "Win32") && (aExtensions.length > 20)) { var hbox = aPopup.appendChild(document.createElement("hbox")); var vbox1 = hbox.appendChild(document.createElement("vbox")); var vbox2 = hbox.appendChild(document.createElement("vbox")); for (var i = 0; i < aExtensions.length; i++) { let vbox = (i < parseInt(aExtensions.length / 2)) ? vbox1 : vbox2; let ext = aExtensions[i]; addItem(vbox, ext.id, ext.name + " " + ext.version, ext.optionsURL, (ext.iconURL ? ext.iconURL : "chrome://mozapps/skin/extensions/extensionGeneric-16.png"), (ext.homepageURL ? ext.homepageURL : ext.reviewURL ? ext.reviewURL.replace(/\/reviews/, "").toString() : "http://www.google.com/search?q=" + ext.name), ext.description); } } else { for (var i = 0; i < aExtensions.length; i++) { let ext = aExtensions[i]; addItem(aPopup, ext.id, ext.name + " " + ext.version, ext.optionsURL, (ext.iconURL ? ext.iconURL : "chrome://mozapps/skin/extensions/extensionGeneric-16.png"), (ext.homepageURL ? ext.homepageURL : ext.reviewURL ? ext.reviewURL.replace(/\/reviews/, "").toString() : "http://www.google.com/search?q=" + ext.name), ext.description); } } } var popup = document.createElement("menupopup"); popup.setAttribute("context", "cb-extensions-menu"); popup.setAttribute("oncommand", "event.stopPropagation(); " + "this.parentNode.openOption(" + "event.target.getAttribute('GUID'));"); popup.setAttribute("onmouseover", "this.parentNode.setStatus(" + "event.target.statusText);"); popup.setAttribute("onmouseout", "this.parentNode.setStatus('');"); popup.setAttribute("onpopupshowing", "this.parentNode.addonsMgr(" + "this, this.parentNode.populate);"); //this.addonsMgr(popup, this.populate); this.appendChild(popup); this.type = "menu"; //--------------------------------- this.copyId = function(aId) { Cc["@mozilla.org/widget/clipboardhelper;1"]. getService(Ci.nsIClipboardHelper).copyString(aId); } this.goHome = function(aURL) { gBrowser.loadOneTab(aURL); } this.inspect = function(aId) { getExtensionObject(aId, inspectObject); } this.explore = function(aId) { var dir = Services.dirsvc.get("ProfD", Ci.nsIFile); dir.append("extensions"); dir.append(aId); var nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", "nsILocalFile", "initWithPath"); (new nsLocalFile(dir.path + (dir.exists() ? "" : ".xpi"))).reveal(); } if ($("cb-extensions-menu")) { $("cb-extensions-menu").parentNode.removeChild($("cb-extensions-menu")); } this.checkForDOMI = function(aEvent) { if (typeof inspectObject != "function") { aEvent.target.getElementsByTagName("menuitem")[2].hidden = true; } } var popupset = document.getElementById("mainPopupSet"); var context = popupset.appendChild($xml( '<menupopup xmlns="' + xulns + '" id="cb-extensions-menu" ' + 'onclick="event.stopPropagation();" ' + 'onpopupshowing="document.getElementById(\'' + this.id + '\').checkForDOMI(event);"><menuitem label="Visit Home Page" ' + 'onmouseover="document.getElementById(\'' + this.id + '\').setStatus(document.popupNode.getAttribute(\'homepage\'));" ' + 'onmouseout="document.getElementById(\'' + this.id + '\').setStatus(\'\');" ' + 'oncommand="document.getElementById(\'' + this.id + '\').goHome(document.popupNode.getAttribute(\'homepage\'));"/>' + '<menuitem label="Copy GUID" ' + 'onmouseover="document.getElementById(\'' + this.id + '\').setStatus(document.popupNode.getAttribute(\'GUID\'));" ' + 'onmouseout="document.getElementById(\'' + this.id + '\').setStatus(\'\');" ' + 'oncommand="document.getElementById(\'' + this.id + '\').copyId(document.popupNode.getAttribute(\'GUID\'));"/>' + '<menuitem label="Inspect Extension" ' + 'onmouseover="document.getElementById(\'' + this.id + '\').setStatus(document.popupNode.getAttribute(\'GUID\'));" ' + 'onmouseout="document.getElementById(\'' + this.id + '\').setStatus(\'\');" ' + 'oncommand="document.getElementById(\'' + this.id + '\').inspect(document.popupNode.getAttribute(\'GUID\'));"/>' + '<menuitem label="Browse Install Directory" ' + 'onmouseover="document.getElementById(\'' + this.id + '\').setStatus(document.popupNode.getAttribute(\'GUID\'));" ' + 'onmouseout="document.getElementById(\'' + this.id + '\').setStatus(\'\');" ' + 'oncommand="document.getElementById(\'' + this.id + '\').explore(document.popupNode.getAttribute(\'GUID\'));"/>' + '</menupopup>')); /* // скрытие дропмаркера у кнопки-меню(в инициализацию) var that = this; this.hideDropMarker = function() { var dropMarker = document.getAnonymousElementByAttribute(that, "class", "toolbarbutton-menu-dropmarker"); if (dropMarker) { dropMarker.setAttribute("hidden", "true"); } else { setTimeout(that.hideDropMarker, 10); } } this.hideDropMarker(); */ // Подсказка для кнопки в "Справке" .......... this.tooltipText = this.Help
Отсутствует
Только, хотелось бы меню с возможностью доступа к настройкам расширений, а не вкл/выкл.
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%3EToggle%20Restartless%20Add-ons%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bchrome%3A//mozapps/skin/extensions/extensionGeneric-16.png%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//%20%28c%29%20Infocatcher%202013-2014%0A//%20version%200.1.2.1%20-%202014-02-21%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%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%200%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%20true%2C%0A%09//%20Close%20menu%20after%20left-click%20%28use%20Shift+click%20to%20invert%20this%20behavior%29%0A%09closeMenuClickToPlay%3A%20-1%0A%09//%20For%20click%20to%20play%20plugins%3A%0A%09//%20-1%20-%20invert%20Shift+click%20behavior%0A%09//%200%20%20-%20do%20nothing%20special%0A%09//%201%20%20-%20always%20don%27t%20close%20menu%0A%7D%3B%0A%0Avar%20mp%20%3D%20document.createElement%28%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%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.createElement%28%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%0A%09%09%09%09%7C%7C%20type%20%3D%3D%20%22plugin%22%20%20%20%20%26%26%20%22chrome%3A//mozapps/skin/plugins/pluginGeneric-16.png%22%0A%09%09%09%09%7C%7C%20type%20%3D%3D%20%22extension%22%20%26%26%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric-16.png%22%0A%09%09%09%09%7C%7C%20%22%22%3B%0A%09%09%09var%20mi%20%3D%20document.createElement%28%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%29%3B%0A%09%09%09var%20desc%20%3D%20addon.description%3B%0A%09%09%09desc%20%26%26%20mi.setAttribute%28%22tooltiptext%22%2C%20desc%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%20stayOpen%20%3D%20options.closeMenu%20%3F%20e.shiftKey%20%3A%20%21e.shiftKey%3B%0A%09%09if%28options.closeMenuClickToPlay%20%26%26%20isAskToActivateAddon%28addon%29%29%0A%09%09%09stayOpen%20%3D%20options.closeMenuClickToPlay%20%3D%3D%20-1%20%3F%20%21stayOpen%20%3A%20true%3B%0A%09%09mi.setAttribute%28%22closemenu%22%2C%20stayOpen%20%3F%20%22none%22%20%3A%20%22auto%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%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%20Application.prefs.getValue%28%22plugins.click_to_play%22%2C%20false%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%09addon.userDisabled%20%3D%20newDis%3B%0A%09var%20realDis%20%3D%20addon.userDisabled%3B%0A%09if%28realDis%20%21%3D%20newDis%29%20%7B%20//%20We%20can%27t%20enable%20vulnerable%20plugins%0A%09%09var%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%0A%09%09%09Components.utils.reportError%28err%29%3B%0A%09%09else%20%7B%0A%09%09%09LOG%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%09addon.userDisabled%20%3D%20newDis%3B%0A%09%09%7D%0A%09%7D%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%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%09if%28askToActivate%29%0A%09%09mi.classList.add%28%22toggleRestartlessAddons-askToActivate%22%29%3B%0A%09else%0A%09%09mi.classList.remove%28%22toggleRestartlessAddons-askToActivate%22%29%3B%0A%09if%28disabled%20%26%26%20%21askToActivate%29%0A%09%09mi.classList.add%28%22toggleRestartlessAddons-disabled%22%29%3B%0A%09else%0A%09%09mi.classList.remove%28%22toggleRestartlessAddons-disabled%22%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.some%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%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%20node.open%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%28this%20%3D%3D%20window%20%26%26%20%22mgGestureState%22%20in%20window%20%26%26%20%22endEvent%22%20in%20mgGestureState%29%20//%20Mouse%20Gestures%20Redox%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%09AddonManager.getAddonsByTypes%28addonTypes%2C%20function%28addons%29%20%7B%0A%09%09var%20restartless%20%3D%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%3B%0A%09%09%7D%29%3B%0A%09%09callback.call%28context%2C%20restartless%29%3B%0A%09%7D%29%3B%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%09Components.utils.import%28%22resource%3A//gre/modules/Services.jsm%22%29%3B%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%28addon.optionsType%20%3D%3D%20AddonManager.OPTIONS_TYPE_INLINE%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%09scrollToPreferences%20%3D%20scrollToPreferences%20%26%26%20parseFloat%28Services.appinfo.platformVersion%29%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-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%0A%0Afunction%20hasUpdater%28%29%20%7B%0A%09var%20has%20%3D%20checkForAddonsUpdates.toString%28%29.indexOf%28%22Services.jsm%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%0A//%3D%3D%20Check%20for%20Addons%20Updates%20end%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%09this.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
У кнопки есть отдельная тема, может и обновления есть.
Отредактировано foxboy (28-09-2016 20:26:56)
Отсутствует
А можно что-то сделать с кнопкой Открывать всё в новых вкладках, от 07.12.2013 ?
Она в прежних версиях ФФ кое-как работала, а сейчас при клике на любой ссылке в консоли ошибка "e.originalTarget is not defined".
Хотя ссылки в новых табах кнопка открывает.
Отсутствует
foxboy
Мне нужны настройки дополнений. Например, у меня 40 дополнений, 30 из них имеют настройки и лишь 10 являются Restartless, вот эти 10 и отображаются той кнопкой которую вы предлагаете. Мне же надо отображение всех 40 или 30 имеющих настройки. И еще:
...прикрутить сюда вызов окна дополнений, именно окна...
Этого тоже там нет, вообще все открывается во вкладках, в том числе и настройки дополнений у которых настройки доступны и отдельным окном и во вкладке. Это меня тоже не устраивает, надо чтобы в окне. В общем, в том виде в каком она есть, эта кнопка меня не интересует. А вот код который в моем сообщении выше, устраивает за одним исключением, это отсутствие возможности вызвать окно дополнений.
Отсутствует
...прикрутить сюда вызов окна дополнений, именно окна...
Читаем тему кнопки внимательно, пост 15, вот с уже закомментированной строкой. Показывает все дополнения.
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%3EToggle%20Restartless%20Add-ons%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bchrome%3A//mozapps/skin/extensions/extensionGeneric-16.png%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//%20%28c%29%20Infocatcher%202013-2016%0A//%20version%200.1.2.2%20-%202016-04-10%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%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%200%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%20true%2C%0A%09//%20Close%20menu%20after%20left-click%20%28use%20Shift+click%20to%20invert%20this%20behavior%29%0A%09closeMenuClickToPlay%3A%20-1%0A%09//%20Special%20handling%20for%20click%20to%20play%20plugins%3A%0A%09//%20-1%20-%20invert%20Shift+click%20behavior%0A%09//%200%20%20-%20do%20nothing%20special%20%28and%20use%20%22closeMenu%22%20option%29%0A%09//%201%20%20-%20always%20don%27t%20close%20menu%0A%7D%3B%0A%0Avar%20mp%20%3D%20document.createElement%28%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.createElement%28%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%0A%09%09%09%09%7C%7C%20type%20%3D%3D%20%22plugin%22%20%20%20%20%26%26%20%22chrome%3A//mozapps/skin/plugins/pluginGeneric-16.png%22%0A%09%09%09%09%7C%7C%20type%20%3D%3D%20%22extension%22%20%26%26%20%22chrome%3A//mozapps/skin/extensions/extensionGeneric-16.png%22%0A%09%09%09%09%7C%7C%20%22%22%3B%0A%09%09%09var%20mi%20%3D%20document.createElement%28%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%29%3B%0A%09%09%09var%20desc%20%3D%20addon.description%3B%0A%09%09%09desc%20%26%26%20mi.setAttribute%28%22tooltiptext%22%2C%20desc%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%20stayOpen%20%3D%20options.closeMenu%20%3F%20e.shiftKey%20%3A%20%21e.shiftKey%3B%0A%09%09if%28options.closeMenuClickToPlay%20%26%26%20isAskToActivateAddon%28addon%29%29%0A%09%09%09stayOpen%20%3D%20options.closeMenuClickToPlay%20%3D%3D%20-1%20%3F%20%21stayOpen%20%3A%20true%3B%0A%09%09mi.setAttribute%28%22closemenu%22%2C%20stayOpen%20%3F%20%22none%22%20%3A%20%22auto%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%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%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%09addon.userDisabled%20%3D%20newDis%3B%0A%09var%20realDis%20%3D%20addon.userDisabled%3B%0A%09if%28realDis%20%21%3D%20newDis%29%20%7B%20//%20We%20can%27t%20enable%20vulnerable%20plugins%0A%09%09var%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%09LOG%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%09LOG%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%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%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%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.some%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%26%26%20node.boxObject%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%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%28this%20%3D%3D%20window%20%26%26%20%22mgGestureState%22%20in%20window%20%26%26%20%22endEvent%22%20in%20mgGestureState%29%20//%20Mouse%20Gestures%20Redox%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%09AddonManager.getAddonsByTypes%28addonTypes%2C%20function%28addons%29%20%7B%0A%09%09var%20restartless%20%3D%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%3B%0A%09%09%7D%29%3B%0A%09%09callback.call%28context%2C%20restartless%29%3B%0A%09%7D%29%3B%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%09Components.utils.import%28%22resource%3A//gre/modules/Services.jsm%22%29%3B%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%28addon.optionsType%20%3D%3D%20AddonManager.OPTIONS_TYPE_INLINE%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%09scrollToPreferences%20%3D%20scrollToPreferences%20%26%26%20parseFloat%28Services.appinfo.platformVersion%29%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-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%0A%0Afunction%20hasUpdater%28%29%20%7B%0A%09var%20has%20%3D%20checkForAddonsUpdates.toString%28%29.indexOf%28%22Services.jsm%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%0A//%3D%3D%20Check%20for%20Addons%20Updates%20end%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%09this.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
Отредактировано foxboy (28-09-2016 23:46:28)
Отсутствует
foxboy
Читаем внимательно, что я пишу.
...прикрутить сюда вызов окна дополнений, именно окна...
Не страницы!
вообще все открывается во вкладках, в том числе и настройки дополнений у которых настройки доступны и отдельным окном и во вкладке. Это меня тоже не устраивает, надо чтобы в окне. В общем, в том виде в каком она есть, эта кнопка меня не интересует.
Toggle Restartless Add-ons
Минусы:
Показывает все расширения, а не только те у которых есть настройки.
Надо будет переназначить клавиши - ЛКМ для отключения дополнений мне не нужен, Shift+ЛКМ – тоже.
Нужно переделывать открытие настроек дополнений в окна, вместо теперешних вкладок и открытия окна дополнений, вместо страницы.
Extensions Options Menu
Минусы:
Нет возможности вызвать окно дополнений.
Вы можете переделать Toggle Restartless Add-ons так, что бы не было минусов? Или вы считаете, что это легче сделать, чем прикрутить открытие окна к Extensions Options Menu?
Отредактировано _zt (29-09-2016 00:57:07)
Отсутствует
Если возможность для любого юзер-агента постоянно добавлять какую-либо приписку? речь идет о " u01-04", которое убирает рекламу с юкоз сайтов. Постоянно менять свой юзер-агент накладно, а вот если бы она сама прибавлялась, то класс
Спасибо
Отсутствует
А отчего это может быть. Если открыта эта панель id = PopupAutoComplete то щелчок ЛКМ в поисковой строке не вызывает событие onclick. Только после того как панель скроется, щелчок на том же месте уже даёт onclick.
Я пробовал
У меня вроде работает:
document.addEventListener('click', function(e){ custombuttons.alertSlide("alert", e.target.id); })
Отсутствует
У меня вроде работает:
Выделить кодКод:
document.addEventListener('click', function(e){ custombuttons.alertSlide("alert", e.target.id); })
Нет, и со слайдером не работает. Пока не закроется выпадающий список подсказок, событие onclick или onmousedown не происходит.
То же самое в адресной строке если открыт список адресов. Пока его не закроешь, клика в адресной строке нет.
Причем это даже и с новым профилем.
Но на каком то элементе это событие происходит же, раз мышка щелкает?
Отсутствует
hartumov пишетНо на каком то элементе это событие происходит же, раз мышка щелкает?
А что ты хочешь сделать?
Я хочу к searchbar-у приделать обработчик онклик, чтобы он срабатывал даже когда открыт выпадающий список.
Отсутствует
Я хочу к searchbar-у приделать обработчик онклик, чтобы он срабатывал даже когда открыт выпадающий список.
Обработчик должен работать. Я сейчас проверил на другой версии и .addEventListener('click' работает в поисковой строке даже если открыт выпадающий список подсказок. Кстати выпадающий список подсказок закрывается по mousedown значит когда должен сработать click выпадающий список уже закрыт.
Отсутствует
А отчего это может быть. Если открыта эта панель id = PopupAutoComplete то щелчок ЛКМ в поисковой строке не вызывает событие onclick.
Может от атрибута consumeoutsideclicks.
Отсутствует
hartumov пишетА отчего это может быть. Если открыта эта панель id = PopupAutoComplete то щелчок ЛКМ в поисковой строке не вызывает событие onclick.
Может от атрибута consumeoutsideclicks.
Я скриптом изменил этот атрибут на true (было false)
document.getElementById('PopupAutoComplete').setAttribute( 'consumeoutsideclicks', true)
Атрибут поменялся, но не помогло.
Просто мистика. Ну где то же mouse event происходит?
Где?
Отсутствует
В 49-м перестала работать кнопка Восстановить иконки всех закладок . Сетевая активность есть, при активации опции, но иконки не восстанавливаются. Что то изменилось в версии, потому что перестало работать и дополнение FavIcon Reloader, с теми же...симптомами.
Упс, не совсем туда обратился, но все же.
Отредактировано oleg.sgh (29-09-2016 13:55:11)
Отсутствует
Я скриптом изменил этот атрибут на true (было false)
Так, вроде, наоборот же
(ids => { for(var id of ids) { try { var element = document.getElementById(id); element.setAttribute = function(attribute, value) { if (attribute == "consumeoutsideclicks") value = ""; Element.prototype.setAttribute.call(element, attribute, value); } } catch(ex) { Services.console.logStringMessage(ex); continue; } } })([ "PopupAutoCompleteRichResult", //"PopupAutoComplete" ]); addEventListener("click", e => { if (e.button) return; var trg = e.originalTarget; custombuttons.alertSlide("e.originalTarget:", trg + "\n" + trg.nodeName + ((trg.id ? "#" + trg.id : "") || (trg.className ? "●" + trg.className : "")) ); });
Отсутствует