>Форум Mozilla Россия http://forum.mozilla-russia.org/index.php >Firefox http://forum.mozilla-russia.org/viewforum.php?id=4 >Свой пункт в контекстном меню страницы http://forum.mozilla-russia.org/viewtopic.php?id=76106 |
Zerdsa > 26-11-2020 19:53:52 |
Как в последних ESR и полных версиях вставить свой пункт со своими действиями в контекстное меню для выделенного текста? |
_zt > 26-11-2020 21:18:22 |
Zerdsa |
Zerdsa > 26-11-2020 23:11:46 |
_zt пишет
А созданный файл (*.css если я правильно понимаю) в последних версиях FF куда кладётся? |
_zt > 27-11-2020 17:49:16 |
Zerdsa
с помощью css такого не сделать. И по css есть отдельный большой раздел на форуме. |
Zerdsa > 27-11-2020 21:15:24 |
_zt пишет
Так - понятно. По ходу не по адресу обратился. скрытый текст Выделить код Код:/*AGENT_SHEET*/ @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); #placesContext .box-inherit.scrollbox-innerbox { -moz-binding: url('data:application/xml,\ \ <?xml version="1.0"?>\%0A\ <bindings xmlns="http://www.mozilla.org/xbl">\%0A\ <binding id="placesContext_extraMenuitem">\%0A\ <implementation>\%0A\ <constructor>\%0A\ <![CDATA[\%0A\ var before = document.getElementById("placesContext_openSeparator");\%0A\ var popup = this.linkedPopup = this.parentNode.parentNode.parentNode;\%0A\ var menuitem = popup.insertBefore(document.createElement("menuitem"), before);\%0A\ menuitem.id = "placesContext_openContainer:window";\%0A\ menuitem.setAttribute("label", decodeURIComponent(\%0A\ "Открыть все ссылки в новом окне"\%0A\ ));\%0A\ menuitem.setAttribute("oncommand", "this.cmd();");\%0A\ menuitem.cmd = function() {\%0A\ var node = popup._view.selectedNode;\%0A\ var urlsToOpen = PlacesUtils.getURLsForContainerNode(node);\%0A\ if (!urlsToOpen.length) return;\%0A\ var urls = [];\%0A\ for (var item of urlsToOpen) {\%0A\ urls.push(item.uri);\%0A\ };\%0A\ var uriList = PlacesUtils.toISupportsString(urls.join("|"));\%0A\ var args = Cc["@mozilla.org/supports-array;1"].createInstance(Ci.nsISupportsArray);\%0A\ args.AppendElement(uriList);\%0A\ Services.ww.openWindow(null, "chrome://browser/content/browser.xul", null, "chrome,dialog=no,all", args);\%0A\ };\%0A\ var handler = this.linkedPopupPopupshowihgHandler = function () {\%0A\ var place = (popup._view.selectedNodes.length == 1) && popup._view.selectedNode;\%0A\ menuitem.hidden = menuitem.disabled = !(place && PlacesUtils.nodeIsContainer(place));\%0A\ };\%0A\ handler(); popup.addEventListener("popupshowing", handler);\%0A\ ]]>\%0A\ </constructor>\%0A\ <destructor>\%0A\ this.linkedPopup.removeEventListener("popupshowing", this.linkedPopupPopupshowihgHandler);\%0A\ </destructor>\%0A\ </implementation>\%0A\ </binding>\%0A\ </bindings>\ \ ') !important; } /* КОД ДЛЯ ПУНКТА КОНТЕКСТНОГО МЕНЮ "Перевести выделенный фрагмент" */ /* Пока что он называется "Искать в первой поиск. системе" */ #contentAreaContextMenu spacer.arrowscrollbox-overflow-end-indicator { -moz-binding: url("data:text/xml;utf8,<bindings xmlns='http://www.mozilla.org/xbl' xmlns:xul='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' xmlns:xbl='http://www.mozilla.org/xbl'><binding id='menu'><implementation><field name='contentAreaContextMenu'>document.getElementById('contentAreaContextMenu');</field><field name='searchselect'>document.getElementById('context-searchselect');</field><constructor><![CDATA[ var menuitem = this.contentAreaContextMenu.insertBefore(document.createElement('menuitem'), this.searchselect.nextSibling); menuitem.setAttribute(%22id%22, %22context-firstsearchselect%22); menuitem.setAttribute(%22oncommand%22, %22var Selection = null; if (gContextMenuContentData && gContextMenuContentData.isRemote) { Selection = gContextMenuContentData.selectionInfo.text; } else if (BrowserUtils.getSelectionDetails) { Selection = BrowserUtils.getSelectionDetails(window).text; } else { Selection = getBrowserSelection(); } var inBackground = Services.prefs.getBoolPref('browser.search.context.loadInBackground'); openLinkIn('https://translate.yandex.ru/?text=' + Selection, 'tab', { inBackground: inBackground, relatedToCurrent: true })%22); menuitem.setAttribute(%22label%22, %22Перевести выделенное Яндекс.Переводчик...%22); ]]></constructor></implementation></binding></bindings>#menu") !important; } #contentAreaContextMenu #context-searchselect[hidden="true"] ~ #context-firstsearchselect { display: none !important; } #urlbar:not(:-moz-lwtheme)[focused], .searchbar-textbox:not(:-moz-lwtheme)[focused] { border-color: Highlight !important; } Ну, и напоследок: где в новых версиях папка chrome в \profile.default\? |
_zt > 27-11-2020 21:56:02 |
Во первых, это не css, хотя "это" и могло работать из userChrome.css, раньше, но раньше и водка по 4.42 была, а сейчас нет. |