xrun1
А как вы прикрутили иконки в контекстном меню? Вот здесь.
Поделитесь, плиз.
Отсутствует
rubel
Это мы втроём мутили Vitaliy V., Dumby и Ваш покорный слуга.)) Изначальные ссылки на мучение есть в стиле. Стиль для ucf (в смысле моих путей), замените на свои, если нужно. Я после тех ссылок ещё добавлял иконки и пункты.
https://www.upload.ee/files/12872394/icons-in-menu.zip.html
P.S. В папке icons несколько лишних иконок, у меня используются в других местах. Думаю, это не принципиально, вычищать лень.
Отредактировано xrun1 (12-02-2021 10:00:21)
Отсутствует
подскажите, плз, можно ли кодом userChrome.css уменьшить высоту панелей меню, навигации и вкладок в 85?
Отредактировано ALEX_45_ORP (12-02-2021 23:20:29)
Win 10х64
Отсутствует
Это мы втроём мутили Vitaliy V., Dumby и Ваш покорный слуга.)) Изначальные ссылки на мучение есть в стиле. Стиль для ucf (в смысле моих путей), замените на свои, если нужно. Я после тех ссылок ещё добавлял иконки и пункты.
https://www.upload.ee/files/12872394/icons-in-menu.zip.html
Спасибо, интересно получилось. А в Панели меню, чего не домутили?
Отсутствует
xrun1
custom_script_win.js
// Очистить панель адреса или поиска прокруткой колёсиком мыши на панели (this.clearsearchurlbar = { init(that) { for (let el of (this.urlsearcbar = document.querySelectorAll("#urlbar,#searchbar"))) el.addEventListener("wheel", this); that.unloadlisteners.push("clearsearchurlbar"); }, handleEvent(e) { e.target.value = ""; }, destructor() { for (let el of this.urlsearcbar) el.removeEventListener("wheel", this); }, }).init(this); // Автоматически открывать папки закладок на панели закладок (this.placesmenudndhandler = { delay: 350, init(that) { var PlacesToolbar = this.PlacesToolbar = document.querySelector("#PlacesToolbar"); if (!PlacesToolbar) return; PlacesToolbar.addEventListener("mouseover", this); this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); that.unloadlisteners.push("placesmenudndhandler"); }, isButtonMenu(node) { if (node.localName == "toolbarbutton" && node.getAttribute("type") == "menu" && node.menupopup?.hasAttribute("placespopup")) return true; return false; }, isOpen(popup) { if (popup.state === "open") return true; return false; }, handleEvent(event, target = event.target, popup) { if (!this.isButtonMenu(target) || this.isOpen(popup = target.menupopup)) return; this.timer.cancel(); this.timer.initWithCallback(() => { if (this.curpopup && this.isOpen(this.curpopup)) this.curpopup.hidePopup(); this.curpopup = popup; popup.openPopup(); }, this.delay, Ci.nsITimer.TYPE_ONE_SHOT); target.addEventListener("mouseleave", () => { this.timer.cancel(); }, { once: true }); }, destructor() { this.PlacesToolbar.removeEventListener("mouseover", this); }, }).init(this); // Пункт для контекстного меню адресной строки, подставляющий модификаторы поиска (this.searchmodifiers = { init(that) { var urlbar = this.urlbar = document.querySelector("#urlbar"); if (!urlbar) return; urlbar.addEventListener("popupshowing", this); that.unloadlisteners.push("searchmodifiers"); }, handleEvent(e) { if (e.originalTarget != this.popup) return; this.urlbar.removeEventListener("popupshowing", this); this.urlbar = null; this.append("menuseparator", this.popup); var menu = this.append("menu", this.popup, {label: "Вставить ^ * + % ~ # @"}); var popup = this.append("menupopup", menu, {oncommand: "insert(event);"}); popup.addEventListener("popupshowing", this, { once: true }); this.handleEvent = e => { var df = document.createDocumentFragment(); for(var label of [ "^ История", "* Закладки", "+ Страницы с метками", "% Текущие открытые вкладки", "~ Набранные", "# Названия", "@ Веб-адреса (URLs)" ]) this.append("menuitem", df, {label}); popup.append(df); var ed = gURLBar.inputField.editor .QueryInterface(Ci.nsIEditor || Ci.nsIPlaintextEditor); popup.insert = e => { var str = e.target.label[0] + " "; var val = gURLBar.inputField.value; if (val && !val.endsWith(" ")) str = " " + str; ed.endOfDocument(); ed.insertText(str); }; }; }, get popup() { delete this.popup; return this.popup = gURLBar.inputField.parentNode.menupopup; }, append(name, parent, attrs) { var elm = document.createXULElement(name); if (attrs) for(var a in attrs) elm.setAttribute(a, attrs[a]); parent.append(elm); return elm; }, destructor() { this.urlbar?.removeEventListener("popupshowing", this); }, }).init(this); // Добавить подменю "Поиск изображения в" в контекстном меню изображений (this.searchimagecontextmenu = { handleEvent(e) { var array = [ ['Google', 'https://www.google.lv/favicon.ico', 'https://www.google.com/searchbyimage?&image_url='], ['Яндекс', 'https://yastatic.net/morda-logo/i/favicon_islands.ico', 'https://yandex.ru/images/search?rpt=imageview&url='], ['Bing', 'https://www.bing.com/s/a/bing_p.ico', 'https://www.bing.com/images/search?view=detailv2&iss=sbi&form=SBIHMP&sbisrc=UrlPaste&q=imgurl:'], ['Tineye', 'https://tineye.com/favicon.ico', 'https://tineye.com/search?pluginver=bookmark_1.0&url='], ]; var menu = document.createXULElement("menu"); menu.setAttribute("label", "Поиск изображения в ..."); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", array[0][1]); menu.setAttribute("onclick", "_searcclick(event);"); menu._searcclick = function(e) { if (e.target != this) return; gBrowser.selectedTab = gBrowser.addTrustedTab(this._searcharg[2] + encodeURIComponent(gContextMenu.imageURL), { index: gBrowser.selectedTab._tPos + 1 } ); this.parentNode.hidePopup(); } menu._searcharg = array[0]; var menuPopup = document.createXULElement("menupopup"); menu.append(menuPopup); array.forEach(m=> { var mItem = document.createXULElement("menuitem"); mItem.setAttribute("label", m[0]); mItem.setAttribute("image", m[1]); mItem.setAttribute("class", "menuitem-iconic"); mItem.setAttribute("oncommand", "gBrowser.selectedTab = gBrowser.addTrustedTab(_searcharg[2] + encodeURIComponent(gContextMenu.imageURL), { index: gBrowser.selectedTab._tPos + 1 } );"); mItem._searcharg = m; menuPopup.append(mItem); }); var mItem = document.createXULElement("menuitem"); mItem.setAttribute("label", 'Искать во всех поисковиках'); mItem.setAttribute("oncommand", "_searcharg.forEach(m => { gBrowser.selectedTab = gBrowser.addTrustedTab(m[2] + encodeURIComponent(gContextMenu.imageURL), { index: gBrowser.selectedTab._tPos + 1 } );});"); mItem._searcharg = array; menuPopup.append(mItem); this.contextMenu.querySelector("#context-copyimage-contents")?.before(menu); (this.handleEvent = e => { menu.hidden = !gContextMenu?.imageURL; })(e); }, init(that) { var contextMenu = this.contextMenu = document.querySelector("#contentAreaContextMenu"); if (!contextMenu) return; contextMenu.addEventListener("popupshowing", this); that.unloadlisteners.push("searchimagecontextmenu"); }, destructor() { this.contextMenu.removeEventListener("popupshowing", this); }, }).init(this);
Update
// Очистить панель адреса или поиска прокруткой колёсиком мыши на панели (this.clearsearchurlbar = { init(that) { for (let el of (this.urlsearcbar = document.querySelectorAll("#urlbar,#searchbar"))) el.addEventListener("wheel", this); that.unloadlisteners.push("clearsearchurlbar"); }, handleEvent(e) { e.target.value = ""; }, destructor() { for (let el of this.urlsearcbar) el.removeEventListener("wheel", this); }, }).init(this); // Автоматически открывать папки закладок на панели закладок (this.placesmenudndhandler = { delay: 350, init(that) { var PlacesToolbar = this.PlacesToolbar = document.querySelector("#PlacesToolbar"); if (!PlacesToolbar) return; PlacesToolbar.addEventListener("mouseover", this); this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); that.unloadlisteners.push("placesmenudndhandler"); }, isButtonMenu(node) { if (node.localName == "toolbarbutton" && node.getAttribute("type") == "menu" && node.menupopup?.hasAttribute("placespopup")) return true; return false; }, isOpen(popup) { if (popup.state === "open") return true; return false; }, handleEvent(event, target = event.target, popup) { if (!this.isButtonMenu(target) || this.isOpen(popup = target.menupopup)) return; this.timer.cancel(); this.timer.initWithCallback(() => { if (this.curpopup && this.isOpen(this.curpopup)) this.curpopup.hidePopup(); this.curpopup = popup; popup.openPopup(); }, this.delay, Ci.nsITimer.TYPE_ONE_SHOT); target.addEventListener("mouseleave", () => { this.timer.cancel(); }, { once: true }); }, destructor() { this.PlacesToolbar.removeEventListener("mouseover", this); }, }).init(this); // Пункт для контекстного меню адресной строки, подставляющий модификаторы поиска (this.searchmodifiers = { init(that) { var urlbar = this.urlbar = gURLBar.textbox; if (!urlbar) return; urlbar.addEventListener("popupshowing", this); that.unloadlisteners.push("searchmodifiers"); }, handleEvent(e) { if (e.originalTarget != this.popup) return; this.urlbar.removeEventListener("popupshowing", this); this.urlbar = null; var sep = this.popup.querySelector("menuseparator.menuseparator-add-engine") || this.popup.lastElementChild; var menu = this.append("menu", sep, {label: "Вставить ^ * + % ~ # @"}, "before"); this.append("menuseparator", menu, null, "before"); var popup = this.append("menupopup", menu, {oncommand: "insert(event);"}, "append"); popup.addEventListener("popupshowing", this, { once: true }); this.handleEvent = e => { var df = document.createDocumentFragment(); for (let label of [ "^ История", "* Закладки", "+ Страницы с метками", "% Текущие открытые вкладки", "~ Набранные", "# Названия", "@ Веб-адреса (URLs)" ]) this.append("menuitem", df, {label}, "append"); popup.append(df); var ed = gURLBar.inputField.editor .QueryInterface(Ci.nsIEditor || Ci.nsIPlaintextEditor); popup.insert = e => { var str = e.target.label[0] + " "; var val = gURLBar.inputField.value; if (val && !val.endsWith(" ")) str = " " + str; ed.endOfDocument(); ed.insertText(str); }; }; }, get popup() { delete this.popup; return this.popup = gURLBar.inputField.parentNode.menupopup; }, append(name, parent, attrs, func) { var elm = document.createXULElement(name); if (attrs) for (let a in attrs) elm.setAttribute(a, attrs[a]); parent[func](elm); return elm; }, destructor() { this.urlbar?.removeEventListener("popupshowing", this); }, }).init(this); // Добавить подменю "Поиск изображения в" в контекстном меню изображений (this.searchimagecontextmenu = { handleEvent(evt) { if (evt.target != this.contextMenu || !gContextMenu?.imageInfo?.currentSrc) return; var array = [ ['Google', 'https://www.google.lv/favicon.ico', 'https://www.google.com/searchbyimage?&image_url='], ['Яндекс', 'https://yastatic.net/morda-logo/i/favicon_islands.ico', 'https://yandex.ru/images/search?rpt=imageview&url='], ['Bing', 'https://www.bing.com/s/a/bing_p.ico', 'https://www.bing.com/images/search?view=detailv2&iss=sbi&form=SBIHMP&sbisrc=UrlPaste&q=imgurl:'], ['Tineye', 'https://tineye.com/favicon.ico', 'https://tineye.com/search?pluginver=bookmark_1.0&url='], ]; var menu = document.createXULElement("menu"); menu.setAttribute("label", "Поиск изображения в ..."); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", array[0][1]); menu.setAttribute("onclick", "_searcclick(event);"); menu._searcclick = function(e) { if (e.target != this) return; gBrowser.selectedTab = gBrowser.addTrustedTab(this._searcharg[2] + encodeURIComponent(gContextMenu.imageInfo.currentSrc), { index: gBrowser.selectedTab._tPos + 1 } ); this.parentNode.hidePopup(); } menu._searcharg = array[0]; var menuPopup = document.createXULElement("menupopup"); menu.append(menuPopup); array.forEach(m=> { var mItem = document.createXULElement("menuitem"); mItem.setAttribute("label", m[0]); mItem.setAttribute("image", m[1]); mItem.setAttribute("class", "menuitem-iconic"); mItem.setAttribute("oncommand", "gBrowser.selectedTab = gBrowser.addTrustedTab(_searcharg[2] + encodeURIComponent(gContextMenu.imageInfo.currentSrc), { index: gBrowser.selectedTab._tPos + 1 } );"); mItem._searcharg = m; menuPopup.append(mItem); }); var mItem = document.createXULElement("menuitem"); mItem.setAttribute("label", 'Искать во всех поисковиках'); mItem.setAttribute("oncommand", "_searcharg.forEach(m => { gBrowser.selectedTab = gBrowser.addTrustedTab(m[2] + encodeURIComponent(gContextMenu.imageInfo.currentSrc), { index: gBrowser.selectedTab._tPos + 1 } );});"); mItem._searcharg = array; menuPopup.append(mItem); this.contextMenu.querySelector("#context-copyimage-contents")?.before(menu); this.popupshowing = e => { if (e.target != this.contextMenu) return; menu.hidden = !gContextMenu?.imageInfo?.currentSrc; }; this.popuphiding = e => { if (e.target != this.contextMenu) return; menu.hidden = true; }; this.contextMenu.addEventListener("popuphiding", this); this.handleEvent = e => { this[e.type](e); }; }, init(that) { var contextMenu = this.contextMenu = document.querySelector("#contentAreaContextMenu"); if (!contextMenu) return; contextMenu.addEventListener("popupshowing", this); that.unloadlisteners.push("searchimagecontextmenu"); }, destructor() { this.contextMenu.removeEventListener("popupshowing", this); this.contextMenu.removeEventListener("popuphiding", this); }, }).init(this);
Отредактировано Vitaliy V. (25-11-2021 17:00:46)
Отсутствует
А как сжать на 1-2 пикселя расстояние между кнопками в боковой панели? Пробовал по аналогии с этим стилем https://forum.mozilla-russia.org/viewtopic.php?pid=775867#p775867
Получается слишком узко...
/* Сжать доп.панели https://forum.mozilla-russia.org/viewtopic.php?pid=775867#p775867 */ #add-additional-top-bar, #add-additional-bottom-bar { --toolbarbutton-outer-padding: 2px !important; /* было 0px */ --toolbarbutton-inner-padding: 2px !important; min-height: 20px !important; } #add-additional-bottom-closebutton { padding: 0 !important; } #add-additional-vertical-bar { --toolbarbutton-outer-padding: 2px !important; /* было 0px */ --toolbarbutton-inner-padding: 2px !important; min-width: 20px !important; } :-moz-any(#add-additional-top-bar,#add-additional-bottom-bar,#add-additional-vertical-bar) .toolbarbutton-badge { margin-inline-end: calc(-1 * (var(--toolbarbutton-outer-padding) + var(--toolbarbutton-inner-padding))) !important; }
Добавлено 13-02-2021 07:13:42
А в Панели меню, чего не домутили?
Я не пользуюсь, про других не знаю. Сделать не сложно, иконки почти все есть. Как получить ID меню здесь https://forum.mozilla-russia.org/viewtopic.php?pid=758758#p758758
Vitaliy V.
Спасибо, отлично работает!
Отредактировано xrun1 (13-02-2021 07:13:42)
Отсутствует
ALEX_45_ORP пишетвкладок в 85?
Персонализация -> Значки -> Компактные
Или нужно еще меньше?
да, нужно меньше и именно самому числовое значение подобрать, т.к. сборка
Win 10х64
Отсутствует
Как убрать синюю полосу сверху активной вкладки?
Отсутствует
А другие варианты есть?
Отредактировано sandro79 (13-02-2021 14:33:49)
Отсутствует
sandro79
При первом варианте табов в сохраненной сессии воообще нет, а при втором все табы накладываются друг на друга в одной строке, а как бы должны быть каждый в своей строке.
Может как-то можно не прятать зту полоску, а перекрасить в тот же цвет, что и активная вкладка?
Отсутствует
Может как-то можно не прятать зту полоску, а перекрасить в тот же цвет, что и активная вкладка?
Да, можно перекрасить.
.tabbrowser-tab[selected] .tab-line { background-color: var(--classic_squared_tabs_active_tab) !important; }
Отредактировано sandro79 (13-02-2021 15:17:07)
Отсутствует
А можете ещё добавить очистку поиска в боковой панели и окна звёздочки.
(this.clearsearchurlbar = { init(that) { for (let el of (this.urlsearcbar = document.querySelectorAll("#urlbar,#searchbar,#sidebar"))) el.addEventListener("wheel", this); (document.querySelector("#editBookmarkPanelTemplate")?.content.querySelector("#editBookmarkPanelRows") || document.querySelector("#editBookmarkPanelRows")) ?.setAttribute("onwheel", "if (event.target.value && event.target.localName === 'input') event.target.value = '';"); that.unloadlisteners.push("clearsearchurlbar"); }, handleEvent(e, target = e.target) { if (target.value) { if ("_clearSearch" in target) target._clearSearch(); else if (target.localName === "input") target.value = ""; } }, destructor() { for (let el of this.urlsearcbar) el.removeEventListener("wheel", this); }, }).init(this);
Получается слишком узко...
--toolbarbutton-inner-padding не пробовали прибавить?
да, нужно меньше и именно самому числовое значение подобрать, т.к. сборка
не знаю насчет сборки попробуйте это
https://forum.mozilla-russia.org/viewto … 77#p786677
Отредактировано Vitaliy V. (13-02-2021 17:27:55)
Отсутствует
не знаю насчет сборки попробуйте это
https://forum.mozilla-russia.org/viewto … 77#p786677
спс, теперь подгоню по своим потребностям.
Win 10х64
Отсутствует
А как в custom_script_win.js скрипты отдельным файлом подключать?
Смотря какие скрипты, если такие как в постах №9656 №9667
то тут надо загружать в объект ucf_custom_script_win а не в window как по ссылке xrun1
И вопрос нужно ли загружать скрипты в сидебар? Для custom_script_all_win.js делал подобные загрузчики можно использовать их
но лучше сделать специально для custom_script_win.js, если нужно?
Отсутствует
Смотря какие скрипты, если такие как в постах №9656 №9667
то тут надо загружать в объект ucf_custom_script_win а не в window как по ссылке xrun1
Ну да, в данном случае, как в постах №9656 №9667. ucf_custom_script_win - это где, такого у меня вообще нет? А почему нельзя как по ссылке xrun1, работает же?
И вопрос нужно ли загружать скрипты в сидебар?
Ну наверное нужно, очистка колесом есть же в боковой панели закладок.
но лучше сделать специально для custom_script_win.js, если нужно?
Ну хорошо бы было, мне удобнее когда скрипты отдельными файлами.
Отредактировано voqabuhe (13-02-2021 20:19:31)
Отсутствует
del
Отредактировано Vitaliy V. (14-04-2022 01:28:09)
Отсутствует