Тема закрыта
Страницы: 1
Это готовое решение для аддона "Menu Wizard"
https://addons.mozilla.org/addon/s3menu-wizard/
https://forum.mozilla-russia.org/viewtopic.php?id=63252
Это решение добавит в контекстном меню вкладки её историю с возможностью открытия ссылок в новой вкладке браузера.
Установка:
FillHistoryMenu_new(event.target); function FillHistoryMenu_new(aParent) { // Lazily add the hover listeners on first showing and never remove them if (!aParent.hasStatusListener) { // Show history item's uri in the status bar when hovering, and clear on exit aParent.addEventListener("DOMMenuItemActive", function(aEvent) { // Only the current page should have the checked attribute, so skip it if (!aEvent.target.hasAttribute("checked")) XULBrowserWindow.setOverLink(aEvent.target.getAttribute("uri")); }, false); aParent.addEventListener("DOMMenuItemInactive", function() { XULBrowserWindow.setOverLink(""); }, false); aParent.hasStatusListener = true; } // Remove old entries if any var children = aParent.childNodes; for (var i = children.length - 1; i >= 0; --i) { if (children[i].hasAttribute("index")) aParent.removeChild(children[i]); } var webNav = gBrowser.getBrowserForTab(TabContextMenu.contextTab).webNavigation; var sessionHistory = webNav.sessionHistory; var count = sessionHistory.count; if (count <= 1) // don't display the popup for a single item return false; const MAX_HISTORY_MENU_ITEMS = 15; var index = sessionHistory.index; var half_length = Math.floor(MAX_HISTORY_MENU_ITEMS / 2); var start = Math.max(index - half_length, 0); var end = Math.min(start == 0 ? MAX_HISTORY_MENU_ITEMS : index + half_length + 1, count); if (end == count) start = Math.max(count - MAX_HISTORY_MENU_ITEMS, 0); var tooltipBack = gNavigatorBundle.getString("tabHistory.goBack"); var tooltipCurrent = gNavigatorBundle.getString("tabHistory.current"); var tooltipForward = gNavigatorBundle.getString("tabHistory.goForward"); for (var j = end - 1; j >= start; j--) { var item = document.createElement("menuitem"); var entry = sessionHistory.getEntryAtIndex(j, false); var uri = entry.URI.spec; var entryURI = BrowserUtils.makeURIFromCPOW(entry.URI); item.setAttribute("uri", uri); item.setAttribute("label", entry.title || uri); item.setAttribute("index", j); item.setAttribute("onclick", "gBrowser.selectedTab = gBrowser.addTab(this.getAttribute('uri'));"); if (j != index) { PlacesUtils.favicons.getFaviconURLForPage(entryURI, function (aURI) { if (aURI) { var iconURL = PlacesUtils.favicons.getFaviconLinkForIcon(aURI).spec; iconURL = PlacesUtils.getImageURLForResolution(window, iconURL); item.style.listStyleImage = "url(" + iconURL + ")"; } }); } if (j < index) { item.className = "unified-nav-back menuitem-iconic menuitem-with-favicon"; item.setAttribute("tooltiptext", tooltipBack); } else if (j == index) { item.setAttribute("type", "radio"); item.setAttribute("checked", "true"); item.className = "unified-nav-current"; item.setAttribute("tooltiptext", tooltipCurrent); } else { item.className = "unified-nav-forward menuitem-iconic menuitem-with-favicon"; item.setAttribute("tooltiptext", tooltipForward); } aParent.appendChild(item); } return true; }
Отредактировано pag77 (08-02-2016 14:55:57)
Отсутствует
достаточно одной темы
https://forum.mozilla-russia.org/viewtopic.php?id=63252
Через сомнения приходим к истине. Цицерон
Отсутствует
Тема закрыта
Страницы: 1