Farby - значит, эти две строки создают одинаковый объект Services?
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
var Services = ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
Отсутствует
эти две строки создают одинаковый объект Services?
Да.
Кажется такая конструкция должна работать...
if ((window.isChromeWindow) ? false : (window instanceof Ci.nsIDOMChromeWindow) ? false : true) return;
Добавлено 27-09-2023 18:02:12
Хотя проверил в 58 конструкция window.isChromeWindow уже была...
Отредактировано Farby (27-09-2023 18:02:12)
Жизнь иногда такое выкидывает, что хочется подобрать...
Отсутствует
Dumby
В 115 перестала нормально работать кнопка Восстановить.
В ней не раскрывается меню Недавно закрытые вкладки. В 91 все Ок.
try {(() => { var id = "ucf-undo-tab", label = "Восстановить", tooltiptext = "ЛКМ: Восстановить вкладку\nПКМ: Восстановить окно", tooltiptextbtnmenu = "ЛКМ: Открыть меню\nПКМ: Показать весь журнал", img = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16,12 C 16,12 3,27 3,26.81 L 24.2,48 H 45 C 46.7,48 48,46.7 48,45 V 17.3 L 40,9.3 Z'/><path style='fill:white;' d='M 27.68,3.93 C 26.7,3.93 25.66,3.992 24.58,4.138 19.23,5.17 13.74,8.472 10.22,12.78 3.018,5.815 7.525,10.29 3.021,5.815 L 3,26.81 H 24.18 L 17.03,19.7 C 20.44,14.7 30.87,6.752 38.32,19.08 40.69,25.69 40.58,36.52 35.69,44 40.97,38.26 45.35,30.55 44.98,21.33 44.59,14.08 39.37,3.992 27.68,3.93' /></g></svg>", imgmenu = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><circle cy='24' cx='24' style='fill:rgb(0, 120, 173);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,41.8 22.3,31.1 36.7,17.9 44,25.2 C 43.5,30.6 41,37.7 33,41.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,19 H 13 L 24,30 35,19' /></g></svg>"; CustomizableUI.createWidget({ id: id, type: "custom", label: label, tooltiptext: tooltiptext, localized: false, defaultArea: CustomizableUI.AREA_NAVBAR, onBuild: function(document) { var win = document.defaultView, toolbaritem = document.createXULElement("toolbaritem"); toolbaritem.id = id; toolbaritem.className = "chromeclass-toolbar-additional"; toolbaritem.setAttribute("label", label); toolbaritem.setAttribute("type", "custom"); var toolbarbutton_0 = document.createXULElement("toolbarbutton"); toolbarbutton_0.id = `${id}-button`; toolbarbutton_0.className = "toolbarbutton-1"; toolbarbutton_0.setAttribute("label", label); toolbarbutton_0.setAttribute("tooltiptext", tooltiptext); toolbarbutton_0.setAttribute("context", "false"); toolbarbutton_0.addEventListener("click", function(event) { if (event.button == 0) win.undoCloseTab(); else if (event.button == 2) { event.preventDefault(); event.stopPropagation(); win.undoCloseWindow(); } }); toolbaritem.append(toolbarbutton_0); var toolbarbutton_1 = document.createXULElement("toolbarbutton"); toolbarbutton_1.id = `${id}-button-menu`; toolbarbutton_1.className = "toolbarbutton-1"; toolbarbutton_1.setAttribute("type", "menu"); toolbarbutton_1.setAttribute("label", ""); toolbarbutton_1.setAttribute("tooltiptext", tooltiptextbtnmenu); toolbarbutton_1.setAttribute("context", "false"); toolbarbutton_1.addEventListener("click", function(event) { if (event.button == 2) { event.preventDefault(); event.stopPropagation(); win.PlacesCommandHook.showPlacesOrganizer("History"); } }); var menupopup_0 = document.createXULElement("menupopup"); menupopup_0.id = `${id}-popup`; menupopup_0.setAttribute("tooltip", "bhTooltip"); menupopup_0.setAttribute("popupsinherittooltip", true); menupopup_0.addEventListener("click", function(event) { event.stopPropagation(); }); menupopup_0.addEventListener("command", function(event) { event.stopPropagation(); }); var menu_0 = document.createXULElement("menu"); menu_0.setAttribute("disabled", true); menu_0.setAttribute("label", "Недавно закрытые вкладки"); var menupopup_1 = document.createXULElement("menupopup"); menupopup_1.addEventListener("popupshowing", function(event) { while (menupopup_1.hasChildNodes()) menupopup_1.firstChild.remove(); if (win == Services.appShell.hiddenDOMWindow || win.SessionStore.getClosedTabCount(win) == 0) { menu_0.setAttribute("disabled", true); return; } var tabsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getTabsFragment(win, "menuitem"); menupopup_1.append(tabsFragment); menu_0.removeAttribute("disabled"); }); menu_0.append(menupopup_1); menupopup_0.append(menu_0); var menu_1 = document.createXULElement("menu"); menu_1.setAttribute("disabled", true); menu_1.setAttribute("label", "Недавно закрытые окна"); var menupopup_2 = document.createXULElement("menupopup"); menupopup_2.addEventListener("popupshowing", function(event) { while (menupopup_2.hasChildNodes()) menupopup_2.firstChild.remove(); if (win.SessionStore.getClosedWindowCount() == 0) { menu_1.setAttribute("disabled", true); return; } var windowsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getWindowsFragment(win, "menuitem"); menupopup_2.append(windowsFragment); menu_1.removeAttribute("disabled"); }); menu_1.append(menupopup_2); menupopup_0.append(menu_1); menupopup_0.addEventListener("popupshowing", function(event) { if (win == Services.appShell.hiddenDOMWindow || win.SessionStore.getClosedTabCount(win) == 0) menu_0.setAttribute("disabled", true); else menu_0.removeAttribute("disabled"); if (win.SessionStore.getClosedWindowCount() == 0) menu_1.setAttribute("disabled", true); else menu_1.removeAttribute("disabled"); }); var menuitem_0 = document.createXULElement("menuitem"); menuitem_0.id = `${id}-all-history`; menuitem_0.setAttribute("label", "Показать весь журнал"); menuitem_0.addEventListener("command", function(event) { event.stopPropagation(); win.PlacesCommandHook.showPlacesOrganizer("History"); }); menupopup_0.append(menuitem_0); var menuitem_1 = document.createXULElement("menuitem"); menuitem_1.setAttribute("label", "Удалить недавнюю историю…"); menuitem_1.addEventListener("command", function(event) { event.stopPropagation(); win.Sanitizer.showUI(win); }); menupopup_0.append(menuitem_1); toolbarbutton_1.append(menupopup_0); toolbaritem.append(toolbarbutton_1); var btnstyle = "data:text/css;charset=utf-8," + encodeURIComponent(` #${id}-button { list-style-image: url("${img}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-end: 0 !important; } #${id}-button-menu { list-style-image: url("${imgmenu}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-start: 0px !important; } toolbarpaletteitem[place="palette"] #${id}-button-menu, #${id}-button-menu dropmarker { display: none !important; } toolbarpaletteitem[place="palette"] #${id} { -moz-box-orient: vertical !important; } #${id}-button-menu > .toolbarbutton-icon { min-width: 0 !important; max-width: none !important; width: auto !important; padding-left: 0 !important; padding-right: 0 !important; } `); try { win.windowUtils.loadSheetUsingURIString(btnstyle, win.windowUtils.USER_SHEET); } catch (e) {} return toolbaritem; } }); })();} catch(e) {}
Отсутствует
кнопка Восстановить – не раскрывается меню "Недавно закрытые вкладки"
У тебя старая версия. В новом коде строки Закрытых вкладок сразу в выпадающее меню кнопки добавляются.
try {(() => { var id = "ucf-undo-tab", label = "Закрытые вкладки/окна", tooltiptextbtnmenu = "ЛКМ: Открыть меню\nПКМ: Восстановить вкладку\nСКМ: Показать весь журнал"; CustomizableUI.createWidget({ id: id, label: label, type: "custom", localized: false, onBuild(doc) { var win = doc.defaultView, trim = doc.createXULElement("toolbaritem"); trim.id = id; trim.className = "toolbaritem-combined-buttons ucf-toolbaritem-combined-buttons chromeclass-toolbar-additional"; trim.setAttribute("label", label); trim.setAttribute("type", "custom"); trim.style.setProperty("margin-inline","0"); var trbn_1 = doc.createXULElement("toolbarbutton"); trbn_1.id = `${id}-button-menu`; trbn_1.className = "toolbarbutton-1 ucf-toolbarbutton-combined-buttons-toolbarbutton"; trbn_1.setAttribute("type", "menu"); trbn_1.setAttribute("label", ""); trbn_1.setAttribute("image", "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16,12 C 16,12 3,27 3,26.81 L 24.2,48 H 45 C 46.7,48 48,46.7 48,45 V 17.3 L 40,9.3 Z'/><path style='fill:white;' d='M 27.68,3.93 C 26.7,3.93 25.66,3.992 24.58,4.138 19.23,5.17 13.74,8.472 10.22,12.78 3.018,5.815 7.525,10.29 3.021,5.815 L 3,26.81 H 24.18 L 17.03,19.7 C 20.44,14.7 30.87,6.752 38.32,19.08 40.69,25.69 40.58,36.52 35.69,44 40.97,38.26 45.35,30.55 44.98,21.33 44.59,14.08 39.37,3.992 27.68,3.93' /></g></svg>"); trbn_1.setAttribute("tooltiptext", tooltiptextbtnmenu); trbn_1.setAttribute("context", ""); trbn_1.addEventListener("click", e => { if (e.button == 1) win.PlacesCommandHook.showPlacesOrganizer("History"); else if (e.button == 2) { e.preventDefault(); e.stopPropagation(); win.undoCloseTab(); } }); var mupp_0 = doc.createXULElement("menupopup"); mupp_0.id = `${id}-popup`; mupp_0.setAttribute("tooltip", "bhTooltip"); mupp_0.setAttribute("popupsinherittooltip", true); mupp_0.addEventListener("click", e => { e.stopPropagation(); }); mupp_0.addEventListener("command", e => { e.stopPropagation(); }); var muim_0 = doc.createXULElement("menuitem"); muim_0.id = `${id}-all-history`; muim_0.className = "ucf-menuitem"; muim_0.setAttribute("label", "Показать весь журнал"); muim_0.addEventListener("command", e => { e.stopPropagation(); win.PlacesCommandHook.showPlacesOrganizer("History"); }); mupp_0.append(muim_0); var muim_1 = doc.createXULElement("menuitem"); muim_1.id = `${id}-sanitize`; muim_1.className = "ucf-menuitem"; muim_1.setAttribute("label", "Удалить недавнюю историю…"); muim_1.addEventListener("command", e => { e.stopPropagation(); win.Sanitizer.showUI(win); }); mupp_0.append(muim_1); var muim_2 = doc.createXULElement("menuitem"); muim_2.id = `${id}-session`; muim_2.className = "ucf-menuitem"; muim_2.setAttribute("hidden", "true"); muim_2.setAttribute("label", "Восстановить последнюю сессию"); muim_2.addEventListener("command", e => { e.stopPropagation(); win.SessionStore.restoreLastSession(); }); mupp_0.append(muim_2); var menu_0 = doc.createXULElement("menu"); menu_0.id = `${id}-menu-closed-win`; menu_0.setAttribute("hidden", "true"); menu_0.setAttribute("label", "Недавно закрытые окна"); var mupp_1 = doc.createXULElement("menupopup"); var muim_3 = doc.createXULElement("menuitem"); muim_3.id = `${id}-item-closed-win`; muim_3.className = "ucf-menuitem"; muim_3.setAttribute("hidden", "true"); muim_3.setAttribute("label", "Забыть закрытые окна"); muim_3.addEventListener("command", e => { e.stopPropagation(); var sessionStore = win.SessionStore; var count = sessionStore.getClosedWindowCount(); while(count--) sessionStore.forgetClosedWindow(0); }); mupp_1.append(muim_3); var musr_0 = doc.createXULElement("menuseparator"); musr_0.id = `${id}-sep-closed-win`; musr_0.className = "ucf-menuseparator"; musr_0.setAttribute("hidden", "true"); mupp_1.append(musr_0); mupp_1.addEventListener("popupshowing", e => { e.stopPropagation(); for (let item of mupp_1.querySelectorAll(":scope > :is(menuitem:not(.ucf-menuitem), menuseparator:not(.ucf-menuseparator))")) item.remove(); if (win.SessionStore.getClosedWindowCount() == 0) { muim_3.setAttribute("hidden", "true"); musr_0.setAttribute("hidden", "true"); return; } if ("RecentlyClosedTabsAndWindowsMenuUtils" in win) { muim_3.removeAttribute("hidden"); musr_0.removeAttribute("hidden"); var windowsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getWindowsFragment(win, "menuitem"); mupp_1.append(windowsFragment); menu_0.removeAttribute("hidden"); } }); menu_0.append(mupp_1); mupp_0.append(menu_0); var musr_1 = doc.createXULElement("menuseparator"); musr_1.className = "ucf-menuseparator"; musr_1.setAttribute("hidden", "true"); mupp_0.append(musr_1); var muim_4 = doc.createXULElement("menuitem"); muim_4.id = `${id}-item-closed-tabs`; muim_4.className = "ucf-menuitem"; muim_4.setAttribute("hidden", "true"); muim_4.setAttribute("label", "Забыть закрытые вкладки"); muim_4.addEventListener("command", e => { e.stopPropagation(); var sessionStore = win.SessionStore, count; try{count = sessionStore.getClosedTabCountForWindow(win);} catch(e){count = sessionStore.getClosedTabCount(win)} while(count--) sessionStore.forgetClosedTab(win, 0); }); mupp_0.append(muim_4); var musr_2 = doc.createXULElement("menuseparator"); musr_2.id = `${id}-sep-closed-tabs`; musr_2.className = "ucf-menuseparator"; musr_2.setAttribute("hidden", "true"); mupp_0.append(musr_2); mupp_0.addEventListener("popupshowing", e => { var sessionStore = win.SessionStore; if (sessionStore.getClosedWindowCount() == 0) menu_0.setAttribute("hidden", "true"); else menu_0.removeAttribute("hidden"); if (!sessionStore.canRestoreLastSession) muim_2.setAttribute("hidden", "true"); else muim_2.removeAttribute("hidden"); for (let item of mupp_0.querySelectorAll(":scope > :is(menuitem:not(.ucf-menuitem), menuseparator:not(.ucf-menuseparator))")) item.remove(); try{var sSgCTC = sessionStore.getClosedTabCountForWindow(win);} catch(e){var sSgCTC = sessionStore.getClosedTabCount(win)} if (win == Services.appShell.hiddenDOMWindow || sSgCTC == 0) { musr_1.setAttribute("hidden", "true"); muim_4.setAttribute("hidden", "true"); musr_2.setAttribute("hidden", "true"); return; } if ("RecentlyClosedTabsAndWindowsMenuUtils" in win) { musr_1.removeAttribute("hidden"); muim_4.removeAttribute("hidden"); musr_2.removeAttribute("hidden"); var tabsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getTabsFragment(win, "menuitem"); mupp_0.append(tabsFragment); } }); trbn_1.append(mupp_0); trim.append(trbn_1); return trim; } }); })()} catch(e){}
Отредактировано Dobrov (29-09-2023 03:49:02)
Отсутствует
Dobrov
Восстановить Закрытые вкладки/окна - модификация без подменю
Ваша кнопка вообще не работает, не появляется на панели и в настройках панели инструментов тоже её нет.
Отсутствует
кнопка вообще не работает, не появляется на панели и в настройках панели инструментов тоже её нет.
Это потому, что четвёртая строка заканчивается запятой.
Вместо запятой должна быть точка с запятой «;» (ну, или ничего).
Отсутствует
Dumby Ошибку исправил!
кнопка теперь работает на старых и новых Firefox. И вот вопрос по коду: (как обычно)
кнопка создаётся через onBuild(doc) { …… Восстановить Закрытые вкладки/окна (вариант без dropmarker)
Можно её переделать на onCreated(btn) {……??? (у меня не заработало)
Возможно, это упростит код и сократит объём: не нужны будут return trbn_1 и trim = doc.createXULElement("toolbaritem")…
Отредактировано Dobrov (29-09-2023 02:45:05)
Отсутствует
Подскажите пожалуйста, что поправить в UCF (см. ссылку) для fx 118, чтобы вернуть интервалы (special_widget), остался только растягивающийся интервал, а пробел и разделитель пропали.
Отсутствует
В 115 сломалась иконка кнопки "Загрузки" и "Переключить прокси" .
В 91
В115
try { (() => { var id = "ucf-toggle-proxy", label = "Переключить прокси", tooltiptext = "Переключить прокси", tooltiptextbtnmenu = "ЛКМ: Открыть меню\nПКМ: Открыть настройки прокси", toggleproxy = 1, // 0, 1, 2, 4 , 5 Первый режим toggleproxy2 = 2, // 0, 1, 2, 4 , 5 Второй режим doreload = true, // Перезагрузить страницу img = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 240'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(146, 69, 101);'/><path style='opacity:0.25;fill:black;' d='M 16.8,17.6 23.1,23.9 8,26 6.4,32.2 11.4,37.2 3.7,44.8 6.9,48 45,48 C 46.7,48 48,46.7 48,45 V 20 L 31.4,3.4'/><path style='fill:white;' d='M 17.4,3 C 16.7,3 16.2,3.82 16.2,4.91 V 15.9 C 16.2,17 16.7,17.8 17.4,17.8 H 30.6 C 31.3,17.8 31.8,17 31.8,15.9 V 4.91 C 31.8,3.82 31.3,3 30.6,3 H 17.4 M 22.4,20.5 V 23.7 H 6.41 V 32.2 H 9.35 V 28.2 H 22.4 V 32.4 H 25.5 V 28.2 H 38.5 V 32.4 H 41.5 V 23.7 H 25.5 V 20.5 H 22.4 M 4.23,35.1 C 3.55,35.1 3,35.9 3,37.1 V 43 C 3,44.1 3.55,45 4.23,45 H 12.1 C 12.8,45 13.3,44.1 13.3,43 V 37.1 C 13.3,35.9 12.8,35.1 12.1,35.1 H 4.23 M 19.9,35.1 C 19.2,35.1 18.7,35.9 18.7,37.1 V 43 C 18.7,44.1 19.2,45 19.9,45 H 27.8 C 28.5,45 29,44.1 29,43 V 37.1 C 29,35.9 28.5,35.1 27.8,35.1 H 19.9 M 35.9,35.1 C 35.2,35.1 34.7,35.9 34.7,37.1 V 43 C 34.7,44.1 35.2,45 35.9,45 H 43.7 C 44.4,45 45,44.1 45,43 V 37.1 C 45,35.9 44.4,35.1 43.7,35.1 H 35.9' /><rect x='0' y='48' width='48' height='48' rx='3' ry='3' style='fill:rgb(209, 8, 3);'/><path style='opacity:0.25;fill:black;' d='M 16.8,65.6 23.1,71.9 8,74 6.4,80.2 11.4,85.2 3.7,92.8 6.9,96 45,96 C 46.7,96 48,94.7 48,93 V 68 L 31.4,51.4'/><path style='fill:white;' d='M 17.4,51 C 16.7,51 16.2,51.8 16.2,52.9 V 63.9 C 16.2,65 16.7,65.8 17.4,65.8 H 30.6 C 31.3,65.8 31.8,65 31.8,63.9 V 52.9 C 31.8,51.8 31.3,51 30.6,51 H 17.4 M 22.4,68.5 V 71.7 H 6.41 V 80.2 H 9.35 V 76.2 H 22.4 V 80.4 H 25.5 V 76.2 H 38.5 V 80.4 H 41.5 V 71.7 H 25.5 V 68.5 H 22.4 M 4.23,83.1 C 3.55,83.1 3,83.9 3,85.1 V 91 C 3,92.1 3.55,93 4.23,93 H 12.1 C 12.8,93 13.3,92.1 13.3,91 V 85.1 C 13.3,83.9 12.8,83.1 12.1,83.1 H 4.23 M 19.9,83.1 C 19.2,83.1 18.8,83.9 18.8,85.1 V 91 C 18.8,92.1 19.2,93 19.9,93 H 27.8 C 28.5,93 29,92.1 29,91 V 85.1 C 29,83.9 28.5,83.1 27.8,83.1 H 19.9 M 35.9,83.1 C 35.2,83.1 34.7,83.9 34.7,85.1 V 91 C 34.7,92.1 35.2,93 35.9,93 H 43.7 C 44.4,93 45,92.1 45,91 V 85.1 C 45,83.9 44.4,83.1 43.7,83.1 H 35.9' /><rect x='0' y='96' width='48' height='48' rx='3' ry='3' style='fill:rgb(243, 135, 37);'/><path style='opacity:0.25;fill:black;' d='M 16.8,114 23.1,120 8,122 6.4,128 11.4,133 3.7,141 6.9,144 H 45 C 46.7,144 48,142.7 48,141 V 116 L 31.4,99.4'/><path style='fill:white;' d='M 17.4,99 C 16.7,99 16.2,99.8 16.2,101 V 112 C 16.2,113 16.7,114 17.4,114 H 30.6 C 31.3,114 31.8,113 31.8,112 V 101 C 31.8,99.8 31.3,99 30.6,99 H 17.4 M 22.4,117 V 120 H 6.41 V 128 H 9.35 V 124 H 22.4 V 128 H 25.5 V 124 H 38.5 V 128 H 41.5 V 120 H 25.5 V 117 H 22.4 M 4.23,131 C 3.55,131 3,132 3,133 V 139 C 3,140 3.55,141 4.23,141 H 12.1 C 12.8,141 13.3,140 13.3,139 V 133 C 13.3,132 12.8,131 12.1,131 H 4.23 M 19.9,131 C 19.2,131 18.8,132 18.8,133 V 139 C 18.8,140 19.2,141 19.9,141 H 27.8 C 28.5,141 29,140 29,139 V 133 C 29,132 28.5,131 27.8,131 H 19.9 M 35.9,131 C 35.2,131 34.7,132 34.7,133 V 139 C 34.7,140 35.2,141 35.9,141 H 43.7 C 44.4,141 45,140 45,139 V 133 C 45,132 44.4,131 43.7,131 H 35.9' /><rect x='0' y='144' width='48' height='48' rx='3' ry='3' style='fill:rgb(21, 161, 99);'/><path style='opacity:0.25;fill:black;' d='M 16.8,162 23.1,168 8,170 6.4,176 11.4,181 3.7,189 6.9,192 H 45 C 46.7,192 48,190.7 48,189 V 164 L 31.4,147'/><path style='fill:white;' d='M 17.4,147 C 16.7,147 16.2,148 16.2,149 V 160 C 16.2,161 16.7,162 17.4,162 H 30.6 C 31.3,162 31.8,161 31.8,160 V 149 C 31.8,148 31.3,147 30.6,147 H 17.4 M 22.4,165 V 168 H 6.41 V 176 H 9.35 V 172 H 22.4 V 176 H 25.5 V 172 H 38.5 V 176 H 41.5 V 168 H 25.5 V 165 H 22.4 M 4.23,179 C 3.55,179 3,180 3,181 V 187 C 3,188 3.55,189 4.23,189 H 12.1 C 12.8,189 13.3,188 13.3,187 V 181 C 13.3,180 12.8,179 12.1,179 H 4.23 M 19.9,179 C 19.2,179 18.8,180 18.8,181 V 187 C 18.8,188 19.2,189 19.9,189 H 27.8 C 28.5,189 29,188 29,187 V 181 C 29,180 28.5,179 27.8,179 H 19.9 M 35.9,179 C 35.2,179 34.7,180 34.7,181 V 187 C 34.7,188 35.2,189 35.9,189 H 43.7 C 44.4,189 45,188 45,187 V 181 C 45,180 44.4,179 43.7,179 H 35.9' /><rect x='0' y='192' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16.8,210 23.1,216 8,218 6.4,224 11.4,229 3.7,237 6.9,240 H 45 C 46.7,240 48,238.7 48,237 L 48,212 31.4,195'/><path style='fill:white;' d='M 17.4,195 C 16.7,195 16.2,196 16.2,197 V 208 C 16.2,209 16.7,210 17.4,210 H 30.6 C 31.3,210 31.8,209 31.8,208 V 197 C 31.8,196 31.3,195 30.6,195 H 17.4 M 22.4,213 V 216 H 6.41 V 224 H 9.4 V 220 H 22.4 V 224 H 25.5 V 220 H 38.5 V 224 H 41.5 V 216 H 25.5 V 213 H 22.4 M 4.23,227 C 3.55,227 3,228 3,229 V 235 C 3,236 3.55,237 4.23,237 H 12.1 C 12.8,237 13.3,236 13.3,235 V 229 C 13.3,228 12.8,227 12.1,227 H 4.23 M 19.9,227 C 19.2,227 18.7,228 18.7,229 V 235 C 18.7,236 19.2,237 19.9,237 H 27.8 C 28.5,237 29,236 29,235 V 229 C 29,228 28.5,227 27.8,227 H 19.9 M 35.9,227 C 35.2,227 34.7,228 34.7,229 V 235 C 34.7,236 35.2,237 35.9,237 H 43.7 C 44.4,237 45,236 45,235 V 229 C 45,228 44.4,227 43.7,227 H 35.9' /></g></svg>", imgmenu = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 240'><g><circle cy='24' cx='24' style='fill:rgb(146, 69, 101);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,41.8 22.3,31.1 36.7,17.9 44,25.2 C 43.5,30.6 41,37.7 33,41.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,19 H 13 L 24,30 35,19' /><circle cy='72' cx='24' style='fill:rgb(209, 8, 3);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,89.8 22.3,79.1 36.7,65.9 44,73.2 C 43.5,78.6 41,85.7 33,89.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,67 H 13 L 24,78 35,67' /><circle cy='120' cx='24' style='fill:rgb(243, 135, 37);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,138 22,127 36.7,114 44,121 C 43.5,127 40.9,134 32.8,138 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 34.9,115 H 13.1 L 24,126 34.9,115' /><circle cy='168' cx='24' style='fill:rgb(21, 161, 99);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.9,186 22,175 36.7,162 44,169 C 43.5,175 40.9,182 32.9,186 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,163 H 13 L 24,174 35,163' /><circle cy='216' cx='24' style='fill:rgb(0, 120, 173);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,234 22,223 36.7,210 44,217 C 43.5,223 40.9,230 32.8,234 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,211 H 13 L 24,222 35,211' /></g></svg>"; var id2 = "ucf-open-downloads", label2 = "Загрузки", tooltiptext2 = "ЛКМ: Показать загрузки\nСКМ: Открыть папку загрузок\nПКМ: Открыть последнюю папку загрузок", img2 = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 23.4,33 30,39.6 H 18 L 8.7,30 3.9,44.1 7.8,48 H 45 C 46.7,48 48,46.7 48,45 V 22.5 L 28.8,3.3 Z'/><path style='fill:white;' d='M 20.27,3 C 19,3 19.25,3.798 19.25,3.798 V 17.94 20.23 H 13.75 C 12.13,20.23 13.61,21.58 13.61,21.58 L 23.36,32.85 V 32.85 C 23.36,32.85 24.17,33.75 25.01,32.95 26.16,31.84 34.47,21.3 34.47,21.3 34.47,21.3 35.93,19.89 33.98,19.89 H 28.91 V 17.83 3.672 C 28.91,3.672 28.93,3 28.03,3 Z M 3,29.93 V 42.22 C 3,43.75 4.303,45 5.918,45 H 42.08 C 43.71,45 45,43.75 45,42.22 V 29.93 H 39.16 V 39.43 H 8.837 V 29.93 Z' /></g></svg>"; var tbarbtns = { get network_proxy_type() { delete this.network_proxy_type; try { return this.network_proxy_type = Services.prefs.getIntPref("network.proxy.type"); } catch(e) { } return this.network_proxy_type = null; }, get btnstyle() { delete this.btnstyle; return this.btnstyle = "data:text/css;charset=utf-8," + encodeURIComponent(` #${id}-button { list-style-image: url("${img}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-end: 0 !important; } #${id}-button-menu { list-style-image: url("${imgmenu}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-start: 0px !important; } #${id}[activated="1"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } #${id}[activated="2"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(32px, 16px, 48px, 0px) !important; } #${id}[activated="4"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(48px, 16px, 64px, 0px) !important; } #${id}[activated="5"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(64px, 16px, 80px, 0px) !important; } toolbarpaletteitem[place="palette"] #${id}-button-menu, #${id}-button-menu dropmarker { display: none !important; } toolbarpaletteitem[place="palette"] #${id} { -moz-box-orient: vertical !important; } #${id}-button-menu > .toolbarbutton-icon { min-width: 0 !important; max-width: none !important; width: auto !important; padding-left: 0 !important; padding-right: 0 !important; } `); }, toggleTheProxy: function() { Services.prefs.setIntPref("network.proxy.type", (Services.prefs.getIntPref("network.proxy.type") == toggleproxy2) ? toggleproxy : toggleproxy2); }, setProxyMenuItem: function(event) { var proxyState = Services.prefs.getIntPref("network.proxy.type"), popup = event.currentTarget; for (var menuitem in popup.childNodes) { var childNode = popup.childNodes[menuitem]; if (+childNode.getAttribute("value") == proxyState) { childNode.setAttribute("checked", "true"); break; } } }, setProxyValue: function(event) { Services.prefs.setIntPref("network.proxy.type", +event.target.getAttribute("value")); }, checkBrowserReload: function(win) { if (doreload) win.BrowserReloadSkipCache(); }, openProxyWin: function(win) { var _win = Services.wm.getMostRecentWindow("aTaB:ProxyWin"); if (_win) _win.focus(); else { _win = win.openDialog("chrome://browser/content/preferences/dialogs/connection.xhtml", "_blank", "chrome,dialog=no,centerscreen,resizable"); var DOMLoad = () => { _win.document.documentElement.setAttribute("type", "prefwindow"); _win.document.documentElement.setAttribute("windowtype", "aTaB:ProxyWin"); }; _win.addEventListener("DOMContentLoaded", DOMLoad, { once: true }); _win.opener = win; _win.opener.gSubDialog = { _dialogs: [] }; } }, }; CustomizableUI.createWidget({ id: id, type: "custom", label: label, tooltiptext: tooltiptext, localized: false, defaultArea: CustomizableUI.AREA_NAVBAR, onBuild: function(document) { var win = document.defaultView, toolbaritem = document.createXULElement("toolbaritem"); toolbaritem.id = id; toolbaritem.className = "chromeclass-toolbar-additional"; toolbaritem.setAttribute("label", label); toolbaritem.setAttribute("type", "custom"); var toolbarbutton_0 = document.createXULElement("toolbarbutton"); toolbarbutton_0.id = `${id}-button`; toolbarbutton_0.className = "toolbarbutton-1"; toolbarbutton_0.setAttribute("label", label); toolbarbutton_0.setAttribute("tooltiptext", tooltiptext); toolbarbutton_0.setAttribute("context", "false"); toolbaritem.append(toolbarbutton_0); var toolbarbutton_1 = document.createXULElement("toolbarbutton"); toolbarbutton_1.id = `${id}-button-menu`; toolbarbutton_1.className = "toolbarbutton-1"; toolbarbutton_1.setAttribute("type", "menu"); toolbarbutton_1.setAttribute("label", ""); toolbarbutton_1.setAttribute("tooltiptext", tooltiptextbtnmenu); toolbarbutton_1.setAttribute("context", "false"); toolbarbutton_1.addEventListener("click", function(event) { if (event.button == 2) { event.preventDefault(); event.stopPropagation(); tbarbtns.openProxyWin(win); } }); var menupopup_0 = document.createXULElement("menupopup"); menupopup_0.id = `${id}-popup`; menupopup_0.addEventListener("click", function(event) { event.stopPropagation(); }); var proxy = tbarbtns.network_proxy_type; if (proxy !== null) { toolbaritem.setAttribute("activated", tbarbtns.network_proxy_type); toolbarbutton_0.addEventListener("command", function(event) { tbarbtns.toggleTheProxy(); tbarbtns.checkBrowserReload(win); }); menupopup_0.addEventListener("command", function(event) { event.stopPropagation(); tbarbtns.setProxyValue(event); tbarbtns.checkBrowserReload(win); }); menupopup_0.addEventListener("popupshowing", function(event) { tbarbtns.setProxyMenuItem(event); }); } var menuitem_0 = document.createXULElement("menuitem"); menuitem_0.setAttribute("label", "Прямое подключение, без прокси"); menuitem_0.setAttribute("type", "radio"); menuitem_0.setAttribute("value", "0"); menupopup_0.append(menuitem_0); var menuitem_1 = document.createXULElement("menuitem"); menuitem_1.setAttribute("label", "Ручная настройка прокси"); menuitem_1.setAttribute("type", "radio"); menuitem_1.setAttribute("value", "1"); menupopup_0.append(menuitem_1); var menuitem_2 = document.createXULElement("menuitem"); menuitem_2.setAttribute("label", "Автоматическая настройка прокси"); menuitem_2.setAttribute("type", "radio"); menuitem_2.setAttribute("value", "2"); menupopup_0.append(menuitem_2); var menuitem_3 = document.createXULElement("menuitem"); menuitem_3.setAttribute("label", "Автоопределение настроек прокси"); menuitem_3.setAttribute("type", "radio"); menuitem_3.setAttribute("value", "4"); menupopup_0.append(menuitem_3); var menuitem_4 = document.createXULElement("menuitem"); menuitem_4.setAttribute("label", "Использовать системные настройки прокси"); menuitem_4.setAttribute("type", "radio"); menuitem_4.setAttribute("value", "5"); menupopup_0.append(menuitem_4); var menuseparator_0 = document.createXULElement("menuseparator"); menupopup_0.append(menuseparator_0); var menuitem_5 = document.createXULElement("menuitem"); menuitem_5.setAttribute("label", "Открыть настройки прокси"); menuitem_5.addEventListener("command", function(event) { event.stopPropagation(); tbarbtns.openProxyWin(win); }); menupopup_0.append(menuitem_5); toolbarbutton_1.append(menupopup_0); toolbaritem.append(toolbarbutton_1); try { win.windowUtils.loadSheetUsingURIString(tbarbtns.btnstyle, win.windowUtils.USER_SHEET); } catch (e) {} return toolbaritem; } }); Services.prefs.addObserver("network.proxy.type", { observe: function(aSubject, aTopic, aData) { if (aData == "network.proxy.type") { let network_proxy_type = tbarbtns.network_proxy_type = Services.prefs.getIntPref(aData), getW = CustomizableUI.getWidget(id); if (getW.instances.length) for(let {node} of getW.instances) try { node.setAttribute("activated", network_proxy_type); } catch(e) {} else for (let win of CustomizableUI.windows) try { getW.forWindow(win).node.setAttribute("activated", network_proxy_type); } catch(e) {} } } }); CustomizableUI.createWidget({ id: id2, type: "custom", label: label2, tooltiptext: tooltiptext2, localized: false, defaultArea: CustomizableUI.AREA_NAVBAR, onBuild: function(document) { var win = document.defaultView, toolbarbutton = document.createXULElement("toolbarbutton"); toolbarbutton.id = id2; toolbarbutton.className = "toolbarbutton-1 chromeclass-toolbar-additional"; toolbarbutton.setAttribute("label", label2); toolbarbutton.setAttribute("context", "false"); toolbarbutton.setAttribute("tooltiptext", tooltiptext2); toolbarbutton.addEventListener("click", function(event) { if (event.button == 0) win.DownloadsPanel.showDownloadsHistory(); else if (event.button == 1) { try { Services.prefs.getComplexValue("browser.download.dir", Ci.nsIFile).launch(); } catch(e) { Services.dirsvc.get("DfltDwnld", Ci.nsIFile).launch(); } } else if (event.button == 2) { event.preventDefault(); event.stopPropagation(); try { Services.prefs.getComplexValue("browser.download.lastDir", Ci.nsIFile).launch(); } catch(e) { Services.dirsvc.get("DfltDwnld", Ci.nsIFile).launch(); } } }); toolbarbutton.style.setProperty("list-style-image", `url("${img2}")`, "important"); return toolbarbutton; } }); })(); } catch(e) {}
Отредактировано rubel (29-09-2023 08:01:19)
Отсутствует
что поправить в UCF (см. ссылку) для fx 118, чтобы вернуть интервалы (special_widget)
Если что-то не пашет, просто проверьте по ссылке в шапке, может это уже исправлено!
Проще говоря, скачайте новую версию с гитхаба. У вас старый скрипт CustomStylesScripts.jsm от 12 сентября.
Отсутствует
rubel
В ATB вроде так -> https://forum.mozilla-russia.org/viewto … 68#p804468
Win7
Отсутствует
kokoss
В ATB у меня все нормально. Именно в кнопке они сломались.
И что мне делать с тем архивом от Dumby ?
В кнопке иконки прописаны здесь:
Отредактировано rubel (30-09-2023 04:43:55)
Отсутствует
Подскажите пожалуйста, что поправить в UCF (см. ссылку) для fx 118, чтобы вернуть интервалы (special_widget), остался только растягивающийся интервал, а пробел и разделитель пропали.
Встречалось такое на этом форуме
В файле user_chrome_files\custom_scripts\CustomStylesScripts.jsm нужно раскомментировать две строки:
---------------------
// { path: "special_widget.css", type: "USER_SHEET", sheet(f) { preloadSheet(this, f); }, }, // <-- Special Widgets
---------------------
// { path: "scripts3/special_widgets.js", ucfobj: true, }, // <-- Special Widgets
---------------------
В настройках UCF включить опцию Для докум. всех окон [ChromeOnly] и перезапустить с очисткой startupCache.
Еще существует отдельный скрипт, не из состава ucf, создает как раз два пропавших элемента https://forum.ru-board.com/topic.cgi?fo … tart=80#14 , по сути это скрипт от Dumby, в который Farby встроил css-код. Активировать его можно как в ucf, так и без.
Отсутствует
Можно её переделать на onCreated(btn) {……???
/* id: id, label: label, type: "custom", localized: false, onBuild(doc) { var win = doc.defaultView, trim = doc.createXULElement("toolbaritem"); trim.id = id; trim.className = "toolbaritem-combined-buttons ucf-toolbaritem-combined-buttons chromeclass-toolbar-additional"; trim.setAttribute("label", label); trim.setAttribute("type", "custom"); trim.style.setProperty("margin-inline","0"); var trbn_1 = doc.createXULElement("toolbarbutton"); trbn_1.id = `${id}-button-menu`; trbn_1.className = "toolbarbutton-1 ucf-toolbarbutton-combined-buttons-toolbarbutton"; trbn_1.setAttribute("type", "menu"); trbn_1.setAttribute("label", ""); */ id, label, localized: false, onCreated(trbn_1) { var win = trbn_1.ownerGlobal, doc = win.document; trbn_1.setAttribute("type", "menu"); ....... /* trim.append(trbn_1); return trim; */
сломалась иконка
/* img = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 240'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(146, 69, 101);'/><path style='opacity:0.25;fill:black;' d='M 16.8,17.6 23.1,23.9 8,26 6.4,32.2 11.4,37.2 3.7,44.8 6.9,48 45,48 C 46.7,48 48,46.7 48,45 V 20 L 31.4,3.4'/><path style='fill:white;' d='M 17.4,3 C 16.7,3 16.2,3.82 16.2,4.91 V 15.9 C 16.2,17 16.7,17.8 17.4,17.8 H 30.6 C 31.3,17.8 31.8,17 31.8,15.9 V 4.91 C 31.8,3.82 31.3,3 30.6,3 H 17.4 M 22.4,20.5 V 23.7 H 6.41 V 32.2 H 9.35 V 28.2 H 22.4 V 32.4 H 25.5 V 28.2 H 38.5 V 32.4 H 41.5 V 23.7 H 25.5 V 20.5 H 22.4 M 4.23,35.1 C 3.55,35.1 3,35.9 3,37.1 V 43 C 3,44.1 3.55,45 4.23,45 H 12.1 C 12.8,45 13.3,44.1 13.3,43 V 37.1 C 13.3,35.9 12.8,35.1 12.1,35.1 H 4.23 M 19.9,35.1 C 19.2,35.1 18.7,35.9 18.7,37.1 V 43 C 18.7,44.1 19.2,45 19.9,45 H 27.8 C 28.5,45 29,44.1 29,43 V 37.1 C 29,35.9 28.5,35.1 27.8,35.1 H 19.9 M 35.9,35.1 C 35.2,35.1 34.7,35.9 34.7,37.1 V 43 C 34.7,44.1 35.2,45 35.9,45 H 43.7 C 44.4,45 45,44.1 45,43 V 37.1 C 45,35.9 44.4,35.1 43.7,35.1 H 35.9' /><rect x='0' y='48' width='48' height='48' rx='3' ry='3' style='fill:rgb(209, 8, 3);'/><path style='opacity:0.25;fill:black;' d='M 16.8,65.6 23.1,71.9 8,74 6.4,80.2 11.4,85.2 3.7,92.8 6.9,96 45,96 C 46.7,96 48,94.7 48,93 V 68 L 31.4,51.4'/><path style='fill:white;' d='M 17.4,51 C 16.7,51 16.2,51.8 16.2,52.9 V 63.9 C 16.2,65 16.7,65.8 17.4,65.8 H 30.6 C 31.3,65.8 31.8,65 31.8,63.9 V 52.9 C 31.8,51.8 31.3,51 30.6,51 H 17.4 M 22.4,68.5 V 71.7 H 6.41 V 80.2 H 9.35 V 76.2 H 22.4 V 80.4 H 25.5 V 76.2 H 38.5 V 80.4 H 41.5 V 71.7 H 25.5 V 68.5 H 22.4 M 4.23,83.1 C 3.55,83.1 3,83.9 3,85.1 V 91 C 3,92.1 3.55,93 4.23,93 H 12.1 C 12.8,93 13.3,92.1 13.3,91 V 85.1 C 13.3,83.9 12.8,83.1 12.1,83.1 H 4.23 M 19.9,83.1 C 19.2,83.1 18.8,83.9 18.8,85.1 V 91 C 18.8,92.1 19.2,93 19.9,93 H 27.8 C 28.5,93 29,92.1 29,91 V 85.1 C 29,83.9 28.5,83.1 27.8,83.1 H 19.9 M 35.9,83.1 C 35.2,83.1 34.7,83.9 34.7,85.1 V 91 C 34.7,92.1 35.2,93 35.9,93 H 43.7 C 44.4,93 45,92.1 45,91 V 85.1 C 45,83.9 44.4,83.1 43.7,83.1 H 35.9' /><rect x='0' y='96' width='48' height='48' rx='3' ry='3' style='fill:rgb(243, 135, 37);'/><path style='opacity:0.25;fill:black;' d='M 16.8,114 23.1,120 8,122 6.4,128 11.4,133 3.7,141 6.9,144 H 45 C 46.7,144 48,142.7 48,141 V 116 L 31.4,99.4'/><path style='fill:white;' d='M 17.4,99 C 16.7,99 16.2,99.8 16.2,101 V 112 C 16.2,113 16.7,114 17.4,114 H 30.6 C 31.3,114 31.8,113 31.8,112 V 101 C 31.8,99.8 31.3,99 30.6,99 H 17.4 M 22.4,117 V 120 H 6.41 V 128 H 9.35 V 124 H 22.4 V 128 H 25.5 V 124 H 38.5 V 128 H 41.5 V 120 H 25.5 V 117 H 22.4 M 4.23,131 C 3.55,131 3,132 3,133 V 139 C 3,140 3.55,141 4.23,141 H 12.1 C 12.8,141 13.3,140 13.3,139 V 133 C 13.3,132 12.8,131 12.1,131 H 4.23 M 19.9,131 C 19.2,131 18.8,132 18.8,133 V 139 C 18.8,140 19.2,141 19.9,141 H 27.8 C 28.5,141 29,140 29,139 V 133 C 29,132 28.5,131 27.8,131 H 19.9 M 35.9,131 C 35.2,131 34.7,132 34.7,133 V 139 C 34.7,140 35.2,141 35.9,141 H 43.7 C 44.4,141 45,140 45,139 V 133 C 45,132 44.4,131 43.7,131 H 35.9' /><rect x='0' y='144' width='48' height='48' rx='3' ry='3' style='fill:rgb(21, 161, 99);'/><path style='opacity:0.25;fill:black;' d='M 16.8,162 23.1,168 8,170 6.4,176 11.4,181 3.7,189 6.9,192 H 45 C 46.7,192 48,190.7 48,189 V 164 L 31.4,147'/><path style='fill:white;' d='M 17.4,147 C 16.7,147 16.2,148 16.2,149 V 160 C 16.2,161 16.7,162 17.4,162 H 30.6 C 31.3,162 31.8,161 31.8,160 V 149 C 31.8,148 31.3,147 30.6,147 H 17.4 M 22.4,165 V 168 H 6.41 V 176 H 9.35 V 172 H 22.4 V 176 H 25.5 V 172 H 38.5 V 176 H 41.5 V 168 H 25.5 V 165 H 22.4 M 4.23,179 C 3.55,179 3,180 3,181 V 187 C 3,188 3.55,189 4.23,189 H 12.1 C 12.8,189 13.3,188 13.3,187 V 181 C 13.3,180 12.8,179 12.1,179 H 4.23 M 19.9,179 C 19.2,179 18.8,180 18.8,181 V 187 C 18.8,188 19.2,189 19.9,189 H 27.8 C 28.5,189 29,188 29,187 V 181 C 29,180 28.5,179 27.8,179 H 19.9 M 35.9,179 C 35.2,179 34.7,180 34.7,181 V 187 C 34.7,188 35.2,189 35.9,189 H 43.7 C 44.4,189 45,188 45,187 V 181 C 45,180 44.4,179 43.7,179 H 35.9' /><rect x='0' y='192' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16.8,210 23.1,216 8,218 6.4,224 11.4,229 3.7,237 6.9,240 H 45 C 46.7,240 48,238.7 48,237 L 48,212 31.4,195'/><path style='fill:white;' d='M 17.4,195 C 16.7,195 16.2,196 16.2,197 V 208 C 16.2,209 16.7,210 17.4,210 H 30.6 C 31.3,210 31.8,209 31.8,208 V 197 C 31.8,196 31.3,195 30.6,195 H 17.4 M 22.4,213 V 216 H 6.41 V 224 H 9.4 V 220 H 22.4 V 224 H 25.5 V 220 H 38.5 V 224 H 41.5 V 216 H 25.5 V 213 H 22.4 M 4.23,227 C 3.55,227 3,228 3,229 V 235 C 3,236 3.55,237 4.23,237 H 12.1 C 12.8,237 13.3,236 13.3,235 V 229 C 13.3,228 12.8,227 12.1,227 H 4.23 M 19.9,227 C 19.2,227 18.7,228 18.7,229 V 235 C 18.7,236 19.2,237 19.9,237 H 27.8 C 28.5,237 29,236 29,235 V 229 C 29,228 28.5,227 27.8,227 H 19.9 M 35.9,227 C 35.2,227 34.7,228 34.7,229 V 235 C 34.7,236 35.2,237 35.9,237 H 43.7 C 44.4,237 45,236 45,235 V 229 C 45,228 44.4,227 43.7,227 H 35.9' /></g></svg>", imgmenu = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 240'><g><circle cy='24' cx='24' style='fill:rgb(146, 69, 101);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,41.8 22.3,31.1 36.7,17.9 44,25.2 C 43.5,30.6 41,37.7 33,41.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,19 H 13 L 24,30 35,19' /><circle cy='72' cx='24' style='fill:rgb(209, 8, 3);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,89.8 22.3,79.1 36.7,65.9 44,73.2 C 43.5,78.6 41,85.7 33,89.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,67 H 13 L 24,78 35,67' /><circle cy='120' cx='24' style='fill:rgb(243, 135, 37);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,138 22,127 36.7,114 44,121 C 43.5,127 40.9,134 32.8,138 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 34.9,115 H 13.1 L 24,126 34.9,115' /><circle cy='168' cx='24' style='fill:rgb(21, 161, 99);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.9,186 22,175 36.7,162 44,169 C 43.5,175 40.9,182 32.9,186 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,163 H 13 L 24,174 35,163' /><circle cy='216' cx='24' style='fill:rgb(0, 120, 173);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,234 22,223 36.7,210 44,217 C 43.5,223 40.9,230 32.8,234 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,211 H 13 L 24,222 35,211' /></g></svg>"; */ img = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 48'><view id='1' viewBox='0 48 48 48'/><view id='2' viewBox='0 96 48 48'/><view id='4' viewBox='0 144 48 48'/><view id='5' viewBox='0 192 48 48'/><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(146, 69, 101);'/><path style='opacity:0.25;fill:black;' d='M 16.8,17.6 23.1,23.9 8,26 6.4,32.2 11.4,37.2 3.7,44.8 6.9,48 45,48 C 46.7,48 48,46.7 48,45 V 20 L 31.4,3.4'/><path style='fill:white;' d='M 17.4,3 C 16.7,3 16.2,3.82 16.2,4.91 V 15.9 C 16.2,17 16.7,17.8 17.4,17.8 H 30.6 C 31.3,17.8 31.8,17 31.8,15.9 V 4.91 C 31.8,3.82 31.3,3 30.6,3 H 17.4 M 22.4,20.5 V 23.7 H 6.41 V 32.2 H 9.35 V 28.2 H 22.4 V 32.4 H 25.5 V 28.2 H 38.5 V 32.4 H 41.5 V 23.7 H 25.5 V 20.5 H 22.4 M 4.23,35.1 C 3.55,35.1 3,35.9 3,37.1 V 43 C 3,44.1 3.55,45 4.23,45 H 12.1 C 12.8,45 13.3,44.1 13.3,43 V 37.1 C 13.3,35.9 12.8,35.1 12.1,35.1 H 4.23 M 19.9,35.1 C 19.2,35.1 18.7,35.9 18.7,37.1 V 43 C 18.7,44.1 19.2,45 19.9,45 H 27.8 C 28.5,45 29,44.1 29,43 V 37.1 C 29,35.9 28.5,35.1 27.8,35.1 H 19.9 M 35.9,35.1 C 35.2,35.1 34.7,35.9 34.7,37.1 V 43 C 34.7,44.1 35.2,45 35.9,45 H 43.7 C 44.4,45 45,44.1 45,43 V 37.1 C 45,35.9 44.4,35.1 43.7,35.1 H 35.9' /><rect x='0' y='48' width='48' height='48' rx='3' ry='3' style='fill:rgb(209, 8, 3);'/><path style='opacity:0.25;fill:black;' d='M 16.8,65.6 23.1,71.9 8,74 6.4,80.2 11.4,85.2 3.7,92.8 6.9,96 45,96 C 46.7,96 48,94.7 48,93 V 68 L 31.4,51.4'/><path style='fill:white;' d='M 17.4,51 C 16.7,51 16.2,51.8 16.2,52.9 V 63.9 C 16.2,65 16.7,65.8 17.4,65.8 H 30.6 C 31.3,65.8 31.8,65 31.8,63.9 V 52.9 C 31.8,51.8 31.3,51 30.6,51 H 17.4 M 22.4,68.5 V 71.7 H 6.41 V 80.2 H 9.35 V 76.2 H 22.4 V 80.4 H 25.5 V 76.2 H 38.5 V 80.4 H 41.5 V 71.7 H 25.5 V 68.5 H 22.4 M 4.23,83.1 C 3.55,83.1 3,83.9 3,85.1 V 91 C 3,92.1 3.55,93 4.23,93 H 12.1 C 12.8,93 13.3,92.1 13.3,91 V 85.1 C 13.3,83.9 12.8,83.1 12.1,83.1 H 4.23 M 19.9,83.1 C 19.2,83.1 18.8,83.9 18.8,85.1 V 91 C 18.8,92.1 19.2,93 19.9,93 H 27.8 C 28.5,93 29,92.1 29,91 V 85.1 C 29,83.9 28.5,83.1 27.8,83.1 H 19.9 M 35.9,83.1 C 35.2,83.1 34.7,83.9 34.7,85.1 V 91 C 34.7,92.1 35.2,93 35.9,93 H 43.7 C 44.4,93 45,92.1 45,91 V 85.1 C 45,83.9 44.4,83.1 43.7,83.1 H 35.9' /><rect x='0' y='96' width='48' height='48' rx='3' ry='3' style='fill:rgb(243, 135, 37);'/><path style='opacity:0.25;fill:black;' d='M 16.8,114 23.1,120 8,122 6.4,128 11.4,133 3.7,141 6.9,144 H 45 C 46.7,144 48,142.7 48,141 V 116 L 31.4,99.4'/><path style='fill:white;' d='M 17.4,99 C 16.7,99 16.2,99.8 16.2,101 V 112 C 16.2,113 16.7,114 17.4,114 H 30.6 C 31.3,114 31.8,113 31.8,112 V 101 C 31.8,99.8 31.3,99 30.6,99 H 17.4 M 22.4,117 V 120 H 6.41 V 128 H 9.35 V 124 H 22.4 V 128 H 25.5 V 124 H 38.5 V 128 H 41.5 V 120 H 25.5 V 117 H 22.4 M 4.23,131 C 3.55,131 3,132 3,133 V 139 C 3,140 3.55,141 4.23,141 H 12.1 C 12.8,141 13.3,140 13.3,139 V 133 C 13.3,132 12.8,131 12.1,131 H 4.23 M 19.9,131 C 19.2,131 18.8,132 18.8,133 V 139 C 18.8,140 19.2,141 19.9,141 H 27.8 C 28.5,141 29,140 29,139 V 133 C 29,132 28.5,131 27.8,131 H 19.9 M 35.9,131 C 35.2,131 34.7,132 34.7,133 V 139 C 34.7,140 35.2,141 35.9,141 H 43.7 C 44.4,141 45,140 45,139 V 133 C 45,132 44.4,131 43.7,131 H 35.9' /><rect x='0' y='144' width='48' height='48' rx='3' ry='3' style='fill:rgb(21, 161, 99);'/><path style='opacity:0.25;fill:black;' d='M 16.8,162 23.1,168 8,170 6.4,176 11.4,181 3.7,189 6.9,192 H 45 C 46.7,192 48,190.7 48,189 V 164 L 31.4,147'/><path style='fill:white;' d='M 17.4,147 C 16.7,147 16.2,148 16.2,149 V 160 C 16.2,161 16.7,162 17.4,162 H 30.6 C 31.3,162 31.8,161 31.8,160 V 149 C 31.8,148 31.3,147 30.6,147 H 17.4 M 22.4,165 V 168 H 6.41 V 176 H 9.35 V 172 H 22.4 V 176 H 25.5 V 172 H 38.5 V 176 H 41.5 V 168 H 25.5 V 165 H 22.4 M 4.23,179 C 3.55,179 3,180 3,181 V 187 C 3,188 3.55,189 4.23,189 H 12.1 C 12.8,189 13.3,188 13.3,187 V 181 C 13.3,180 12.8,179 12.1,179 H 4.23 M 19.9,179 C 19.2,179 18.8,180 18.8,181 V 187 C 18.8,188 19.2,189 19.9,189 H 27.8 C 28.5,189 29,188 29,187 V 181 C 29,180 28.5,179 27.8,179 H 19.9 M 35.9,179 C 35.2,179 34.7,180 34.7,181 V 187 C 34.7,188 35.2,189 35.9,189 H 43.7 C 44.4,189 45,188 45,187 V 181 C 45,180 44.4,179 43.7,179 H 35.9' /><rect x='0' y='192' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16.8,210 23.1,216 8,218 6.4,224 11.4,229 3.7,237 6.9,240 H 45 C 46.7,240 48,238.7 48,237 L 48,212 31.4,195'/><path style='fill:white;' d='M 17.4,195 C 16.7,195 16.2,196 16.2,197 V 208 C 16.2,209 16.7,210 17.4,210 H 30.6 C 31.3,210 31.8,209 31.8,208 V 197 C 31.8,196 31.3,195 30.6,195 H 17.4 M 22.4,213 V 216 H 6.41 V 224 H 9.4 V 220 H 22.4 V 224 H 25.5 V 220 H 38.5 V 224 H 41.5 V 216 H 25.5 V 213 H 22.4 M 4.23,227 C 3.55,227 3,228 3,229 V 235 C 3,236 3.55,237 4.23,237 H 12.1 C 12.8,237 13.3,236 13.3,235 V 229 C 13.3,228 12.8,227 12.1,227 H 4.23 M 19.9,227 C 19.2,227 18.7,228 18.7,229 V 235 C 18.7,236 19.2,237 19.9,237 H 27.8 C 28.5,237 29,236 29,235 V 229 C 29,228 28.5,227 27.8,227 H 19.9 M 35.9,227 C 35.2,227 34.7,228 34.7,229 V 235 C 34.7,236 35.2,237 35.9,237 H 43.7 C 44.4,237 45,236 45,235 V 229 C 45,228 44.4,227 43.7,227 H 35.9' /></g></svg>", imgmenu = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 48'><view id='1' viewBox='0 48 48 48'/><view id='2' viewBox='0 96 48 48'/><view id='4' viewBox='0 144 48 48'/><view id='5' viewBox='0 192 48 48'/><g><circle cy='24' cx='24' style='fill:rgb(146, 69, 101);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,41.8 22.3,31.1 36.7,17.9 44,25.2 C 43.5,30.6 41,37.7 33,41.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,19 H 13 L 24,30 35,19' /><circle cy='72' cx='24' style='fill:rgb(209, 8, 3);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,89.8 22.3,79.1 36.7,65.9 44,73.2 C 43.5,78.6 41,85.7 33,89.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,67 H 13 L 24,78 35,67' /><circle cy='120' cx='24' style='fill:rgb(243, 135, 37);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,138 22,127 36.7,114 44,121 C 43.5,127 40.9,134 32.8,138 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 34.9,115 H 13.1 L 24,126 34.9,115' /><circle cy='168' cx='24' style='fill:rgb(21, 161, 99);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.9,186 22,175 36.7,162 44,169 C 43.5,175 40.9,182 32.9,186 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,163 H 13 L 24,174 35,163' /><circle cy='216' cx='24' style='fill:rgb(0, 120, 173);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,234 22,223 36.7,210 44,217 C 43.5,223 40.9,230 32.8,234 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,211 H 13 L 24,222 35,211' /></g></svg>"; ....... /* #${id}-button { list-style-image: url("${img}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-end: 0 !important; } #${id}-button-menu { list-style-image: url("${imgmenu}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-start: 0px !important; } #${id}[activated="1"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } #${id}[activated="2"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(32px, 16px, 48px, 0px) !important; } #${id}[activated="4"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(48px, 16px, 64px, 0px) !important; } #${id}[activated="5"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(64px, 16px, 80px, 0px) !important; } */ #${id}-button { list-style-image: url("${img}") !important; margin-inline-end: 0 !important; } #${id}[activated="1"] > #${id}-button { list-style-image: url("${img}#1") !important; } #${id}[activated="2"] > #${id}-button { list-style-image: url("${img}#2") !important; } #${id}[activated="4"] > #${id}-button { list-style-image: url("${img}#4") !important; } #${id}[activated="5"] > #${id}-button { list-style-image: url("${img}#5") !important; } #${id}-button-menu { list-style-image: url("${imgmenu}") !important; margin-inline-start: 0px !important; } #${id}[activated="1"] > #${id}-button-menu { list-style-image: url("${imgmenu}#1") !important; } #${id}[activated="2"] > #${id}-button-menu { list-style-image: url("${imgmenu}#2") !important; } #${id}[activated="4"] > #${id}-button-menu { list-style-image: url("${imgmenu}#4") !important; } #${id}[activated="5"] > #${id}-button-menu { list-style-image: url("${imgmenu}#5") !important; } ....... /* width: auto !important; */
Отсутствует
А куда вставлять код стилей после img = и imgmenu =
Значит с img и imgmenu понятно.
Закомментирован кусок из приведённого кода,
а далее идёт кусок кода, который предлагается вместо него.
С кодом стилей — то же самое.
Находишь в коде закомментированый кусок, и меняешь на новый.
Строка width: auto !important; (там в конце) — это третья часть.
Эту строку предлагается просто убрать, без какой-либо замены.
Отсутствует
Dumby
Как тут такое же сделать? Как здесь. Иконка прокси, чтобы "Active", "Not Active", было на первые две в иконке.
data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 48'><view id='1' viewBox='0 48 48 48'/><view id='2' viewBox='0 96 48 48'/><view id='4' viewBox='0 144 48 48'/><view id='5' viewBox='0 192 48 48'/><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(146, 69, 101);'/><path style='opacity:0.25;fill:black;' d='M 16.8,17.6 23.1,23.9 8,26 6.4,32.2 11.4,37.2 3.7,44.8 6.9,48 45,48 C 46.7,48 48,46.7 48,45 V 20 L 31.4,3.4'/><path style='fill:white;' d='M 17.4,3 C 16.7,3 16.2,3.82 16.2,4.91 V 15.9 C 16.2,17 16.7,17.8 17.4,17.8 H 30.6 C 31.3,17.8 31.8,17 31.8,15.9 V 4.91 C 31.8,3.82 31.3,3 30.6,3 H 17.4 M 22.4,20.5 V 23.7 H 6.41 V 32.2 H 9.35 V 28.2 H 22.4 V 32.4 H 25.5 V 28.2 H 38.5 V 32.4 H 41.5 V 23.7 H 25.5 V 20.5 H 22.4 M 4.23,35.1 C 3.55,35.1 3,35.9 3,37.1 V 43 C 3,44.1 3.55,45 4.23,45 H 12.1 C 12.8,45 13.3,44.1 13.3,43 V 37.1 C 13.3,35.9 12.8,35.1 12.1,35.1 H 4.23 M 19.9,35.1 C 19.2,35.1 18.7,35.9 18.7,37.1 V 43 C 18.7,44.1 19.2,45 19.9,45 H 27.8 C 28.5,45 29,44.1 29,43 V 37.1 C 29,35.9 28.5,35.1 27.8,35.1 H 19.9 M 35.9,35.1 C 35.2,35.1 34.7,35.9 34.7,37.1 V 43 C 34.7,44.1 35.2,45 35.9,45 H 43.7 C 44.4,45 45,44.1 45,43 V 37.1 C 45,35.9 44.4,35.1 43.7,35.1 H 35.9' /><rect x='0' y='48' width='48' height='48' rx='3' ry='3' style='fill:rgb(209, 8, 3);'/><path style='opacity:0.25;fill:black;' d='M 16.8,65.6 23.1,71.9 8,74 6.4,80.2 11.4,85.2 3.7,92.8 6.9,96 45,96 C 46.7,96 48,94.7 48,93 V 68 L 31.4,51.4'/><path style='fill:white;' d='M 17.4,51 C 16.7,51 16.2,51.8 16.2,52.9 V 63.9 C 16.2,65 16.7,65.8 17.4,65.8 H 30.6 C 31.3,65.8 31.8,65 31.8,63.9 V 52.9 C 31.8,51.8 31.3,51 30.6,51 H 17.4 M 22.4,68.5 V 71.7 H 6.41 V 80.2 H 9.35 V 76.2 H 22.4 V 80.4 H 25.5 V 76.2 H 38.5 V 80.4 H 41.5 V 71.7 H 25.5 V 68.5 H 22.4 M 4.23,83.1 C 3.55,83.1 3,83.9 3,85.1 V 91 C 3,92.1 3.55,93 4.23,93 H 12.1 C 12.8,93 13.3,92.1 13.3,91 V 85.1 C 13.3,83.9 12.8,83.1 12.1,83.1 H 4.23 M 19.9,83.1 C 19.2,83.1 18.8,83.9 18.8,85.1 V 91 C 18.8,92.1 19.2,93 19.9,93 H 27.8 C 28.5,93 29,92.1 29,91 V 85.1 C 29,83.9 28.5,83.1 27.8,83.1 H 19.9 M 35.9,83.1 C 35.2,83.1 34.7,83.9 34.7,85.1 V 91 C 34.7,92.1 35.2,93 35.9,93 H 43.7 C 44.4,93 45,92.1 45,91 V 85.1 C 45,83.9 44.4,83.1 43.7,83.1 H 35.9' /><rect x='0' y='96' width='48' height='48' rx='3' ry='3' style='fill:rgb(243, 135, 37);'/><path style='opacity:0.25;fill:black;' d='M 16.8,114 23.1,120 8,122 6.4,128 11.4,133 3.7,141 6.9,144 H 45 C 46.7,144 48,142.7 48,141 V 116 L 31.4,99.4'/><path style='fill:white;' d='M 17.4,99 C 16.7,99 16.2,99.8 16.2,101 V 112 C 16.2,113 16.7,114 17.4,114 H 30.6 C 31.3,114 31.8,113 31.8,112 V 101 C 31.8,99.8 31.3,99 30.6,99 H 17.4 M 22.4,117 V 120 H 6.41 V 128 H 9.35 V 124 H 22.4 V 128 H 25.5 V 124 H 38.5 V 128 H 41.5 V 120 H 25.5 V 117 H 22.4 M 4.23,131 C 3.55,131 3,132 3,133 V 139 C 3,140 3.55,141 4.23,141 H 12.1 C 12.8,141 13.3,140 13.3,139 V 133 C 13.3,132 12.8,131 12.1,131 H 4.23 M 19.9,131 C 19.2,131 18.8,132 18.8,133 V 139 C 18.8,140 19.2,141 19.9,141 H 27.8 C 28.5,141 29,140 29,139 V 133 C 29,132 28.5,131 27.8,131 H 19.9 M 35.9,131 C 35.2,131 34.7,132 34.7,133 V 139 C 34.7,140 35.2,141 35.9,141 H 43.7 C 44.4,141 45,140 45,139 V 133 C 45,132 44.4,131 43.7,131 H 35.9' /><rect x='0' y='144' width='48' height='48' rx='3' ry='3' style='fill:rgb(21, 161, 99);'/><path style='opacity:0.25;fill:black;' d='M 16.8,162 23.1,168 8,170 6.4,176 11.4,181 3.7,189 6.9,192 H 45 C 46.7,192 48,190.7 48,189 V 164 L 31.4,147'/><path style='fill:white;' d='M 17.4,147 C 16.7,147 16.2,148 16.2,149 V 160 C 16.2,161 16.7,162 17.4,162 H 30.6 C 31.3,162 31.8,161 31.8,160 V 149 C 31.8,148 31.3,147 30.6,147 H 17.4 M 22.4,165 V 168 H 6.41 V 176 H 9.35 V 172 H 22.4 V 176 H 25.5 V 172 H 38.5 V 176 H 41.5 V 168 H 25.5 V 165 H 22.4 M 4.23,179 C 3.55,179 3,180 3,181 V 187 C 3,188 3.55,189 4.23,189 H 12.1 C 12.8,189 13.3,188 13.3,187 V 181 C 13.3,180 12.8,179 12.1,179 H 4.23 M 19.9,179 C 19.2,179 18.8,180 18.8,181 V 187 C 18.8,188 19.2,189 19.9,189 H 27.8 C 28.5,189 29,188 29,187 V 181 C 29,180 28.5,179 27.8,179 H 19.9 M 35.9,179 C 35.2,179 34.7,180 34.7,181 V 187 C 34.7,188 35.2,189 35.9,189 H 43.7 C 44.4,189 45,188 45,187 V 181 C 45,180 44.4,179 43.7,179 H 35.9' /><rect x='0' y='192' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16.8,210 23.1,216 8,218 6.4,224 11.4,229 3.7,237 6.9,240 H 45 C 46.7,240 48,238.7 48,237 L 48,212 31.4,195'/><path style='fill:white;' d='M 17.4,195 C 16.7,195 16.2,196 16.2,197 V 208 C 16.2,209 16.7,210 17.4,210 H 30.6 C 31.3,210 31.8,209 31.8,208 V 197 C 31.8,196 31.3,195 30.6,195 H 17.4 M 22.4,213 V 216 H 6.41 V 224 H 9.4 V 220 H 22.4 V 224 H 25.5 V 220 H 38.5 V 224 H 41.5 V 216 H 25.5 V 213 H 22.4 M 4.23,227 C 3.55,227 3,228 3,229 V 235 C 3,236 3.55,237 4.23,237 H 12.1 C 12.8,237 13.3,236 13.3,235 V 229 C 13.3,228 12.8,227 12.1,227 H 4.23 M 19.9,227 C 19.2,227 18.7,228 18.7,229 V 235 C 18.7,236 19.2,237 19.9,237 H 27.8 C 28.5,237 29,236 29,235 V 229 C 29,228 28.5,227 27.8,227 H 19.9 M 35.9,227 C 35.2,227 34.7,228 34.7,229 V 235 C 34.7,236 35.2,237 35.9,237 H 43.7 C 44.4,237 45,236 45,235 V 229 C 45,228 44.4,227 43.7,227 H 35.9' /></g></svg>
Можно еще поменять полный путь, чтобы он брал путь с папки chrome? Полный путь не совсем удобно. А так, кнопка рабочая. Можно и по другому запускать прокси. Просто так одним кликом) И на видном месте. Как бы не обязательно.
Upd: Класс. Спасибо.
У меня в голове кроме соломы ничего не откладывается) Похоже я дровосек. А так, примеры какие-то есть, а как работает код не совсем понимаю. Хоть тут и должно бы уже придти какое никакое понимание.
Отредактировано b0ttle (01-10-2023 00:07:28)
Отсутствует
Как тут такое же сделать? Как здесь. Иконка прокси, чтобы "Active", "Not Active", было на первые две в иконке.
Не нужно тут такое же делать,
«здесь» под стиль, а «тут» ничего подобного.
Если просто эта svg'шка нравится, тогда берём первый кусок,
и используем в двух экземплярах, только с разным fill
Вот, например, с красным
(в коде заключать в "двойные" или `такие` кавычки, не в 'одинарные')
data:image/svg+xml,<svg style='fill: red;' xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3'/><path style='opacity:0.25;fill:black;' d='M 16.8,17.6 23.1,23.9 8,26 6.4,32.2 11.4,37.2 3.7,44.8 6.9,48 45,48 C 46.7,48 48,46.7 48,45 V 20 L 31.4,3.4'/><path style='fill:white;' d='M 17.4,3 C 16.7,3 16.2,3.82 16.2,4.91 V 15.9 C 16.2,17 16.7,17.8 17.4,17.8 H 30.6 C 31.3,17.8 31.8,17 31.8,15.9 V 4.91 C 31.8,3.82 31.3,3 30.6,3 H 17.4 M 22.4,20.5 V 23.7 H 6.41 V 32.2 H 9.35 V 28.2 H 22.4 V 32.4 H 25.5 V 28.2 H 38.5 V 32.4 H 41.5 V 23.7 H 25.5 V 20.5 H 22.4 M 4.23,35.1 C 3.55,35.1 3,35.9 3,37.1 V 43 C 3,44.1 3.55,45 4.23,45 H 12.1 C 12.8,45 13.3,44.1 13.3,43 V 37.1 C 13.3,35.9 12.8,35.1 12.1,35.1 H 4.23 M 19.9,35.1 C 19.2,35.1 18.7,35.9 18.7,37.1 V 43 C 18.7,44.1 19.2,45 19.9,45 H 27.8 C 28.5,45 29,44.1 29,43 V 37.1 C 29,35.9 28.5,35.1 27.8,35.1 H 19.9 M 35.9,35.1 C 35.2,35.1 34.7,35.9 34.7,37.1 V 43 C 34.7,44.1 35.2,45 35.9,45 H 43.7 C 44.4,45 45,44.1 45,43 V 37.1 C 45,35.9 44.4,35.1 43.7,35.1 H 35.9' /></g></svg>
Можно еще поменять полный путь, чтобы он брал путь с папки chrome?
Ну сколько можно одно и то же, неужели не откладывается.
/* var path = ".......\\opera-proxy.windows-386.exe"; */ var file = Services.dirsvc.get("UChrm", Ci.nsIFile); file.append("opera-proxy.windows-386.exe"); var {path} = file;
/* doreload = true, // Перезагрузить страницу img = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 240'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(146, 69, 101);'/><path style='opacity:0.25;fill:black;' d='M 16.8,17.6 23.1,23.9 8,26 6.4,32.2 11.4,37.2 3.7,44.8 6.9,48 45,48 C 46.7,48 48,46.7 48,45 V 20 L 31.4,3.4'/><path style='fill:white;' d='M 17.4,3 C 16.7,3 16.2,3.82 16.2,4.91 V 15.9 C 16.2,17 16.7,17.8 17.4,17.8 H 30.6 C 31.3,17.8 31.8,17 31.8,15.9 V 4.91 C 31.8,3.82 31.3,3 30.6,3 H 17.4 M 22.4,20.5 V 23.7 H 6.41 V 32.2 H 9.35 V 28.2 H 22.4 V 32.4 H 25.5 V 28.2 H 38.5 V 32.4 H 41.5 V 23.7 H 25.5 V 20.5 H 22.4 M 4.23,35.1 C 3.55,35.1 3,35.9 3,37.1 V 43 C 3,44.1 3.55,45 4.23,45 H 12.1 C 12.8,45 13.3,44.1 13.3,43 V 37.1 C 13.3,35.9 12.8,35.1 12.1,35.1 H 4.23 M 19.9,35.1 C 19.2,35.1 18.7,35.9 18.7,37.1 V 43 C 18.7,44.1 19.2,45 19.9,45 H 27.8 C 28.5,45 29,44.1 29,43 V 37.1 C 29,35.9 28.5,35.1 27.8,35.1 H 19.9 M 35.9,35.1 C 35.2,35.1 34.7,35.9 34.7,37.1 V 43 C 34.7,44.1 35.2,45 35.9,45 H 43.7 C 44.4,45 45,44.1 45,43 V 37.1 C 45,35.9 44.4,35.1 43.7,35.1 H 35.9' /><rect x='0' y='48' width='48' height='48' rx='3' ry='3' style='fill:rgb(209, 8, 3);'/><path style='opacity:0.25;fill:black;' d='M 16.8,65.6 23.1,71.9 8,74 6.4,80.2 11.4,85.2 3.7,92.8 6.9,96 45,96 C 46.7,96 48,94.7 48,93 V 68 L 31.4,51.4'/><path style='fill:white;' d='M 17.4,51 C 16.7,51 16.2,51.8 16.2,52.9 V 63.9 C 16.2,65 16.7,65.8 17.4,65.8 H 30.6 C 31.3,65.8 31.8,65 31.8,63.9 V 52.9 C 31.8,51.8 31.3,51 30.6,51 H 17.4 M 22.4,68.5 V 71.7 H 6.41 V 80.2 H 9.35 V 76.2 H 22.4 V 80.4 H 25.5 V 76.2 H 38.5 V 80.4 H 41.5 V 71.7 H 25.5 V 68.5 H 22.4 M 4.23,83.1 C 3.55,83.1 3,83.9 3,85.1 V 91 C 3,92.1 3.55,93 4.23,93 H 12.1 C 12.8,93 13.3,92.1 13.3,91 V 85.1 C 13.3,83.9 12.8,83.1 12.1,83.1 H 4.23 M 19.9,83.1 C 19.2,83.1 18.8,83.9 18.8,85.1 V 91 C 18.8,92.1 19.2,93 19.9,93 H 27.8 C 28.5,93 29,92.1 29,91 V 85.1 C 29,83.9 28.5,83.1 27.8,83.1 H 19.9 M 35.9,83.1 C 35.2,83.1 34.7,83.9 34.7,85.1 V 91 C 34.7,92.1 35.2,93 35.9,93 H 43.7 C 44.4,93 45,92.1 45,91 V 85.1 C 45,83.9 44.4,83.1 43.7,83.1 H 35.9' /><rect x='0' y='96' width='48' height='48' rx='3' ry='3' style='fill:rgb(243, 135, 37);'/><path style='opacity:0.25;fill:black;' d='M 16.8,114 23.1,120 8,122 6.4,128 11.4,133 3.7,141 6.9,144 H 45 C 46.7,144 48,142.7 48,141 V 116 L 31.4,99.4'/><path style='fill:white;' d='M 17.4,99 C 16.7,99 16.2,99.8 16.2,101 V 112 C 16.2,113 16.7,114 17.4,114 H 30.6 C 31.3,114 31.8,113 31.8,112 V 101 C 31.8,99.8 31.3,99 30.6,99 H 17.4 M 22.4,117 V 120 H 6.41 V 128 H 9.35 V 124 H 22.4 V 128 H 25.5 V 124 H 38.5 V 128 H 41.5 V 120 H 25.5 V 117 H 22.4 M 4.23,131 C 3.55,131 3,132 3,133 V 139 C 3,140 3.55,141 4.23,141 H 12.1 C 12.8,141 13.3,140 13.3,139 V 133 C 13.3,132 12.8,131 12.1,131 H 4.23 M 19.9,131 C 19.2,131 18.8,132 18.8,133 V 139 C 18.8,140 19.2,141 19.9,141 H 27.8 C 28.5,141 29,140 29,139 V 133 C 29,132 28.5,131 27.8,131 H 19.9 M 35.9,131 C 35.2,131 34.7,132 34.7,133 V 139 C 34.7,140 35.2,141 35.9,141 H 43.7 C 44.4,141 45,140 45,139 V 133 C 45,132 44.4,131 43.7,131 H 35.9' /><rect x='0' y='144' width='48' height='48' rx='3' ry='3' style='fill:rgb(21, 161, 99);'/><path style='opacity:0.25;fill:black;' d='M 16.8,162 23.1,168 8,170 6.4,176 11.4,181 3.7,189 6.9,192 H 45 C 46.7,192 48,190.7 48,189 V 164 L 31.4,147'/><path style='fill:white;' d='M 17.4,147 C 16.7,147 16.2,148 16.2,149 V 160 C 16.2,161 16.7,162 17.4,162 H 30.6 C 31.3,162 31.8,161 31.8,160 V 149 C 31.8,148 31.3,147 30.6,147 H 17.4 M 22.4,165 V 168 H 6.41 V 176 H 9.35 V 172 H 22.4 V 176 H 25.5 V 172 H 38.5 V 176 H 41.5 V 168 H 25.5 V 165 H 22.4 M 4.23,179 C 3.55,179 3,180 3,181 V 187 C 3,188 3.55,189 4.23,189 H 12.1 C 12.8,189 13.3,188 13.3,187 V 181 C 13.3,180 12.8,179 12.1,179 H 4.23 M 19.9,179 C 19.2,179 18.8,180 18.8,181 V 187 C 18.8,188 19.2,189 19.9,189 H 27.8 C 28.5,189 29,188 29,187 V 181 C 29,180 28.5,179 27.8,179 H 19.9 M 35.9,179 C 35.2,179 34.7,180 34.7,181 V 187 C 34.7,188 35.2,189 35.9,189 H 43.7 C 44.4,189 45,188 45,187 V 181 C 45,180 44.4,179 43.7,179 H 35.9' /><rect x='0' y='192' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16.8,210 23.1,216 8,218 6.4,224 11.4,229 3.7,237 6.9,240 H 45 C 46.7,240 48,238.7 48,237 L 48,212 31.4,195'/><path style='fill:white;' d='M 17.4,195 C 16.7,195 16.2,196 16.2,197 V 208 C 16.2,209 16.7,210 17.4,210 H 30.6 C 31.3,210 31.8,209 31.8,208 V 197 C 31.8,196 31.3,195 30.6,195 H 17.4 M 22.4,213 V 216 H 6.41 V 224 H 9.4 V 220 H 22.4 V 224 H 25.5 V 220 H 38.5 V 224 H 41.5 V 216 H 25.5 V 213 H 22.4 M 4.23,227 C 3.55,227 3,228 3,229 V 235 C 3,236 3.55,237 4.23,237 H 12.1 C 12.8,237 13.3,236 13.3,235 V 229 C 13.3,228 12.8,227 12.1,227 H 4.23 M 19.9,227 C 19.2,227 18.7,228 18.7,229 V 235 C 18.7,236 19.2,237 19.9,237 H 27.8 C 28.5,237 29,236 29,235 V 229 C 29,228 28.5,227 27.8,227 H 19.9 M 35.9,227 C 35.2,227 34.7,228 34.7,229 V 235 C 34.7,236 35.2,237 35.9,237 H 43.7 C 44.4,237 45,236 45,235 V 229 C 45,228 44.4,227 43.7,227 H 35.9' /></g></svg>", imgmenu = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='80' width='16' viewBox='0 0 48 240'><g><circle cy='24' cx='24' style='fill:rgb(146, 69, 101);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,41.8 22.3,31.1 36.7,17.9 44,25.2 C 43.5,30.6 41,37.7 33,41.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,19 H 13 L 24,30 35,19' /><circle cy='72' cx='24' style='fill:rgb(209, 8, 3);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,89.8 22.3,79.1 36.7,65.9 44,73.2 C 43.5,78.6 41,85.7 33,89.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,67 H 13 L 24,78 35,67' /><circle cy='120' cx='24' style='fill:rgb(243, 135, 37);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,138 22,127 36.7,114 44,121 C 43.5,127 40.9,134 32.8,138 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 34.9,115 H 13.1 L 24,126 34.9,115' /><circle cy='168' cx='24' style='fill:rgb(21, 161, 99);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.9,186 22,175 36.7,162 44,169 C 43.5,175 40.9,182 32.9,186 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,163 H 13 L 24,174 35,163' /><circle cy='216' cx='24' style='fill:rgb(0, 120, 173);' r='20'/><path style='opacity:0.25;fill:black;' d='M 32.8,234 22,223 36.7,210 44,217 C 43.5,223 40.9,230 32.8,234 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,211 H 13 L 24,222 35,211' /></g></svg>"; */ doreload = true; // Перезагрузить страницу var rph = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler); var r = (name, svg) => { var subst = id + "-" + name; rph.setSubstitution(subst, Services.io.newURI("data:image/svg+xml;charset=utf-8," + svg)); return `resource://${subst}/`; } var img = r("img", "<svg style='fill: context-fill;' xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3'/><path style='opacity:0.25;fill:black;' d='M 16.8,17.6 23.1,23.9 8,26 6.4,32.2 11.4,37.2 3.7,44.8 6.9,48 45,48 C 46.7,48 48,46.7 48,45 V 20 L 31.4,3.4'/><path style='fill:white;' d='M 17.4,3 C 16.7,3 16.2,3.82 16.2,4.91 V 15.9 C 16.2,17 16.7,17.8 17.4,17.8 H 30.6 C 31.3,17.8 31.8,17 31.8,15.9 V 4.91 C 31.8,3.82 31.3,3 30.6,3 H 17.4 M 22.4,20.5 V 23.7 H 6.41 V 32.2 H 9.35 V 28.2 H 22.4 V 32.4 H 25.5 V 28.2 H 38.5 V 32.4 H 41.5 V 23.7 H 25.5 V 20.5 H 22.4 M 4.23,35.1 C 3.55,35.1 3,35.9 3,37.1 V 43 C 3,44.1 3.55,45 4.23,45 H 12.1 C 12.8,45 13.3,44.1 13.3,43 V 37.1 C 13.3,35.9 12.8,35.1 12.1,35.1 H 4.23 M 19.9,35.1 C 19.2,35.1 18.7,35.9 18.7,37.1 V 43 C 18.7,44.1 19.2,45 19.9,45 H 27.8 C 28.5,45 29,44.1 29,43 V 37.1 C 29,35.9 28.5,35.1 27.8,35.1 H 19.9 M 35.9,35.1 C 35.2,35.1 34.7,35.9 34.7,37.1 V 43 C 34.7,44.1 35.2,45 35.9,45 H 43.7 C 44.4,45 45,44.1 45,43 V 37.1 C 45,35.9 44.4,35.1 43.7,35.1 H 35.9' /></g></svg>"); var imgmenu = r("imgmenu", "<svg style='fill: context-fill;' xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><circle cy='24' cx='24' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,41.8 22.3,31.1 36.7,17.9 44,25.2 C 43.5,30.6 41,37.7 33,41.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,19 H 13 L 24,30 35,19' /></g></svg>"); ....... /* #${id}-button { list-style-image: url("${img}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-end: 0 !important; } #${id}-button-menu { list-style-image: url("${imgmenu}") !important; -moz-image-region: rect(0px, 16px, 16px, 0px) !important; margin-inline-start: 0px !important; } #${id}[activated="1"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } #${id}[activated="2"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(32px, 16px, 48px, 0px) !important; } #${id}[activated="4"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(48px, 16px, 64px, 0px) !important; } #${id}[activated="5"] :-moz-any(#${id}-button,#${id}-button-menu) { -moz-image-region: rect(64px, 16px, 80px, 0px) !important; } */ #${id}-button { list-style-image: url("${img}") !important; margin-inline-end: 0 !important; } #${id}-button-menu { list-style-image: url("${imgmenu}") !important; margin-inline-start: 0px !important; } #${id}[activated="0"] :is(#${id}-button,#${id}-button-menu) { fill: rgb(146,69,101) !important; } #${id}[activated="1"] :is(#${id}-button,#${id}-button-menu) { fill: rgb(209,8,3) !important; } #${id}[activated="2"] :is(#${id}-button,#${id}-button-menu) { fill: rgb(243,135,37) !important; } #${id}[activated="4"] :is(#${id}-button,#${id}-button-menu) { fill: rgb(21,161,99) !important; } #${id}[activated="5"] :is(#${id}-button,#${id}-button-menu) { fill: rgb(0,120,173) !important; }
Отсутствует
Dumby
А как прописать такой путь "\\user_chrome_files\\_\\opera-proxy.windows-386.exe", и желательно все прописать где "var run = ...", а "var path = ..." убрать, он путает. Нашел такое решение в одном из ваших примеров.
var file = Services.dirsvc.get("UChrm", Ci.nsIFile); ["user_chrome_files","_","opera-proxy.windows-386.exe"].forEach(file.append); var {path} = file;
Отредактировано b0ttle (01-10-2023 09:31:47)
Отсутствует