Полезная информация

В мире Mozilla происходит много интересных событий. Но вам не нужно постоянно посещать новостные сайты, чтобы быть в курсе всех изменений. Зайдите на ленту новостей Mozilla Россия.

№102631-07-2023 08:31:17

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 2156
UA: Firefox 78.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dobrov пишет

имена функций остаются в постфиксом ОС: Digit1_I_macosx(e, t)……

Имена функций значения не имеют, их вызов идёт без участия имени.
Функция перекочёвывает в массив,
а когда e.code и сумма модификаторов совпадает с нажатыми клавишами,
извлекается деструктурирующим присваиванием for(var [func, p, i] of data)

Перехват клавиш может не сработать ??? если нет нажатия управляющих клавиш: Digit1_macosx

Если отказаться от удаления ОС из свойств объекта, то будет работать неправильно.
Из-за того, что re был изменён с /(\d+)?(i)?/i на /(\d+)?([a-z]+)?/i
флаг полей ввода пропишется как ноль, то есть — только в полях ввода,
а должен быть минус единица, то есть — всегда.

пробовал убрать, создав копию свойства объекта, но не работает

Да вроде работает как написано, свойство Digit1_I_win успешно заменяется на Digit1_I
но имя самой функции, на которую ссылается klaBa.Digit1_I
при этом, конечно же, не меняется, остаётся Digit1_I_win

Отсутствует

 

№102702-08-2023 10:54:06

Black_Monk
Участник
 
Группа: Members
Зарегистрирован: 18-02-2012
Сообщений: 194
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

После установки 116-й версии в очередной раз исчезла нижняя панель. :( Специалисты, подскажите как опять её вернуть-то? Пробовал вот это, но не помогло. Может надо версию обновить? У меня в version.txt прописано: "версия, дата г-м-д: 2021-9-23".


Windows 10 LTSC

Отсутствует

 

№102802-08-2023 11:33:03

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 1734
UA: Firefox 115.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Black_Monk пишет

Пробовал вот это, но не помогло

проверяйте

Выделить код

Код:

toolbarpaletteitem[place="palette"] > toolbaritem.ucf-additional-springs {
    background: white url("./svg/spring.svg") center no-repeat;
    border: none;
    outline: 1px solid currentColor;
    outline-offset: -1px;
    min-height: 37px;
    opacity: 0.3;
}
toolbarpaletteitem[place="toolbar"] > toolbaritem.ucf-additional-springs,
toolbarpaletteitem[place="panel"] > toolbaritem.ucf-additional-springs,
toolbarpaletteitem[place="menu-panel"] > toolbaritem.ucf-additional-springs {
    background: white url("./svg/spring.svg") center no-repeat;
    border: none;
    min-width: 34px;
    min-height: 14px;
    outline: 1px solid currentColor;
    outline-offset: -1px;
    margin-block: 2px !important;
    margin-inline: 1px !important;
    opacity: 0.3;
}
toolbarpaletteitem[place="palette"][id*="ucf-additional-top-spring"],
toolbarpaletteitem[place="palette"][id*="ucf-additional-vertical-spring"],
toolbarpaletteitem[place="palette"][id*="ucf-additional-bottom-spring"] {
    vertical-align: top;
}
toolbarpaletteitem[place] > toolbaritem.ucf-additional-springs {
    -moz-window-dragging: no-drag !important;
}
#ucf-restart-app {
    list-style-image: url("./svg/restart-app-16.svg") !important;
    fill: #f38725 !important;
}
#ucf-additional-vertical-toggle-button {
    list-style-image: url("./svg/vert-toolbar.svg") !important;
}
#ucf-additional-top-toggle-button {
    list-style-image: url("./svg/top-toolbar.svg") !important;
}
#ucf-additional-bottom-toggle-button {
    list-style-image: url("./svg/bottom-toolbar.svg") !important;
}
#ucf-view-history-sidebar-button {
    list-style-image: url("./svg/history-16.svg") !important;
}
#ucf-view-bookmarks-sidebar-button {
    list-style-image: url("./svg/bookmark-16.svg") !important;
}
#ucf-open-directories-button {
    list-style-image: url("./svg/user-home-16.svg") !important;
}
#browser-bottombox:not([lwthemefooter="true"]):-moz-lwtheme {
    background-color: transparent !important;
}
#ucf-additional-vertical-box {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    position: relative !important;
    z-index: 3 !important;
    margin: -1px 0 !important;
}
#ucf-additional-top-bar,
#ucf-additional-vertical-bar,
#ucf-additional-bottom-bar {
    -moz-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    border-block: none !important;
    overflow: -moz-hidden-unscrollable;
    overflow: clip;
}
#ucf-additional-bottom-bar {
    border-top: 1px solid var(--chrome-content-separator-color, var(--toolbox-border-bottom-color, rgba(0,0,0,0.1))) !important;
}
#ucf-additional-bottom-bar #ucf-additional-bottom-closebutton {
    margin: 0 var(--toolbarbutton-outer-padding, 1px) !important;
    padding: var(--toolbarbutton-inner-padding, 4px) !important;
}
#ucf-additional-bottom-bar #ucf-additional-bottom-closebutton .toolbarbutton-icon {
    margin: 0 !important;
    padding: 0 !important;
    height: 16px !important;
    width: 16px !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar,
#ucf-additional-bottom-bar {
    -moz-window-dragging: no-drag !important;
    background-clip: border-box !important;
    background-origin: border-box !important;
    background-color: var(--toolbar-bgcolor, -moz-Dialog) !important;
    background-image: var(--toolbar-bgimage, linear-gradient(rgba(255,255,255,.15), rgba(255,255,255,.15))) !important;
    color: var(--toolbar-color, -moz-DialogText) !important;
    border-inline: none !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar {
    padding: 1px 0 !important;
    margin: 0 !important;
    font-size: 1rem !important;
    min-width: 20px !important;
    width: auto !important;
    flex-grow: 1 !important;
    align-items: stretch !important;
    justify-content: start !important;
    flex-direction: column !important;
}
:root:-moz-lwtheme[style*="--lwt-additional-images"] #navigator-toolbox {
    background-attachment: fixed !important;
}
#ucf-additional-vertical-box:-moz-lwtheme > #ucf-additional-vertical-bar,
#ucf-additional-bottom-bar:-moz-lwtheme {
    color: var(--toolbar-color, inherit) !important;
    background-repeat: no-repeat, var(--lwt-background-tiling, repeat-y) !important;
    background-size: auto auto !important;
    background-attachment: fixed !important;
    background-position: right top, var(--lwt-background-alignment, right top) !important;
    background-color: transparent !important;
    background-image: linear-gradient(var(--toolbar-bgcolor, rgba(255,255,255,.4)), var(--toolbar-bgcolor, rgba(255,255,255,.4))), var(--lwt-header-image, var(--lwt-additional-images, none)) !important;
}
:root[lwtheme-image="true"] #ucf-additional-vertical-box:-moz-lwtheme > #ucf-additional-vertical-bar,
:root[lwtheme-image="true"] #ucf-additional-bottom-bar:-moz-lwtheme {
    background-repeat: no-repeat, repeat-y !important;
}
:root #browser-bottombox[lwthemefooter="true"] #ucf-additional-bottom-bar:-moz-lwtheme {
    background-repeat: initial !important;
    background-attachment: initial !important;
    background-position: initial !important;
    background-color: var(--toolbar-bgcolor, rgba(255,255,255,.4)) !important;
    background-image: none !important;
}
#ucf-additional-vertical-box[vertautohide="true"]:-moz-lwtheme > #ucf-additional-vertical-bar {
    background-color: var(--lwt-accent-color, white) !important;
}
#ucf-additional-vertical-box[vertautohide="true"]:-moz-lwtheme-brighttext > #ucf-additional-vertical-bar {
    background-color: var(--lwt-accent-color, black) !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    border-inline-end: 1px solid var(--chrome-content-separator-color, var(--toolbox-border-bottom-color, rgba(0,0,0,0.1))) !important;
}
#ucf-additional-vertical-box[v_vertical_bar_start="false"] > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    border-inline-end: none !important;
    border-inline-start: 1px solid var(--chrome-content-separator-color, var(--toolbox-border-bottom-color, rgba(0,0,0,0.1))) !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar[collapsed="true"] {
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > toolbaritem.toolbaritem-combined-buttons {
    flex-direction: column !important;
    margin-inline: 0 !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > toolbaritem.toolbaritem-combined-buttons > toolbarbutton.toolbarbutton-combined > .toolbarbutton-text {
    padding-inline: 1px !important;
    margin-inline: 0 !important;
    min-width: 0 !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > toolbaritem.toolbaritem-combined-buttons separator {
    display: none !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > toolbarspring {
	min-width: 0 !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > toolbarseparator {
    -moz-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    margin: 2px !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-top: 1px solid currentColor !important;
    width: auto !important;
    max-width: none !important;
    height: 5px !important;
    min-height: 5px !important;
    max-height: 5px !important;
    opacity: 0.3 !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > toolbarspacer {
	height: 15px !important;
}
#ucf-additional-vertical-container {
    display: flex !important;
}
#ucf-additional-vertical-container[vertautohide="true"] {
    position: relative !important;
    min-width: 100px !important;
    width: 100px !important;
    max-width: 100px !important;
    overflow: visible !important;
    margin-inline-start: 0 !important;
    margin-inline-end: -100px !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
#ucf-additional-vertical-container[vertautohide="true"][v_vertical_bar_start="false"] {
    margin-inline-start: -100px !important;
    margin-inline-end: 0 !important;
}
#ucf-additional-vertical-box[vertautohide="true"] {
    position: absolute !important;
    display: block !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    font-size: 0px !important;
}
#ucf-additional-vertical-box[vertautohide="true"][v_vertical_bar_start="false"],
#ucf-additional-vertical-box[vertautohide="true"]:-moz-locale-dir(rtl) {
    left: auto !important;
    right: 0 !important;
}
#ucf-additional-vertical-box[vertautohide="true"][v_vertical_bar_start="false"]:-moz-locale-dir(rtl) {
    left: 0 !important;
    right: auto !important;
}
#ucf-additional-vertical-box[vertautohide="true"] > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    left: calc(-1 * (100% - 5px));
    right: auto;
    opacity: 0;
    animation-name: toolbar-hide !important;
    animation-timing-function: linear !important;
    animation-duration: 0.2s !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-property: opacity !important;
    transition-timing-function: step-start !important;
    transition-duration: 0s !important;
    transition-delay: 0.2s !important;
    pointer-events: auto !important;
    height: 100% !important;
    visibility: visible !important;
    position: relative !important;
}
#ucf-additional-vertical-box[vertautohide="true"]:-moz-locale-dir(rtl) > #ucf-additional-vertical-bar:not([collapsed="true"]),
#ucf-additional-vertical-box[vertautohide="true"][v_vertical_bar_start="false"] > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    left: auto;
    right: calc(-1 * (100% - 5px));
    animation-name: toolbar-hide-rtl !important;
}
#ucf-additional-vertical-box[vertautohide="true"][v_vertical_bar_start="false"]:-moz-locale-dir(rtl) > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    left: calc(-1 * (100% - 5px));
    right: auto;
    animation-name: toolbar-hide !important;
}
#ucf-additional-vertical-container > #ucf-additional-vertical-box[vertautohide="true"][v_vertical_bar_visible] > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    left: 0px;
    right: auto;
    opacity: 1;
    animation-name: toolbar-visible !important;
    transition-delay: 0s !important;
}
#ucf-additional-vertical-container > #ucf-additional-vertical-box[vertautohide="true"]:-moz-locale-dir(rtl)[v_vertical_bar_visible] > #ucf-additional-vertical-bar:not([collapsed="true"]),
#ucf-additional-vertical-container > #ucf-additional-vertical-box[vertautohide="true"][v_vertical_bar_start="false"][v_vertical_bar_visible] > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    left: auto;
    right: 0px;
    animation-name: toolbar-visible-rtl !important;
}
#ucf-additional-vertical-container > #ucf-additional-vertical-box[vertautohide="true"][v_vertical_bar_start="false"]:-moz-locale-dir(rtl)[v_vertical_bar_visible] > #ucf-additional-vertical-bar:not([collapsed="true"]) {
    left: 0px;
    right: auto;
    animation-name: toolbar-visible !important;
}
@keyframes toolbar-hide {
    from {
        left: 0px;
    }
    to {
        left: calc(-1 * (100% - 5px));
    }
}
@keyframes toolbar-hide-rtl {
    from {
        right: 0px;
    }
    to {
        right: calc(-1 * (100% - 5px));
    }
}
@keyframes toolbar-visible {
    from {
        left: calc(-1 * (100% - 5px));
    }
    to {
        left: 0px;
    }
}
@keyframes toolbar-visible-rtl {
    from {
        right: calc(-1 * (100% - 5px));
    }
    to {
        right: 0px;
    }
}
:root[inDOMFullscreen] #ucf-additional-vertical-box > #ucf-additional-vertical-bar:not([collapsed="true"]),
:root[inFullscreen]:not([OSXLionFullscreen]) #ucf-additional-vertical-box > #ucf-additional-vertical-bar:not([collapsed="true"]):not([fullscreentoolbar="true"]),
#ucf-additional-bottom-bar[collapsed="true"][customizable="true"][customizing="true"] {
    visibility: collapse !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > #personal-bookmarks {
    width: 0 !important;
    flex-grow: 0 !important;
    margin: 0 !important;
}
#ucf-additional-vertical-box > #ucf-additional-vertical-bar > #search-container {
    width: 0 !important;
    max-height: 0 !important;
    overflow-y: visible !important;
    flex-grow: 0 !important;
    min-width: 80px !important;
    margin: 0 !important;
}
:root[chromehidden~="location"][chromehidden~="toolbar"] #ucf-additional-vertical-container {
    display: none !important;
}
@supports (fill: color-mix(in srgb, currentColor 20%, transparent)) {
    #ucf-restart-app {
        fill: color-mix(in srgb, currentColor 20%, #f38725) !important;
    }
}


Win7

Отсутствует

 

№102902-08-2023 11:48:20

Black_Monk
Участник
 
Группа: Members
Зарегистрирован: 18-02-2012
Сообщений: 194
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

kokoss, у меня vertical_top_bottom_bar.css аналогичный, но нижней панели нет. :|


Windows 10 LTSC

Отсутствует

 

№103002-08-2023 12:21:36

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 1734
UA: Firefox 115.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Black_Monk
Эту правку -> https://forum.mozilla-russia.org/viewto … 91#p802991 делали?
2023-08-02_123214.png

Отредактировано kokoss (02-08-2023 12:37:16)


Win7

Отсутствует

 

№103102-08-2023 12:49:32

Black_Monk
Участник
 
Группа: Members
Зарегистрирован: 18-02-2012
Сообщений: 194
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

kokoss пишет

Black_Monk
Эту правку -> https://forum.mozilla-russia.org/viewto … 91#p802991 делали?

Этот блок у меня в vertical_top_bottom_bar.js уже есть...

Отредактировано Black_Monk (02-08-2023 12:51:31)


Windows 10 LTSC

Отсутствует

 

№103202-08-2023 16:04:15

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 2156
UA: Firefox 78.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

kokoss
Теоретически, не исключён вариант, что Black_Monk
в UCF пользуется только нижним тулбаром и ничем другим,
поэтому про него и говорит, то есть как-бы ложный акцент.


Если предположение верно, тогда мог просто накрыться сам UCF,
и тулбар, соответственно, вместе с ним.
В таком случае, можно предложить почитать отсюда.


Ну, и ещё, напомнить, что лучше заранее удалить
импорт модуля Services.jsm а то в 117 опять будет проблема.

Отсутствует

 

№103302-08-2023 16:36:35

Black_Monk
Участник
 
Группа: Members
Зарегистрирован: 18-02-2012
Сообщений: 194
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dumby пишет

Теоретически, не исключён вариант, что Black_Monk
в UCF пользуется только нижним тулбаром и ничем другим,

Да, так и есть...

Dumby пишет

В таком случае, можно предложить почитать отсюда.

Да помогло, огромное спасибо. И vertical_top_bottom_bar.css не пришлось править...

Dumby пишет

лучше заранее удалить
импорт модуля Services.jsm а то в 117 опять будет проблема.

А это как сделать? Я честно говоря, даже не понял о чём вы... :)

Отредактировано Black_Monk (02-08-2023 16:37:03)


Windows 10 LTSC

Отсутствует

 

№103402-08-2023 16:48:45

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 1734
UA: Firefox 115.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dumby

Dumby пишет

В таком случае, можно предложить почитать отсюда.

У меня без этой правки не работал UCF, а у него только нижняя панель, поэтому даже не подумал про эту правку!


Win7

Отсутствует

 

№103502-08-2023 17:40:45

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 1734
UA: Firefox 115.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Black_Monk пишет

А это как сделать? Я честно говоря, даже не понял о чём вы...

Видимо про это -> var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");


Win7

Отсутствует

 

№103602-08-2023 18:32:30

unter_officer
Участник
 
Группа: Members
Откуда: Санкт-Петербург
Зарегистрирован: 27-03-2011
Сообщений: 541
UA: Firefox 115.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

kokoss пишет

Видимо про это -> var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");

А если так: ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
Тоже удалять?


«The Truth Is Out There»

Отсутствует

 

№103702-08-2023 18:42:36

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 1734
UA: Firefox 115.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

unter_officer пишет

А если так: ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
Тоже удалять?

Откуда ж мне знать, у меня нет [firefox] 117!


Win7

Отсутствует

 

№103802-08-2023 20:33:38

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 2156
UA: Firefox 78.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

unter_officer пишет

А если так: ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
Тоже удалять?

Конечно удалять. По этому адресу теперь больше ничего нет.
Обратишься к такому геттеру — получишь ошибку NS_ERROR_FILE_NOT_FOUND


Если сомнение в том, а как же совместимость кода с лисицами древнее чем 104,
тогда можно задвинуть импорт какой-нибудь проверкой, например, globalThis.Services


Ещё возможен кейс, где импорт идёт через Cu.import() и не по назначению, а для получения NSVO
Это невозможно уже со 102-ой, но сам код мог ещё как-то, неправильно, но работать.
А теперь вообще откажет. В этом случае, простое удаление не поможет, нужно искать замену,
например, перенести в SystemGlobal

Отсутствует

 

№103902-08-2023 22:08:16

unter_officer
Участник
 
Группа: Members
Откуда: Санкт-Петербург
Зарегистрирован: 27-03-2011
Сообщений: 541
UA: Firefox 115.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dumby пишет

Конечно удалять. По этому адресу теперь больше ничего нет.
Обратишься к такому геттеру — получишь ошибку NS_ERROR_FILE_NOT_FOUND

Dumby, спасибо.


Правда я пока не планирую переходить на Windows 10+, поэтому FF117+ мне не грозит.
Но взял на заметку. Мало ли в будущем все-таки придется пересесть на Windows 10+.


«The Truth Is Out There»

Отсутствует

 

№104003-08-2023 07:18:40

Black_Monk
Участник
 
Группа: Members
Зарегистрирован: 18-02-2012
Сообщений: 194
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dumby, kokoss, спасибо за помощь...


Windows 10 LTSC

Отсутствует

 

№104103-08-2023 11:29:17

Dobrov
Участник
 
Группа: Members
Зарегистрирован: 04-10-2011
Сообщений: 416
UA: Firefox 97.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

to_Alls свёл в один скрипт перехват нажатий клавиш от Dumby (немного изменил), может пригодиться!

синтаксис: Имя(_mod)(_OS) справка в коде

Выделить код

Код:

(async anim => { // Для докум. окна браузера [ChromeOnly]

var klaBa = { /* блок перехвата нажатиий клавиш
синтаксис: Имя[_mod][_OS](e,t){код} e = Event, t = gBrowser.selectedTab

Откройте боковую панель и смотрите коды нажатий клавиш в консоли
имя со строчной буквы: передавать нажатия окну, запрет preventDefault()
mod содержит «I» — запуск только в полях ввода, «i» кроме полей ввода
отделять «_» от кода клавиши при наличии модификаторов и/или «iI»-флага
OS только для указанной системы: KeyA_1i_win(e,t){… //Alt+A для Windows
Ссылка: "имя нужной функции": digit1() {код}, numpad1: "digit1"
*/
	Digit1() {
		console.log("Digit1 Page+Input");
	},
	digit2() {
		console.log("digit2 skip preventDefault");
	},
	Digit3_I() {
		console.log("Digit3 Only Input");
	},
	Digit4_i() {
		console.log("Digit4 Skip Input");
	},
	Digit5: "Digit1", //ссылка на функцию
	Digit6_win(e, t) {
		console.log("Digit6_I Windows Only");
	},
	Digit6_linux(e, t) {
		console.log("Digit6_I Linux Only");
	},
};
((obj, re, reos, del) => { // парсинг блока клавиш ускоряет обработку нажатий
	var {platform} = AppConstants, num = -platform.length - 1;
	for(var p in klaBa) reos.test(p) && del.add( p.endsWith(platform) ? p.slice(0, num) : p);
	for(var p in klaBa) del.has(klaBa[p]) && del.add(p);
	for(var d of del) delete klaBa[d]; //есть Key_OS ? удалить имена-клоны
	for(var p in klaBa)
		if (reos.test(p)) { //убрать имя вашей ОС из свойства
			klaBa[p.replace(reos,'')] = klaBa[p]; delete klaBa[p];}

	for(var p in klaBa) { // парсинг функция(){…}, bool, num
		var func = klaBa[p];
		if (typeof func == "string") func = klaBa[func]; //ссылка на функцию
		var [key, mod] = p.split("_"); mod = mod || "";
		var upper = key[0].toUpperCase();
		var prevent = key[0] == upper; // bool: True если имя с Заглавной. если false: Skip preventDefault
		var [, m, i] = mod.match(re); m = m || 0; // modifiers bitmap
		var arr = [func, prevent, i ? i == "I" ? 0 : 1 : -1]; // textfields flag
		var prop = prevent ? key : upper + key.slice(1); //имя клавиши без модификаторов
		var o = obj[prop] || (obj[prop] = Object.create(null));
		o[m] ? o[m].push(arr) : o[m] = [arr];
	}
	klaBa = obj; // нет Ii -1 везде, Имя_I = 0 в полях ввода, Имя_i 1 кроме полей ввода
})(Object.create(null), /(\d+)?(i)?/i, /_(?:win|linux|macosx)$/, new Set());

var Debug = (id = "sidebar-box") => !document.getElementById(id).hidden,
keydown_w = e => { // перехват клавиш
	if (e.repeat) return; // повтор: выход
	var mod = e.metaKey*8 + e.ctrlKey*4 + e.shiftKey*2 + e.altKey;
	if (e.keyCode > 31 && Debug())
		console.log(`■ key ${mod ? e.code +"_"+ mod : e.code}`); //показ клавиш
	var data = klaBa[e.code]?.[mod]; if (!data) return;
	for(var [func, p, i] of data)
		if (i ^ docShell.isCommandEnabled("cmd_insertText"))
			p && e.preventDefault(), func(e, gBrowser.selectedTab); //запуск по сочетанию
};
var args = ["keydown", e => { keydown_w(e)}, true];

window.addEventListener(...args);
var id = Symbol(), ucf = ucf_custom_script_win;
ucf.unloadlisteners.push(id);
ucf[id] = {destructor: () => window.removeEventListener(...args)};

})({animate: true});

Отсутствует

 

№104203-08-2023 20:54:49

b0ttle
Участник
 
Группа: Members
Зарегистрирован: 22-10-2020
Сообщений: 182
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dumby
Убрал, в config.js тоже, но у меня теперь отвалились хоткей, которые похоже зависят от него.

Выделить код

Код:

var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
Выделить код

Код:

FileUtils.getFile('UChrm','...']).launch();

Что делать? Если уберут в 117, придется обходиться таким?

Выделить код

Код:

var p=Services.dirsvc.get('UChrm',Ci.nsIFile);p.initWithPath(p.path+"...");p.launch();

Отсутствует

 

№104303-08-2023 22:00:39

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 2156
UA: Firefox 78.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dobrov пишет

смотрите коды нажатий клавиш в консоли

Вот это мне не нравится.
Из-за этого, вычисление модификаторов вытащено из того места, где оно было,
и поднято выше, таким образом, теряется существенная часть смысла предварительной
обработки klaBa — «если e.code не совпадает, то модификаторы даже не вычисляются».


Даже если вернуть на место и повторить под Debug()-условием, то всё равно,
это лишние проверки, а из-за e.keyCode > 31 не показывает какие-нибудь там
«Backspace», «Enter», «Pause».


Лучше бы что-нибудь другое для просмотра кода клавиш придумать.
Захотелось попробовать спец-панельку, типа жмешь, например, Ctrl+Shift+0,
выскакивает панелька, теперь нажимешь клавиши, и на ней смотришь.


Набросок кода для добавления в предоставленный, перед последней строкой.

скрытый текст

Выделить код

Код:

// Ctrl+Shift+0
(klaBa.Digit0 = klaBa.Digit0 || (klaBa.Digit0 = Object.create(null)))[6] = [[e => {

	var df = MozXULElement.parseXULToFragment(`
		<panel onpopuphidden="destroy()" onpopupshown="pos()" oncommand="cmd(event)">
			<hbox style="font-size: 20px; padding: .5em;">
				<label style="min-width: 14em; border: 1px solid gray;
					display: flex; align-items: center; justify-content: center;"/>
				<button label="P" tooltiptext="Toggle skip preventDefailt()" style="min-width: 2em;"/>
				<button label="i" tooltiptext="Ignore textfields" style="min-width: 2em;"/>
				<button label="I" tooltiptext="Only textfields" style="min-width: 2em;"/>
				<box style="width: 1em;"/>
				<button label="W" tooltiptext="Windows" style="min-width: 2em;"/>
				<button label="L" tooltiptext="Linux" style="min-width: 2em;"/>
				<button label="M" tooltiptext="Mac" style="min-width: 2em;"/>
				<box style="width: 1em;"/>
				<button label="Copy"/>
			</hbox>
		</panel>
	`);

	var code, mods, os;

	var panel = df.firstChild, label = df.querySelector("label");
	panel.remove();
	var setLabel = () => label.value = [code, mods, os].filter(Boolean).join("_");

	var kw = keydown_w;
	panel.destroy = () => panel.remove(keydown_w = kw);

	panel.pos = () => {
		var {width, height} = panel.getOuterScreenRect();
		var aw = screen.availWidth - width;
		panel.moveTo(aw/2, screen.availHeight/3);
		panel.style.removeProperty("opacity");
	}
	panel.cmd = e => {
		var lab = e.target.label;
		if (lab == "Copy")
			navigator.clipboard.writeText(label.value),
			panel.hidePopup();
		else
			commands[lab](), setLabel();
	}
	var re = /i/i, commands = {
		P() {
			var first = code[0];
			var upper = first.toUpperCase();
			first = first == upper ? first.toLowerCase() : upper;
			code = first + code.slice(1);
		},
		i: (flag = "i") => re.test(mods)
			? mods = mods.replace(re, mods.includes(flag) ? "" : flag)
			: mods += flag,

		I: () => commands.i("I"),

		W: (pl = "win") => os = os == pl ? "" : pl,
		L: () => commands.W("linux"),
		M: () => commands.W("macosx")
	};

	var handleKeydown = e => {
		e.preventDefault();
		e.stopImmediatePropagation();

		if (e.repeat) return;

		os = "";
		code = e.code || "";
		mods = e.metaKey*8 + e.ctrlKey*4 + e.shiftKey*2 + e.altKey || "";

		//if (!mods && code == "Escape") return panel.hidePopup();
		setLabel();
	}
	// end of lazy stuff

	(klaBa.Digit0[6][0][0] = () => {
		panel.style.setProperty("opacity", "0", "important");
		mainPopupSet.append(panel);
		panel.openPopupAtScreen();
		(keydown_w = handleKeydown)(e);
	})();

}, false, -1]];

b0ttle пишет

Убрал, в config.js тоже, но у меня теперь отвалились хоткей, которые похоже зависят от него.

Нисколько не похоже.
Вообще никак не связанные вещи.


Эту плюшку просто выбросили в 116
Bug 920187 - Deprecate and get rid of FileUtils.getFile()

Отсутствует

 

№104403-08-2023 22:34:51

OmTatSat
Участник
 
Группа: Members
Зарегистрирован: 25-06-2015
Сообщений: 82
UA: Firefox 102.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Здравствуйте, возможно ли на страницу about:addons вернуть поиск - фильтр установленных дополнений, как когда-то давно в Firefox по дефолту было?

Отсутствует

 

№104503-08-2023 23:37:18

b0ttle
Участник
 
Группа: Members
Зарегистрирован: 22-10-2020
Сообщений: 182
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dumby
Как можно поправить? Не работает из-за FileUtils.getFile. При выходе, удалялись ненужные файлы в профиле.

Выделить код

Код:

try{var closer={observe:(s,topic,data)=>{if(topic=="quit-application"){
//const clipboard=Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);clipboard.emptyClipboard(clipboard.kGlobalClipboard);//Clear clipboard
FileUtils.getFile("UChrm",["user_chrome_files","_","sqlite[Fx].vbs"]).launch();//Run external script
}}};Services.obs.addObserver(closer,"quit-application",false);}catch(ex){}

По ссылке на баг, прочитал такое "IOUtils and PathUtils offers async alternatives", но дуб дубом в этом. Это что-то вроде замены FileUtils.getFile()?

Отредактировано b0ttle (03-08-2023 23:39:58)

Отсутствует

 

№104604-08-2023 00:13:02

Northtech
Участник
 
Группа: Members
Зарегистрирован: 16-04-2011
Сообщений: 261
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

В последних версиях пропали интервалы из add_toolbar_buttons@vitaliy.ru.xpi. Остался только растягивающийся интервал. Можно ли это как то поправить?

скрытый текст
EWap2U2.png

special_widget.css:

Выделить код

Код:

@-moz-document url("chrome://browser/content/browser.xhtml") {
toolbarpaletteitem[place="palette"] > toolbarspring[id^="customizableui-special-spring"] {
    background: white url("./svg/spring.svg") center no-repeat !important;
    border: none !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    min-height: 37px !important;
    opacity: 0.3 !important;
}
toolbarpaletteitem[place="toolbar"] > toolbarspring[id^="customizableui-special-spring"] {
    background: white url("./svg/spring.svg") center no-repeat !important;
    border: none !important;
    min-width: 34px !important;
    min-height: 14px !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    margin-block: 2px !important;
    margin-inline: 1px !important;
    opacity: 0.3 !important;
}
toolbarpaletteitem[place="palette"] > toolbarspacer[id^="customizableui-special-spacer"] {
    background: white !important;
    border: none !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    min-height: 37px !important;
    width: 15px !important;
    max-width: 15px !important;
    opacity: 0.3 !important;
}
toolbarpaletteitem[place="toolbar"] > toolbarspacer[id^="customizableui-special-spacer"] {
    background: white !important;
    border: none !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    min-height: 14px !important;
    width: 15px !important;
    margin-block: 2px !important;
    margin-inline: 1px !important;
    opacity: 0.3 !important;
}
toolbarseparator[id^="customizableui-special-separator"] {
    -moz-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    margin: 2px !important;
    margin-inline-start: 4px !important;
    margin-inline-end: 0 !important;
    border: none !important;
    border-inline-start: 1px solid currentColor !important;
    min-width: 5px !important;
    width: 5px !important;
    max-width: 5px !important;
    opacity: 0.3 !important;
}
toolbar[orient="vertical"] toolbarseparator[id^="customizableui-special-separator"] {
    margin-inline-start: 2px !important;
    margin-inline-end: 2px !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
    border-top: 1px solid currentColor !important;
    border-inline-start: none !important;
    width: auto !important;
    max-width: none !important;
    height: 5px !important;
    min-height: 5px !important;
    max-height: 5px !important;
}
toolbarpaletteitem[place="palette"] > toolbarseparator[id^="customizableui-special-separator"] {
    margin: 0 !important;
    min-height: 37px !important;
}
toolbarpaletteitem[place] > toolbarspring[id^="customizableui-special-spring"],
toolbarpaletteitem[place] > toolbarspacer[id^="customizableui-special-spacer"],
toolbarpaletteitem[place] > toolbarseparator[id^="customizableui-special-separator"] {
    -moz-window-dragging: no-drag !important;
}
toolbar:not(#nav-bar) toolbarpaletteitem[place="toolbar"][id^="wrapper-customizableui-special-spring"],
toolbar:not(#nav-bar) toolbarspring {
    max-width: none !important;
}
toolbarpaletteitem[place="palette"][id^="wrapper-customizableui-special-spacer"],
toolbarpaletteitem[place="palette"][id^="wrapper-customizableui-special-separator"] {
    -moz-box-align: center !important;
    box-align: center !important;
    align-items: center !important;
    text-align: center !important;
}
}

Отсутствует

 

№104704-08-2023 01:36:50

b0ttle
Участник
 
Группа: Members
Зарегистрирован: 22-10-2020
Сообщений: 182
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Northtech
У меня так, вроде не сильно отличается.

special_widget.css

Выделить код

Код:

@-moz-document url("chrome://browser/content/browser.xhtml") {
toolbarpaletteitem[place="palette"] > toolbarspring[id^="customizableui-special-spring"] {
    background: white url("../vertical_top_bottom_bar/svg/spring.svg") center no-repeat !important;
    border: none !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    min-height: 37px !important;
    opacity: 0.3 !important;
}
toolbarpaletteitem[place="toolbar"] > toolbarspring[id^="customizableui-special-spring"] {
    background: white url("./svg/spring.svg") center no-repeat !important;
    border: none !important;
    min-width: 34px !important;
    min-height: 14px !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    margin-block: 2px !important;
    margin-inline: 1px !important;
    opacity: 0.3 !important;
}
toolbarpaletteitem[place="palette"] > toolbarspacer[id^="customizableui-special-spacer"] {
    background: white !important;
    border: none !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    min-height: 37px !important;
    width: 15px !important;
    max-width: 15px !important;
    opacity: 0.3 !important;
}
toolbarpaletteitem[place="toolbar"] > toolbarspacer[id^="customizableui-special-spacer"] {
    background: white !important;
    border: none !important;
    outline: 1px solid currentColor !important;
    outline-offset: -1px !important;
    min-height: 14px !important;
    width: 15px !important;
    margin-block: 2px !important;
    margin-inline: 1px !important;
    opacity: 0.3 !important;
}
toolbarseparator[id^="customizableui-special-separator"] {
    -moz-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    margin: 2px !important;
    margin-inline-start: 4px !important;
    margin-inline-end: 0 !important;
    border: none !important;
    border-inline-start: 1px solid currentColor !important;
    min-width: 5px !important;
    width: 5px !important;
    max-width: 5px !important;
    opacity: 0.3 !important;
}
toolbar[orient="vertical"] toolbarseparator[id^="customizableui-special-separator"] {
    margin-inline-start: 2px !important;
    margin-inline-end: 2px !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
    border-top: 1px solid currentColor !important;
    border-inline-start: none !important;
    width: auto !important;
    max-width: none !important;
    height: 5px !important;
    min-height: 5px !important;
    max-height: 5px !important;
}
toolbarpaletteitem[place="palette"] > toolbarseparator[id^="customizableui-special-separator"] {
    margin: 0 !important;
    min-height: 37px !important;
}
toolbarpaletteitem[place] > toolbarspring[id^="customizableui-special-spring"],
toolbarpaletteitem[place] > toolbarspacer[id^="customizableui-special-spacer"],
toolbarpaletteitem[place] > toolbarseparator[id^="customizableui-special-separator"] {
    -moz-window-dragging: no-drag !important;
}
toolbar:not(#nav-bar) toolbarpaletteitem[place="toolbar"][id^="wrapper-customizableui-special-spring"],
toolbar:not(#nav-bar) toolbarspring {
    max-width: none !important;
}
toolbarpaletteitem[place="palette"][id^="wrapper-customizableui-special-spacer"],
toolbarpaletteitem[place="palette"][id^="wrapper-customizableui-special-separator"] {
    align-items: center !important;
}
}


Это стиль, еще есть скрипт который добавляет сами интервалы. Если без стиля, они переносятся на панели, просто без обертки в виде стиля будут невидимы. Собственно, у меня все интервалы есть на 116, через ucf.

Отредактировано b0ttle (04-08-2023 02:10:58)

Отсутствует

 

№104804-08-2023 04:37:37

Dobrov
Участник
 
Группа: Members
Зарегистрирован: 04-10-2011
Сообщений: 416
UA: Firefox 97.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Dumby пишет

Набросок кода для добавления в предоставленный, перед последней строкой.

Это всё конечно хорошо, но многовато дублирующего кода - в однократном парсинге и коде просмотра клавиш одинаковая обработка модификаторов и постфиксов на ОС. А если использовать предпросмотр нажатий, то код панельки пригодится вынести отдельно - в ней и нажатия мыши  удобно просматривать и вывод отладки или сообщения об ошибках…


Ещё вот вариант простого синтаксиса клавиш, сложнее в восприятии, но проще для кода парсинга:
Dumby — посмотри, как с этим вариантом переделать keydown_win = e => ……
Digit1() { console.log("Digit1 Page+Input Only Apple");}, true, -1, "macosx", (ОС можно пропустить:  …, true, -1,,)

Переделал обработчик нажатий клавиш, проверь, так лучше?

Выделить код

Код:

var keydown_win = e => { // перехват клавиш, учитывая поля ввода
	if (e.repeat || !prefs.getBoolPref('javascript.enabled',1)) return; // повтор|скрипты OFF: выход
	var data = klaBa[e.code]?.[e.metaKey*8 + e.ctrlKey*4 + e.shiftKey*2 + e.altKey];
	if (data)
		for(var [func, p, i] of data)
			if (i ^ docShell.isCommandEnabled("cmd_insertText"))
				p && e.preventDefault(), func(e, gBrowser.selectedTab); //запуск по сочетанию
	if (!Debug()) return; // отладки нет
	var mod = e.metaKey*8 + e.ctrlKey*4 + e.shiftKey*2 + e.altKey;
	console.log(`■ key ${mod ? e.code +"_"+ mod : e.code}`); //показ клавиш
}

Отсутствует

 

№104904-08-2023 06:22:17

Viatcheslav
Участник
 
Группа: Members
Откуда: г. Бобруйск, Беларусь
Зарегистрирован: 23-11-2016
Сообщений: 312
UA: Firefox 114.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Поделитесь, пожалуйста, рабочим вариантом
для автоматической очистки поля поиска
после ввода запроса.
Скрипт https://github.com/Aris-t2/CustomJSforFx/blob/master/scripts/alternative_searchbar.uc.js
на [firefox] 114 не работает... :angry: (в строке 40 настройку false на true менял)

Отсутствует

 

№105004-08-2023 10:29:18

xrun1
Участник
 
Группа: Members
Зарегистрирован: 12-12-2013
Сообщений: 1165
UA: Firefox 116.0

Re: UCF - ваши кнопки, темы, дополнения, скрипты…

Northtech пишет

Остался только растягивающийся интервал

У меня всегда было их два, "Растягивающийся пробел" первый и последний в списке. Остальные тоже на месте. https://imgsh.net/a/rqWJYGc.png
special_widget.css этот файл не трогал, как есть. В Вашем на 3 строки снизу больше

скрытый текст

Выделить код

Код:

box-align: center !important;
    align-items: center !important;
    text-align: center !important;


Вот мой add_toolbar_buttons@vitaliy.ru.xpi

Отсутствует

 

Board footer

Powered by PunBB
Modified by Mozilla Russia
Copyright © 2004–2020 Mozilla Russia GitHub mark
Язык отображения форума: [Русский] [English]