darex
Скрипт для user_chrome_files, да можно.
Отсутствует
darex
для custom_script_win.js
ucf_custom_script_win.load
(this.contextmenuopenwith = { _eventlisteners: [], menupage: {}, menulink: {}, init(that) { var attrimage = true; // true или false Добавить иконки (атрибут "image") или нет var submenu = false; // true или false Добавить подменю для пунктов или нет // [true или false Показывать пункт на странице или нет, true или false Показывать пункт на ссылках или нет, 'ID пункта', 'имя приложения', 'путь к приложению', 'аргументы через пробел (то что в двойных кавычках считается за один аргумент)', 'иконка (для ОС Windows необязательно)'], var arrayWindows = [ // для Windows [true, true, 'iexplore', 'IE', 'C:\\Program Files\\Internet Explorer\\iexplore.exe', '%OpenURI'], [true, true, 'edge', 'Microsoft Edge', 'C:\\Windows\\explorer.exe', '"microsoft-edge:%OpenURI "', 'moz-icon://file://C:\\Windows\\SystemApps\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\\MicrosoftEdge.exe?size=16'], [true, true, 'potplayer', 'DAUM PotPlayer', 'C:\\Program Files\\DAUM\\PotPlayer\\PotPlayerMini64.exe', '%OpenURI'], [true, true, 'vlc', 'VLC', 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe', '%OpenURI'], ]; var arrayLinux = [ // для Linux [true, true, 'smplayer', 'SMPlayer', '/usr/bin/smplayer', '%OpenURI', 'moz-icon://stock/smplayer?size=menu'], [true, true, 'vlc', 'VLC', '/usr/bin/vlc', '%OpenURI', 'moz-icon://stock/vlc?size=menu'], [true, true, 'uget', 'uGet', '/usr/bin/uget-gtk', '%OpenURI', 'moz-icon://stock/uget-icon?size=menu'], [false, true, 'thunderbird', 'Thunderbird', '/usr/bin/thunderbird', '-compose "to=%OpenURI"', 'moz-icon://stock/thunderbird?size=menu'], ]; var arrayMacos = [ // для MacOS [true, true, 'fde', 'Firefox Developer Edition', '/usr/bin/open', '-n -a "Firefox Developer Edition" --args %OpenURI', 'moz-icon://file:///Applications/Firefox\ Developer\ Edition.app?size=16'], [true, true, 'mpv', 'MPV', '/usr/bin/open', '-n -a mpv --args %OpenURI', 'moz-icon://file:///Applications/mpv.app?size=16'], ]; var arrayOS, platform = AppConstants.platform, length; if (platform == "win") arrayOS = arrayWindows; else if (platform == "linux") arrayOS = arrayLinux; else if (platform == "macosx") arrayOS = arrayMacos; else return; if (!(length = arrayOS.length)) return; var addEventListener = this.addEventListener.bind(this); var popup = document.querySelector("#contentAreaContextMenu"); var seppage = popup.querySelector("#context-sep-selectall") || popup.querySelector("#frame-sep") || popup.lastElementChild; var seplink = popup.querySelector("#context-sep-copylink") || popup.querySelector("#context-sep-open") || popup.firstElementChild; var fragpage = document.createDocumentFragment(), fraglink = document.createDocumentFragment(), subpage = "", sublink = ""; if (length == 1) submenu = false; if (!submenu) { subpage = "Открыть страницу в "; sublink = "Открыть ссылку в "; } arrayOS.forEach(item => { var id = item[2], name = item[3], path = item[4], arg = !item[5] ? "" : item[5]; if (!id || !name || !path) return; var iconpath = !item[6] ? (`moz-icon://file://${path}?size=16`) : item[6]; if (item[0]) { let menuitem_0 = document.createXULElement("menuitem"); menuitem_0.id = `open-current-page-with-${id}`; menuitem_0.className = "menuitem-iconic open-current-page-with-application"; menuitem_0.setAttribute("label", `${subpage}${name}`); if (!submenu) menuitem_0.setAttribute("hidden", "true"); menuitem_0.applicationpath = path; menuitem_0.applicationarg = arg; if (attrimage) menuitem_0.setAttribute("image", iconpath); fragpage.append(menuitem_0); addEventListener(menuitem_0, "command", function page(event) { try { var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); file.initWithPath(target.applicationpath); if (!file.exists() || !file.isExecutable()) return; arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => { if (/%OpenURI/g.test(sp)) { let uri = gBrowser.selectedBrowser.currentURI.displaySpec; try { let _uri = ReaderMode.getOriginalUrl(uri); if (_uri) uri = Services.io.newURI(_uri).displaySpec; } catch(e) {} try { uri = decodeURIComponent(uri); } catch(e) {} return sp.replace(/^"|"$/g, "").replace("%OpenURI", uri); } return sp.replace(/^"|"$/g, ""); }) : []; var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init(file); process.runwAsync(arg, arg.length); } catch(e) {} }); } if (item[1]) { let menuitem_1 = document.createXULElement("menuitem"); menuitem_1.id = `open-link-with-${id}`; menuitem_1.className = "menuitem-iconic open-link-with-application"; menuitem_1.setAttribute("label", `${sublink}${name}`); if (!submenu) menuitem_1.setAttribute("hidden", "true"); menuitem_1.applicationpath = path; menuitem_1.applicationarg = arg; if (attrimage) menuitem_1.setAttribute("image", iconpath); fraglink.append(menuitem_1); addEventListener(menuitem_1, "command", function link(event) { try { var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); file.initWithPath(target.applicationpath); if (!file.exists() || !file.isExecutable() || !window.gContextMenu?.linkURI?.displaySpec) return; arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => { if (/%OpenURI/g.test(sp)) { let uri = gContextMenu.linkURI.displaySpec; try { let _uri = ReaderMode.getOriginalUrl(uri); if (_uri) uri = Services.io.newURI(_uri).displaySpec; } catch(e) {} try { uri = decodeURIComponent(uri); } catch(e) {} return sp.replace(/^"|"$/g, "").replace("%OpenURI", uri); } return sp.replace(/^"|"$/g, ""); }) : []; var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init(file); process.runwAsync(arg, arg.length); } catch(e) {} }); } }); that.unloadlisteners.push("contextmenuopenwith"); if (!submenu) { seppage.after(fragpage); seplink.before(fraglink); addEventListener(popup, "popupshowing", e => { if (e.target != popup || gContextMenu.webExtBrowserType === "popup") return; var link = gContextMenu.onLink || gContextMenu.onMailtoLink; for(let arr of this._eventlisteners) { if (arr[2].name === "page") arr[0].hidden = link; else if (arr[2].name === "link") arr[0].hidden = !link; } }); addEventListener(popup, "popuphiding", e => { if (e.target != popup) return; for(let arr of this._eventlisteners) { if (arr[1] === "command") arr[0].hidden = true; } }); } else { if (fragpage.children.length) { let menu = this.menupage = document.createXULElement("menu"); menu.id = "open-current-page-with-submenu"; menu.className = "menu-iconic open-current-page-with-application"; menu.setAttribute("label", "Открыть страницу в..."); menu.setAttribute("hidden", "true"); let menupopup = document.createXULElement("menupopup"); menupopup.append(fragpage); menu.append(menupopup); seppage.after(menu); } if (fraglink.children.length) { let menu = this.menulink = document.createXULElement("menu"); menu.id = "open-link-with-submenu"; menu.className = "menu-iconic open-link-with-application"; menu.setAttribute("label", "Открыть ссылку в..."); menu.setAttribute("hidden", "true"); let menupopup = document.createXULElement("menupopup"); menupopup.append(fraglink); menu.append(menupopup); seplink.before(menu); } addEventListener(popup, "popupshowing", e => { if (e.target != popup || gContextMenu.webExtBrowserType === "popup") return; var link = gContextMenu.onLink || gContextMenu.onMailtoLink; this.menupage.hidden = link; this.menulink.hidden = !link; }); addEventListener(popup, "popuphiding", e => { if (e.target != popup) return; this.menupage.hidden = true; this.menulink.hidden = true; }); } }, addEventListener(...arr) { var elm = arr[0]; if (!elm) return; elm.addEventListener(...arr.slice(1)); this._eventlisteners.push(arr); }, destructor() { for(let arr of this._eventlisteners) arr.shift().removeEventListener(...arr); delete this._eventlisteners; } }).init(this);
Отредактировано Vitaliy V. (14-04-2021 11:48:01)
Отсутствует
где user_chrome_files сохраняет настройки?
где и браузер - prefs.js, about:config
начинаются с extensions.user_chrome_files.
Отсутствует
для custom_script_win.js:
Тоже забрал, спасибо! А то как-то непривычно без Internet Explorer в конт. меню после 68 версии.
Виталий, ну подскажите, как в about:addons правильно поднять секцию дополнений, тем и плагинов вверх, вплоть до того, чтоб не было видно надпись "Включены".
Я пытался, вроде получилось, но код конечно какой-то дюже подозрительный получился. Может есть более грамотное решение? Спасибо.
#main > div:nth-child(1) > addon-list:nth-child(1) > section:nth-child(2) { margin-top: -40px !important; }
Вроде разобрался, код можно сократить до #main {margin-top: -40px !important;} Но если есть лучше решение, буду благодарен.
Отредактировано sandro79 (06-07-2020 01:09:08)
Отсутствует
Нужна дополнительная панель снизу. Что-нибудь попроще.
Готовый комплект user_chrome_files или addonbar_old.uc.js + method 2.
Проще решения не существует.
Отсутствует
sandro79
Добавить это в стиль перед последней скобкой
addon-list > section[section="0"] > .list-section-heading { min-height: 0 !important; max-height: 0 !important; overflow: hidden !important; margin-top: 0px !important; margin-bottom: 0px !important; } addon-list > section:not([section="0"]) > .list-section-heading { margin-top: 5px !important; margin-bottom: 0px !important; } .main-search { padding-top: 5px !important; padding-bottom: 5px !important; } .main-heading { padding-top: 0 !important; padding-bottom: 5px !important; }
Отредактировано Vitaliy V. (06-07-2020 10:44:44)
Отсутствует
Их надо как-то объединить?
Ну конечно. CB не пользуюсь, но думаю можно добавить код config.js от user_chrome_files после кода для CB.
У меня config.js от user_chrome_files прописан после этого кода.
Отсутствует
Ну конечно. CB не пользуюсь, но думаю можно добавить код config.js от user_chrome_files после кода для CB.
Да какая разница куда, у меня перед CB и после других скриптов...
Отсутствует
После последнего обновления Firefox в контекстном меню табов пункты "Закрыть вкладки справа" и т.п. объединились в группу "Закрыть несколько вкладок".
Может быть кто подскажет как избавиться от этой вложенности и вернуть как было раньше. Или хотя бы как перенести один пункт "Закрыть вкладки справа" на уровень выше (как скрыть всю группу я разобрался).
Отсутствует
Vitaliy V. У меня вопрос по вашему скрипту https://forum.mozilla-russia.org/viewtopic.php?pid=782454#p782454. если указать var submenu = true; в контекстном меню появляется пункт открыть страницу в ... Как к этому пункту прилепить иконку?
Желательно в base64
Отредактировано sachka (07-07-2020 15:44:13)
Отсутствует
sachka
Для пунктов menu открыть страницу и ссылку
#contentAreaContextMenu > menu.open-current-page-with-application { list-style-image: url("Иконка") !important; } #contentAreaContextMenu > menu.open-link-with-application { list-style-image: url("Иконка") !important; }
Отсутствует
В about:config спрятал на странице "about:preferences" поисковую строку: user_pref("browser.preferences.search", false);
В policies.json отключил "extensions.getAddons.showPane": false, "extensions.htmlaboutaddons.recommendations.enabled": false.
Но не нашёл как в about:config спрятать поисковую строку на странице "about:addons". Тогда использовал этот стиль, чтобы спрятать поиск дополнений:
@-moz-document url("about:addons"), url("chrome://mozapps/content/extensions/aboutaddons.html") { #header, .main-search { display: none !important; } }
Подскажите, пожалуйста, как можно чуть ниже опустить надпись "Управление моими расширениями"? Чтобы она не была впритык в адресной панели. Спасибо!
Отсутствует
Подскажите, пожалуйста, как можно чуть ниже опустить надпись "Управление моими расширениями"?
Вместе со скрыть поиск:
@-moz-document url("about:addons"), url("chrome://mozapps/content/extensions/aboutaddons.html") { #header, .main-search { display: none !important; } .sticky-container > .main-heading { margin-top: 12px !important; } .list-section-heading { margin-top: -6px !important; } }
С дефолтным стилем Vitaliy V. получилось так:
@-moz-document url("about:addons"), url-prefix("chrome://mozapps/content/extensions/") { :root { --v-main-section-width: 1920px !important; --section-width: 800px !important; --main-margin-start: 16px !important; --in-content-sidebar-width: 200px !important; --card-padding: 8px !important; --addon-icon-size: 32px !important; } @media (max-width: 830px) { :root { --in-content-sidebar-width: 70px !important; } } #main { margin-inline-start: var(--main-margin-start) !important; margin-inline-end: var(--main-margin-start) !important; margin-bottom: var(--main-margin-start) !important; max-width: var(--v-main-section-width) !important; } .main-search { padding-inline-start: var(--main-margin-start) !important; } #main div[current-view="detail"] { max-width: var(--section-width) !important; } .sidebar-footer-list, #categories > .category { margin-inline-start: 18px !important; } addon-list > section { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; align-items: start !important; grid-template-areas: "a a a" !important; gap: 10px !important; } addon-list > section > .list-section-heading { grid-area: a !important; } @media (max-width: 1100px) { addon-list > section { grid-template-columns: repeat(2, 1fr) !important; grid-template-areas: "a a" !important; } } @media (max-width: 670px) { addon-list > section { grid-template-columns: 1fr !important; grid-template-areas: "a" !important; } } addon-list[type="theme"] > section[section="0"] { grid-template-columns: minmax(300px, 800px) !important; grid-template-areas: "a" !important; } addon-card, addon-card .card { margin: 0 !important; } addon-card .more-options-button, addon-card input[type="checkbox"].toggle-button { min-width: var(--button-width, 24px) !important; } .card-heading-image { width: calc(2 * var(--card-padding) + 100%) !important; height: auto !important; margin: calc(-1 * var(--card-padding)) calc(-1 * var(--card-padding)) calc(var(--card-padding) / 2) !important; } addon-list > section[section="0"] > .list-section-heading { min-height: 0 !important; max-height: 0 !important; overflow: hidden !important; margin-top: 10px !important; margin-bottom: 10px !important; } addon-list > section:not([section="0"]) > .list-section-heading { margin-top: 5px !important; margin-bottom: 0px !important; } .main-search { padding-top: 5px !important; padding-bottom: 5px !important; } .main-heading { padding-top: 0 !important; padding-bottom: 5px !important; } .addon-detail-description, .sticky-container > .main-search { display: none !important; } }
Отредактировано sandro79 (07-07-2020 22:32:52)
Отсутствует
С дефолтным стилем Vitaliy V. получилось так:
Vitaliy V., sandro79, спасибо. Только интересно почему у меня и слово Включины исчезло? Или ты ещё внес правку в стиль?
Отсутствует
Только интересно почему у меня и слово Включины исчезло? Или ты ещё внес правку в стиль?
Попробуйте изменить код в стиле:
addon-list > section[section="0"] > .list-section-heading { min-height: 0 !important; max-height: 0 !important; overflow: hidden !important; margin-top: 10px !important; margin-bottom: 10px !important; }
addon-list > section[section="0"] > .list-section-heading { min-height: 10 !important; max-height: 10 !important; overflow: hidden !important; margin-top: 0px !important; margin-bottom: 0px !important; }
Отредактировано kokoss (08-07-2020 00:33:08)
Отсутствует
спасибо!
sandro79 пишетС дефолтным стилем Vitaliy V. получилось так:
Vitaliy V., sandro79, спасибо. Только интересно почему у меня и слово Включины исчезло? Или ты ещё внес правку в стиль?
Это "Включены", как по мне, там не нужно, и так понятно что включены. Выключены осталось.
В дефолтный стиль я правку не вносил , а в тот, что под последним спойлером - да, немного подкручено, об этом говорит надпись на спойлере.
Попробуйте изменить код в стиле:
Да чего там пробовать, если нужно Включено, то это нужно из кода выше изъять.
Отредактировано sandro79 (08-07-2020 01:23:11)
Отсутствует
Подскажите как исправить код (раньше работал на 68) сейчас 78.0.1 esr:
/*--------Скруглить панель адреса и поиска--------*/ #urlbar, #searchbar, .searchbar-textbox {border-radius: 16px !important;}
Раздельные строки адреса и поиска. Строку поиска закругляет, а строку адреса нет. В чём дело?
Отсутствует