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

Общайтесь со знакомыми и друзьями в нашей группе в Контакте.

№1535124-03-2021 20:16:57

harryk
Участник
 
Группа: Members
Зарегистрирован: 23-12-2019
Сообщений: 418
UA: Firefox 68.0

Re: Custom Buttons

Отсутствует

 

№1535224-03-2021 20:44:42

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

Re: Custom Buttons

harryk пишет

QuickToggleAC.js

Да, забрал, спасибо.


DenisRodman
Ну вот, не особо тщательно, но проверил.
Win7 SP1, CB 0.0.7.0.0.6, FF 69.0.3 (32-битный)
Разместил код в Инициализации, и, вроде, работает.

Отсутствует

 

№1535324-03-2021 20:50:22

DenisRodman
Участник
 
Группа: Members
Зарегистрирован: 24-03-2021
Сообщений: 7
UA: Firefox 63.0

Re: Custom Buttons

Dumby
Это хорошо конечно, только мне то какие действия сделать нужно?


P.S. Я надеюсь по моим сообщениям и вопросам понятно, что в этой теме я чайник, так что ответы мне бы по проще и нормальным языком, а то я не пойму. Всё таки форум вещь такая, когда каждый спец думает, что его все понимают, но это далеко не так, одно дело когда ты хоть немного в теме, я повторюсь не в теме :) .

Отредактировано DenisRodman (24-03-2021 20:51:26)

Отсутствует

 

№1535425-03-2021 05:20:56

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

Re: Custom Buttons

Dumby - ещё хотелка для QuickToggleSettings
Сделать пункты меню, запускающие любой код или функцию, то есть без подменю настроек,  По клику на строке меню надо запустить прописанный там код или указанное имя функции.
Возможно, такая кнопка - (объединяющая в себе несколько) уже есть на форуме - при клике на неё открывается менюшка, пункты которой запускают различный код.

Dumby пишет

QuickToggleAC.js
Да, забрал, спасибо.

Эта кнопка по коду от моей отличается только отсутствием Mouse LongClick…

Отсутствует

 

№1535525-03-2021 09:32:38

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

Re: Custom Buttons

DenisRodman пишет

ответы мне бы по проще и нормальным языком, а то я не пойму

Даже не знаю, наверно проще всего так:

1. Выделить тройным кликом нижеприведенный URL кнопки.
2. Скопировать в буфер обмена (Ctrl+C).
3. ПКМ на кнопке —> «Обновить кнопку».

URL кнопки

Выделить код

Код:

custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname/%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFPSURBVDhPnVPNSsNAEJ5tamnBk+A7BMEcikohp/gi9i18nRafQoT00kK16tnn8CJo4vp9m5m41eSgH0zmd3d+diJ/gfdedvl0QW7k1PcLwem+3TjowZagK+Nn6yc3gNCJ+LCCh9LzzTMdqeoNbkQSFZmpJLGCW5Gx2hZaQahMbZ52VuDSfHpnAVJXOb4FKzianbzCXiLrHLYl5C3t5NTRwtxaKJxUTZ/JcOTr6q2Rxwf0aVb2/hLs4KqL3Isckz/mmSdRRksjyg+z7IM6LzDCBfuvAEOJmIKBOqAWmo1YodxLlQNsyO0rsIV/AZM+JGc2a4GgzhZ2p9mFmrpboCMqNYBDdMlwompoTWN6F2nFT5hBXb0PEpmo/Gk+oH+RrqNZINPeIlnZViV1jQuLFJQuWGB0gJdwgShvqdPXZv6J+F/QS7oXqQ9xBTFZ5oa8fAGs9fed5YhPSwAAAABJRU5ErkJggg%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20Quick%20Toggle%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fpid%3D784139%23p784139%0A//%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fpid%3D784165%23p784165%0A//%20%u0411%u044B%u0441%u0442%u0440%u043E%u0435%20%u043F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%20about%3Aconfig%0A%28async%20%28name%2C%20id%2C%20func%29%20%3D%3E%20%7B%0A%09if%20%28name%20%3D%3D%20%22Object%22%29%20return%20CustomizableUI.createWidget%28func%28%29%29%3B%0A%09var%20win%20%3D%20name%20%3D%3D%20%22Window%22%2C%20g%20%3D%20Components.utils.import%28%22resource%3A//gre/modules/Services.jsm%22%2C%20%7B%7D%29%3B%0A%09if%20%28g%5Bid%5D%29%20%7Bif%20%28win%29%20return%3B%7D%20else%20g%5Bid%5D%20%3D%20func%28%29%3B%0A%09if%20%28win%29%20return%20CustomizableUI.createWidget%28g%5Bid%5D%29%3B%0A%09addDestructor%28r%20%3D%3E%20r%5B5%5D%20%3D%3D%20%22e%22%20%26%26%20delete%20g%5Bid%5D%29%3B%0A%09g%5Bid%5D.onCreated%28this%29%3B%0A%7D%29%28this.constructor.name%2C%20%22QuickToggleAboutConfigSettings%22%2C%20%28%29%20%3D%3E%20%7B%0A%0A%09var%20%7Bprefs%7D%20%3D%20Services%2C%20db%20%3D%20prefs.getDefaultBranch%28%22%22%29%3B%0A%09var%20pv%20%3D%20parseInt%28Services.appinfo.platformVersion%29%3B%0A%09var%20xul_ns%20%3D%20%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%3B%0A%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A%09//%20refresh%3A%0A%09//%09false%20-%20reload%20current%20tab%0A%09//%09true%20-%20reload%20current%20tab%20skip%20cache%0A%09//%0A%09//%20restart%3A%0A%09//%09false%20-%20restart%20browser%0A%09//%09true%20-%20restart%20browser%20with%20confirm%0A%0A%09var%20primary%20%3D%20%5B%7B%0A%0A%09%09%09pref%3A%20%5B%22network.proxy.share_proxy_settings%22%2C%20%22%u041F%u0440%u043E%u043A%u0441%u0438%20%u0434%u043B%u044F%20%u0432%u0441%u0435%u0445%20%u043F%u0440%u043E%u0442%u043E%u043A%u043E%u043B%u043E%u0432%20%u043F%u0440%u0438%20%u0440%u0443%u0447%u043D%u043E%u0439%20%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0435%22%5D%2C%0A%09%09%09userChoice%3A%20true%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%7B%0A%09%09%09pref%3A%20%5B%22network.proxy.type%22%2C%20%22%u041D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0438%20%u043F%u0440%u043E%u043A%u0441%u0438%22%5D%2C%0A%09%09%09userChoice%3A%200%2C%20userAlt%3A%202%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%0A%09%09%09%09%5B0%2C%20%22%u0411%u0435%u0437%20%u043F%u0440%u043E%u043A%u0441%u0438%22%2C%20%220%22%5D%2C%20%5B5%2C%20%22%u0421%u0438%u0441%u0442%u0435%u043C%u043D%u044B%u0435%20%28%u0438%u0437%20IE%29%22%2C%20%225%22%5D%2C%20%5B2%2C%20%22%u0410%u0432%u0442%u043E%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0430%20%u0441%20URL%20%28pacfile%29%22%2C%20%222%22%5D%2C%0A%09%09%09%09%5B1%2C%20%22%u0420%u0443%u0447%u043D%u0430%u044F%20%u043D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0430%22%2C%20%221%22%5D%2C%20%5B4%2C%20%22%u0410%u0432%u0442%u043E%u043E%u043F%u0440%u0435%u0434%u0435%u043B%u0435%u043D%u0438%u0435%22%2C%20%224%22%5D%0A%09%5D%7D%2C/*%20%7B%0A%09%09%09pref%3A%20%5B%22network.proxy.socks_remote_dns%22%2C%20%22%u041E%u0442%u043F%u0440%u0430%u0432%u043B%u044F%u0442%u044C%20DNS-%u0437%u0430%u043F%u0440%u043E%u0441%u044B%20%u0447%u0435%u0440%u0435%u0437%20%u043F%u0440%u043E%u043A%u0441%u0438%20%u043F%u0440%u0438%20%u0438%u0441%u043F%u043E%u043B%u044C%u0437%u043E%u0432%u0430%u043D%u0438%u0438%20SOCKS%205%22%5D%2C%0A%09%09%09userChoice%3A%20true%2C%20refresh%3A%20false%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%20*/%7B%0A%09%09%09pref%3A%20%5B%22network.trr.mode%22%2C%20%22DNS%20%u0447%u0435%u0440%u0435%u0437%20HTTPS%22%5D%2C%0A%09%09%09userChoice%3A%202%2C%20userAlt%3A%201%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%0A%09%09%09%09%5B0%2C%20%22%u0412%u044B%u043A%u043B%u044E%u0447%u0435%u043D%22%2C%20%220%22%5D%2C%20%5B1%2C%20%22Firefox%20%u0432%u044B%u0431%u0438%u0440%u0430%u0435%u0442%20%u0441%u0430%u043C%u044B%u0439%20%u0431%u044B%u0441%u0442%u0440%u044B%u0439%22%2C%20%221%22%5D%2C%20%5B2%2C%20%22DNS%20%u0447%u0435%u0440%u0435%u0437%20HTTPS%20TRR%20+%20%u043C%u043E%u0439%22%2C%20%222%22%5D%2C%0A%09%09%09%09%5B3%2C%20%22DNS%20%u0447%u0435%u0440%u0435%u0437%20HTTPS%20%u0442%u043E%u043B%u044C%u043A%u043E%20TRR%22%2C%20%223%22%5D%2C%20%5B4%2C%20%22%u0422%u0435%u043D%u0435%u0432%u043E%u0439%20%u0440%u0435%u0436%u0438%u043C%22%2C%20%224%22%5D%2C%20%5B5%2C%20%22%u041E%u0442%u043A%u043B%u044E%u0447%u0438%u0442%u044C%20TRR%20%u043F%u043E%20%u0432%u044B%u0431%u043E%u0440%u0443%22%2C%20%225%22%5D%0A%09%5D%7D%2C%0A%09%09%09null%2C%0A%09/*%20%7B%0A%09%09%09pref%3A%20%5B%22permissions.default.image%22%2C%20%22%u0420%u0430%u0437%u0440%u0435%u0448%u0438%u0442%u044C%20%u0437%u0430%u0433%u0440%u0443%u0437%u043A%u0443%20%u0438%u0437%u043E%u0431%u0440%u0430%u0436%u0435%u043D%u0438%u0439%22%5D%2C%0A%09%09%09userChoice%3A%201%2C%20userAlt%3A%203%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5B1%2C%20%22%u0414%u0430%22%5D%2C%20%5B3%2C%20%22%u0422%u043E%u043B%u044C%u043A%u043E%20%u0441%20%u0441%u0430%u0439%u0442%u0430%22%5D%2C%20%5B2%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%20*/%7B%0A%09%09%09pref%3A%20%5B%22dom.security.https_only_mode%22%2C%20%22%u0422%u043E%u043B%u044C%u043A%u043E%20https%22%5D%2C%0A%09%09%09userChoice%3A%20true%2C%20refresh%3A%20false%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22True%22%5D%2C%20%5Bfalse%2C%20%22False%22%5D%5D%0A%09%7D%2C%7B%0A%09%09%09pref%3A%20%5B%22dom.security.https_only_mode_ever_enabled%22%2C%20%22%u0412%u043A%u043B%u044E%u0447%u0430%u043B%u0441%u044F%20%u043B%u0438%20%u043A%u043E%u0433%u0434%u0430-%u043D%u0438%u0431%u0443%u0434%u044C%20%u0442%u043E%u043B%u044C%u043A%u043E%20https%22%5D%2C%0A%09%09%09userChoice%3A%20false%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%7B%0A%09%09%09pref%3A%20%5B%22security.mixed_content.block_display_content%22%2C%20%22%u041F%u0430%u0441%u0441%u0438%u0432%u043D%u044B%u0439%20%u043A%u043E%u043D%u0442%u0435%u043D%u0442%20%u0442%u043E%u043B%u044C%u043A%u043E%20https%22%5D%2C%0A%09%09%09userChoice%3A%20true%2C%20refresh%3A%20false%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%7B%0A%09%09%09pref%3A%20%5B%22security.mixed_content.upgrade_display_content%22%2C%20%22%u0410%u043F%u0433%u0440%u0435%u0439%u0434%20%u0441%u0441%u044B%u043B%u043E%u043A%20%u0434%u043E%20https%20%u0438%u043B%u0438%20%u0431%u043B%u043E%u043A%u0438%u0440%u043E%u0432%u043A%u0430%22%5D%2C%0A%09%09%09userChoice%3A%20true%2C%20refresh%3A%20false%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%0A%09%20%20%20%20null%2C%0A%09/*%20%7B%0A%09%09%09pref%3A%20%5B%22gfx.webrender.all%22%2C%20%22WebRender%20%u0434%u043B%u044F%20%u0432%u0441%u0435%u0433%u043E%22%5D%2C%0A%09%09%09userChoice%3A%20false%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%20*/%7B%0A%09%09%09pref%3A%20%5B%22media.webm.enabled%22%2C%20%22%u0414%u0435%u043A%u043E%u0434%u0435%u0440%20WebM%20VP8%22%5D%2C%0A%09%09%09userChoice%3A%20false%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%0A%09%20%20%20%20null%2C%0A%09%7B%0A%09%09%09pref%3A%20%5B%22image.animation_mode%22%2C%20%22%u0410%u043D%u0438%u043C%u0430%u0446%u0438%u044F%20%u0438%u0437%u043E%u0431%u0440%u0430%u0436%u0435%u043D%u0438%u0439%22%5D%2C%0A%09%09%09userChoice%3A%20%22none%22%2C%20userAlt%3A%20%22once%22%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5B%22none%22%2C%20%22%u0412%u044B%u043A%u043B%u044E%u0447%u0435%u043D%u0430%22%5D%2C%20%5B%22normal%22%2C%20%22%u0412%u043A%u043B%u044E%u0447%u0435%u043D%u0430%22%5D%2C%20%5B%22once%22%2C%20%22%u0415%u0434%u0438%u043D%u043E%u0436%u0434%u044B%22%5D%5D%0A%09%7D%2C%7B%0A%09%09%09pref%3A%20%5B%22media.autoplay.default%22%2C%20%22%u0410%u0432%u0442%u043E%u0432%u043E%u0441%u043F%u0440%u043E%u0438%u0437%u0432%u0435%u0434%u0435%u043D%u0438%u0435%20%u0430%u0443%u0434%u0438%u043E%20%u0438%20%u0432%u0438%u0434%u0435%u043E%22%5D%2C%0A%09%09%09userChoice%3A%205%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%0A%09%09%09%09%5B0%2C%20%22%u0420%u0430%u0437%u0440%u0435%u0448%u0438%u0442%u044C%20%u0430%u0432%u0442%u043E%u0432%u043E%u0441%u043F%u0440%u043E%u0438%u0437%u0432%u0435%u0434%u0435%u043D%u0438%u0435%22%2C%20%220%22%5D%2C%0A%09%09%09%09%5B1%2C%20%22%u041D%u0435%20%u0440%u0430%u0437%u0440%u0435%u0448%u0430%u0442%u044C%20%u0430%u0432%u0442%u043E%u0432%u043E%u0441%u043F%u0440%u043E%u0438%u0437%u0432%u0435%u0434%u0435%u043D%u0438%u0435%22%2C%20%221%22%5D%2C%0A%09%09%09%09%5B2%2C%20%22%u0412%u0441%u0435%u0433%u0434%u0430%20%u0441%u043F%u0440%u0430%u0448%u0438%u0432%u0430%u0442%u044C%22%2C%20%222%22%5D%2C%0A%09%09%09%09%5B5%2C%20%22%u0411%u043B%u043E%u043A%u0438%u0440%u043E%u0432%u0430%u0442%u044C%20%u0430%u0443%u0434%u0438%u043E%20%u0438%20%u0432%u0438%u0434%u0435%u043E%22%2C%20%225%22%5D%0A%09%5D%7D%2C%7B%0A%09%09%09pref%3A%20%5B%22media.autoplay.blocking_policy%22%2C%20%22%u0410%u0432%u0442%u043E%u0437%u0430%u043F%u0443%u0441%u043A%20%28%u043F%u043E%u043B%u0438%u0442%u0438%u043A%u0430%29%22%5D%2C%0A%09%09%09userChoice%3A%201%2C%20userAlt%3A%202%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%0A%09%09%09%09%5B1%2C%20%22%u0412%u0440%u0435%u043C%u0435%u043D%u043D%u0430%u044F%22%2C%20%221%22%5D%2C%0A%09%09%09%09%5B2%2C%20%22%u041F%u043E%20%u0434%u0435%u0439%u0441%u0442%u0432%u0438%u044E%22%2C%20%222%22%5D%2C%0A%09%09%09%09%5B0%2C%20%22%u041F%u043E%u0441%u0442%u043E%u044F%u043D%u043D%u0430%u044F%22%2C%20%220%22%5D%0A%09%5D%7D%2C/*%20%7B%0A%09%09%09pref%3A%20%5B%22plugin.state.flash%22%2C%20%22Flash-plugin%22%5D%2C%0A%09%09%09userChoice%3A%202%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%0A%09%09%09%09%5B2%2C%20%22%u0412%u0441%u0435%u0433%u0434%u0430%20%u0432%u043A%u043B%u044E%u0447%u0430%u0442%u044C%22%2C%20%222%22%5D%2C%0A%09%09%09%09%5B1%2C%20%22%u0412%u043A%u043B%u044E%u0447%u0430%u0442%u044C%20%u043F%u043E%20%u0437%u0430%u043F%u0440%u043E%u0441%u0443%22%2C%20%221%22%5D%2C%0A%09%09%09%09%5B0%2C%20%22%u041D%u0438%u043A%u043E%u0433%u0434%u0430%20%u043D%u0435%20%u0432%u043A%u043B%u044E%u0447%u0430%u0442%u044C%22%2C%20%220%22%5D%0A%09%5D%7D%2C%20*/%0A%09%20%20%20%20null%2C%0A%09/*%20%7B%0A%09%20%20%20%20pref%3A%20%5B%22browser.contentblocking.category%22%2C%20%22%u041A%u0430%u0442%u0435%u0433%u043E%u0440%u0438%u044F%20%u0437%u0430%u0449%u0438%u0442%u044B%22%5D%2C%0A%09%20%20%20%20userChoice%3A%20%22custom%22%2C%20refresh%3A%20true%2C%0A%09%20%20%20%20values%3A%20%5B%0A%09%20%20%20%20%20%20%5B%22standard%22%2C%20%22%u0421%u0442%u0430%u043D%u0434%u0430%u0440%u0442%u043D%u0430%u044F%22%2C%20%221%22%5D%2C%20%5B%22strict%22%2C%20%22%u0421%u0442%u0440%u043E%u0433%u0430%u044F%22%2C%20%222%22%5D%2C%20%5B%22custom%22%2C%20%22%u041F%u0435%u0440%u0441%u043E%u043D%u0430%u043B%u044C%u043D%u0430%u044F%22%2C%20%223%22%5D%0A%09%5D%7D%2C%20*/%0A%09/*%20%7B%0A%09%09%09pref%3A%20%5B%22network.cookie.cookieBehavior%22%2C%20%22Cookies%22%5D%2C%0A%09%09%09userChoice%3A%201%2C%20userAlt%3A%203%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%0A%09%09%09%09%5B1%2C%20%22%u0412%u0441%u0435%20%u0441%u0442%u043E%u0440%u043E%u043D%u043D%u0438%u0435%20%u043A%u0443%u043A%u0438%22%5D%2C%20%5B3%2C%20%22%u041A%u0443%u043A%u0438%20%u0441%20%u043D%u0435%20%u043F%u043E%u0441%u0435%u0449%u0435%u043D%u043D%u044B%u0445%20%u0441%u0430%u0439%u0442%u043E%u0432%22%5D%2C%20%5B4%2C%20%22%u041C%u0435%u0436%u0441%u0430%u0439%u0442%u043E%u0432%u044B%u0435%20%u0438%20%u0441%u043E%u0446%u0438%u0430%u043B%u044C%u043D%u044B%u0435%20%u0442%u0440%u0435%u043A%u0435%u0440%u044B%22%5D%2C%0A%09%09%09%09%5B2%2C%20%22%u0412%u0441%u0435%20%u043A%u0443%u043A%u0438%22%5D%2C%20%5B0%2C%20%22%u041F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u0441%u043E%20%u0432%u0441%u0435%u0445%22%5D%0A%09%5D%7D%2C%0A%09%09%09null%2C%20*/%0A%09%7B%0A%09%09%09pref%3A%20%5B%22dom.storage.enabled%22%2C%20%22%u041B%u043E%u043A%u0430%u043B%u044C%u043D%u043E%u0435%20%u0445%u0440%u0430%u043D%u0438%u043B%u0438%u0449%u0435%22%5D%2C%0A%09%09%09userChoice%3A%20true%0A%09%7D%2C%7B%0A%09%09%09pref%3A%20%5B%22dom.caches.enabled%22%2C%20%22%u0412%u043A%u043B%u044E%u0447%u0438%u0442%u044C%20Cache%20Service%20Workers%20%u0438%20Cache%20Storage%22%5D%2C%0A%09%09%09userChoice%3A%20false%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22True%22%5D%2C%20%5Bfalse%2C%20%22False%22%5D%5D%0A%09%7D%0A%5D%3B%0A%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A%09var%20secondary%20%3D%20%5B%7B%0A%09%09%09pref%3A%20%5B%22dom.IntersectionObserver.enabled%22%2C%20%22Intersection%20Observer%20API%20%28DevTools%29%22%5D%2C%0A%09%09%09userChoice%3A%20false%2C%20refresh%3A%20true%2C%0A%09%09%09values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%7D%2C%0A%09%09%09null%2C%0A%20%20%20%20%7B%0A%0A%09%09%09pref%3A%20%5B%22dom.enable_performance%22%2C%20%22%u0421%u0442%u0430%u0442%u0443%u0441%20%u0437%u0430%u0433%u0440%u0443%u0437%u043A%u0438%20%u0441%u0442%u0440%u0430%u043D%u0438%u0446%u044B%22%5D%2C%0A%09%09%09userChoice%3A%20false%0A%09%7D%2C%0A%09%09%09null%2C%0A%09%7B%0A%09%09%09pref%3A%20%5B%22intl.accept_languages%22%2C%20%22%u042F%u0437%u044B%u043A%20%u0434%u043B%u044F%20%u0432%u0435%u0431-%u0441%u0442%u0440%u0430%u043D%u0438%u0446%22%5D%2C%0A%09%09%09userChoice%3A%20%22ru-RU%2C%20ru%2C%20en-US%2C%20en%22%2C%0A%09%09%09values%3A%20%5B%5B%22en-US%2C%20en%2C%20ru-RU%2C%20ru%22%2C%20%22%u0410%u043D%u0433%u043B%u0438%u0439%u0441%u043A%u0430%u044F%20%u043B%u043E%u043A%u0430%u043B%u044C%22%5D%2C%20%5B%22ru-RU%2C%20ru%2C%20en-US%2C%20en%22%2C%20%22%u0420%u0443%u0441%u0441%u043A%u0430%u044F%20%u043B%u043E%u043A%u0430%u043B%u044C%22%5D%5D%0A%09%7D%2C/*%20%7B%0A%09%09%09pref%3A%20%5B%22browser.display.document_color_use%22%2C%20%22%u0418%u0441%u043F%u043E%u043B%u044C%u0437%u043E%u0432%u0430%u0442%u044C%20%u0446%u0432%u0435%u0442%u0430%20%u0441%u0430%u0439%u0442%u043E%u0432%22%5D%2C%0A%09%09%09userChoice%3A%200%2C%0A%09%09%09values%3A%20%5B%5B0%2C%20%22%u0410%u0432%u0442%u043E%22%2C%20%220%22%5D%2C%20%5B1%2C%20%22%u0412%u0441%u0435%u0433%u0434%u0430%22%2C%20%221%22%5D%2C%20%5B2%2C%20%22%u041D%u0438%u043A%u043E%u0433%u0434%u0430%22%2C%20%222%22%5D%5D%0A%09%7D%2C%20*/%0A%09%09%09null%2C%0A%09%7B%0A%09%09%09pref%3A%20%5B%22network.http.sendRefererHeader%22%2C%20%22Referer%20-%20%u0434%u043B%u044F%20%u0447%u0435%u0433%u043E%22%5D%2C%0A%09%09%09userChoice%3A%201%2C%0A%09%09%09values%3A%20%5B%5B0%2C%20%22%u041D%u0438%20%u0434%u043B%u044F%20%u0447%u0435%u0433%u043E%22%2C%20%220%22%5D%2C%20%5B1%2C%20%22%u0422%u043E%u043B%u044C%u043A%u043E%20%u0441%u0441%u044B%u043B%u043A%u0438%22%2C%20%221%22%5D%2C%20%5B2%2C%20%22%u0421%u0441%u044B%u043B%u043A%u0438%20%u0438%20%u0438%u0437%u043E%u0431%u0440.%22%2C%20%222%22%5D%5D%0A%20%20%7D/*%20%2C%7B%0A%09%09%09pref%3A%20%5B%22media.peerconnection.enabled%22%2C%20%22WebRTC%20%u0443%u0442%u0435%u0447%u043A%u0430%20IP%22%5D%2C%0A%09%09%09userChoice%3A%20false%0A%09%7D%20*/%0A%09%5D%3B%0A%0A%09return%20%7B%0A%09%09label%3A%20%22Quick%20toggle%22%2C%0A%09%09id%3A%20%22QuickToggleAboutConfigSettings%22%2C%0A%09%09tooltiptext%3A%20%22Quick%20toggle%20about%20preferences%22%2C%0A%09%09localized%3A%20false%2C%0A%09%09image%3A%20%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFPSURBVDhPnVPNSsNAEJ5tamnBk+A7BMEcikohp/gi9i18nRafQoT00kK16tnn8CJo4vp9m5m41eSgH0zmd3d+diJ/gfdedvl0QW7k1PcLwem+3TjowZagK+Nn6yc3gNCJ+LCCh9LzzTMdqeoNbkQSFZmpJLGCW5Gx2hZaQahMbZ52VuDSfHpnAVJXOb4FKzianbzCXiLrHLYl5C3t5NTRwtxaKJxUTZ/JcOTr6q2Rxwf0aVb2/hLs4KqL3Isckz/mmSdRRksjyg+z7IM6LzDCBfuvAEOJmIKBOqAWmo1YodxLlQNsyO0rsIV/AZM+JGc2a4GgzhZ2p9mFmrpboCMqNYBDdMlwompoTWN6F2nFT5hBXb0PEpmo/Gk+oH+RrqNZINPeIlnZViV1jQuLFJQuWGB0gJdwgShvqdPXZv6J+F/QS7oXqQ9xBTFZ5oa8fAGs9fed5YhPSwAAAABJRU5ErkJggg%3D%3D%22%2C%0A%09%09onCreated%28btn%29%20%7B%0A%09%09%09btn.setAttribute%28%22image%22%2C%20this.image%29%3B%0A%09%09%09var%20doc%20%3D%20btn.ownerDocument%3B%0A%0A%09%09%09btn.btn%20%3D%20true%3B%0A%09%09%09btn.domParent%20%3D%20null%3B%0A%09%09%09btn.popups%20%3D%20new%20btn.ownerGlobal.Array%28%29%3B%0A%09%09%09this.createPopup%28doc%2C%20btn%2C%20%22primary%22%2C%20primary%29%3B%0A%09%09%09this.createPopup%28doc%2C%20btn%2C%20%22secondary%22%2C%20secondary%29%3B%0A%09%09%09this.createCloseMenusOption%28doc%2C%20btn%29%3B%0A%0A%09%09%09btn.linkedObject%20%3D%20this%3B%0A%09%09%09for%28var%20type%20of%20%5B%22command%22%2C%20%22contextmenu%22%5D%29%0A%09%09%09%09btn.setAttribute%28%22on%22%20+%20type%2C%20%60linkedObject.%24%7Btype%7D%28event%29%60%29%3B%0A%09%09%7D%2C%0A%09%09createPopup%28doc%2C%20btn%2C%20name%2C%20data%29%20%7B%0A%09%09%09var%20popup%20%3D%20doc.createElementNS%28xul_ns%2C%20%22menupopup%22%29%3B%0A%09%09%09var%20prop%20%3D%20name%20+%20%22Popup%22%3B%0A%09%09%09btn.popups.push%28btn%5Bprop%5D%20%3D%20popup%29%3B%0A%09%09%09popup.id%20%3D%20this.id%20+%20%22-%22%20+%20prop%3B%0A%09%09%09for%20%28var%20type%20of%20%5B%22popupshowing%22%2C%20%22click%22%5D%29%0A%09%09%09%09popup.setAttribute%28%22on%22%20+%20type%2C%20%60parentNode.linkedObject.%24%7Btype%7D%28event%29%60%29%3B%0A%09%09%09for%28var%20obj%20of%20data%29%20popup.append%28this.createElement%28doc%2C%20obj%29%29%3B%0A%09%09%09btn.append%28popup%29%3B%0A%09%09%7D%2C%0A%09%09map%3A%20%7Bb%3A%20%22Bool%22%2C%20n%3A%20%22Int%22%2C%20s%3A%20%22String%22%7D%2C%0A%09%09createElement%28doc%2C%20obj%29%20%7B%0A%09%09%09if%20%28%21obj%29%20return%20doc.createElementNS%28xul_ns%2C%20%22menuseparator%22%29%3B%0A%09%09%09var%20pref%20%3D%20doc.ownerGlobal.Object.create%28null%29%2C%20node%2C%20img%2C%20bool%3B%0A%09%09%09for%28var%20%5Bkey%2C%20val%5D%20of%20Object.entries%28obj%29%29%20%7B%0A%09%09%09%09if%20%28key%20%3D%3D%20%22pref%22%29%20%7B%0A%09%09%09%09%09var%20%5Bapref%2C%20lab%2C%20akey%2C%20ttt%5D%20%3D%20val%3B%0A%09%09%09%09%09pref.pref%20%3D%20apref%3B%20pref.lab%20%3D%20lab%20%7C%7C%20apref%3B%0A%09%09%09%09%09if%20%28ttt%29%20pref.ttt%20%3D%20ttt%3B%0A%09%09%09%09%7D%0A%09%09%09%09else%20if%20%28key%20%3D%3D%20%22image%22%29%20img%20%3D%20val%2C%20pref.img%20%3D%20true%3B%0A%09%09%09%09else%20if%20%28key%20%21%3D%20%22values%22%29%20pref%5Bkey%5D%20%3D%20val%3B%0A%09%09%09%09else%20pref.hasVals%20%3D%20true%3B%0A%09%09%09%7D%0A%09%09%09var%20type%20%3D%20prefs.getPrefType%28pref.pref%29%3B%0A%09%09%09var%20str%20%3D%20this.map%5Btype%20%3D%3D%20prefs.PREF_INVALID%0A%09%09%09%09%3F%20obj.values%20%3F%20%28typeof%20obj.values%5B0%5D%5B0%5D%29%5B0%5D%20%3A%20%22b%22%0A%09%09%09%09%3A%20type%20%3D%3D%20prefs.PREF_BOOL%20%3F%20%22b%22%20%3A%20type%20%3D%3D%20prefs.PREF_INT%20%3F%20%22n%22%20%3A%20%22s%22%0A%09%09%09%5D%3B%0A%09%09%09pref.get%20%3D%20prefs%5B%60get%24%7Bstr%7DPref%60%5D%3B%0A%09%09%09pref.set%20%3D%20prefs%5B%60set%24%7Bstr%7DPref%60%5D%3B%0A%0A%09%09%09node%20%3D%20doc.createElementNS%28xul_ns%2C%20%22menu%22%29%3B%0A%09%09%09node.className%20%3D%20%22menu-iconic%22%3B%0A%09%09%09node.setAttribute%28%22closemenu%22%2C%20%22none%22%29%3B%0A%09%09%09img%20%26%26%20node.setAttribute%28%22image%22%2C%20img%29%3B%0A%09%09%09akey%20%26%26%20node.setAttribute%28%22accesskey%22%2C%20akey%29%3B%0A%09%09%09%28node.pref%20%3D%20pref%29.vals%20%3D%20doc.ownerGlobal.Object.create%28null%29%3B%0A%09%09%09this.createRadios%28doc%2C%0A%09%09%09%09str.startsWith%28%22B%22%29%20%26%26%20%21pref.hasVals%20%3F%20%5B%5Btrue%2C%20%22true%22%5D%2C%20%5Bfalse%2C%20%22false%22%5D%5D%20%3A%20obj.values%2C%0A%09%09%09%09node.appendChild%28doc.createElementNS%28xul_ns%2C%20%22menupopup%22%29%29%0A%09%09%09%29%3B%0A%09%09%09if%20%28%22userChoice%22%20in%20obj%29%20pref.noAlt%20%3D%20%21%28%22userAlt%22%20in%20obj%29%3B%0A%09%09%09return%20node%3B%0A%09%09%7D%2C%0A%09%09createCloseMenusOption%28doc%2C%20btn%29%20%7B%0A%09%09%09var%20pn%20%3D%20this.closePref%20%3D%20%22QuickToggleAboutConfigSettings.closeMenus%22%3B%0A%09%09%09var%20data%20%3D%20%5Bnull%2C%20%7B%0A%09%09%09%09pref%3A%20%5Bpn%2C%20%22%u0417%u0430%u043A%u0440%u044B%u0432%u0430%u0442%u044C%20%u043C%u0435%u043D%u044E%20%u044D%u0442%u043E%u0439%20%u043A%u043D%u043E%u043F%u043A%u0438%22%5D%2C%20values%3A%20%5B%5Btrue%2C%20%22%u0414%u0430%22%5D%2C%20%5Bfalse%2C%20%22%u041D%u0435%u0442%22%5D%5D%0A%09%09%09%7D%5D%3B%0A%09%09%09var%20setCloseMenus%20%3D%20e%20%3D%3E%20%7B%0A%09%09%09%09e.stopPropagation%28%29%3B%0A%09%09%09%09var%20trg%20%3D%20e.target%2C%20%7Bpref%2C%20val%7D%20%3D%20trg%2C%20updPopup%20%3D%20true%2C%20clear%3B%0A%09%09%09%09switch%28e.type%29%20%7B%0A%09%09%09%09%09case%20%22command%22%3A%20pref%20%3D%20%28trg%20%3D%20trg.closest%28%22menu%22%29%29.pref%3B%20updPopup%20%3D%20false%3B%20break%3B%0A%09%09%09%09%09case%20%22click%22%3A%20if%20%28e.button%29%20return%3B%20break%3B%0A%09%09%09%09%09case%20%22contextmenu%22%3A%20e.preventDefault%28%29%3B%20clear%20%3D%20pref%3B%0A%09%09%09%09%7D%0A%09%09%09%09if%20%28%21pref%29%20return%3B%0A%09%09%09%09if%20%28clear%29%20prefs.clearUserPref%28pn%29%3B%0A%09%09%09%09else%20if%20%28%21updPopup%20%26%26%20val%20%3D%3D%3D%20pref.val%29%20return%3B%0A%09%09%09%09else%20pref.set%28pn%2C%20val%20%21%3D%3D%20undefined%20%3F%20val%20%3A%20%21pref.val%29%3B%0A%09%09%09%09this.upd%28trg%29%3B%0A%09%09%09%09updPopup%20%26%26%20this.popupshowing%28null%2C%20trg.querySelector%28%22menupopup%22%29%29%3B%0A%09%09%09%7D%0A%09%09%09%28this.createCloseMenusOption%20%3D%20%28doc%2C%20btn%29%20%3D%3E%20%7B%0A%09%09%09%09for%28var%20obj%20of%20data%29%0A%09%09%09%09%09btn.secondaryPopup.append%28this.createElement%28doc%2C%20obj%29%29%3B%0A%09%09%09%09var%20m%20%3D%20btn.secondaryPopup.lastChild%3B%0A%09%09%09%09m.style.cssText%20%3D%20%22fill%3A%20lightblue%20%21important%3B%20list-style-image%3A%20url%28chrome%3A//browser/skin/menu.svg%29%20%21important%3B%22%3B%0A%09%09%09%09m.setAttribute%28%22oncommand%22%2C%20%22setCloseMenus%28event%29%22%29%3B%0A%09%09%09%09m.onclick%20%3D%20m.oncontextmenu%20%3D%20m.setCloseMenus%20%3D%20setCloseMenus%3B%0A%09%09%09%7D%29%28doc%2C%20btn%29%3B%0A%09%09%7D%2C%0A%09%09UserChoiceImg%3A%20%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRUlEQVR42qWTS2gTQRjH/zPJZo2BDfgkB62vYg5CjQdvRUE8WB8HKyahYotIQQOeFKGCF7EgvQlBqOCjWFKlevBRDyL4uHloLXhYqWJroaEqlETSptndGb+ZPDH0ojN8O8vA98vv+/Itw38u1nSRYRE6UhKyg4FF1R292/Q+xhhLi4TIrgjgIzwe4MbgmR2nrZMtxxEN63zYORuPZp7gzpehvCu9XjfuPmwCUHIiEtw4fK89zVvD2+FHAD56quXBpV3CVO4ret6nxHzxZxdBRuqADCKmz7RHD9y2tlmbYbBVfwE8DXBkEd/y39H5+mze8ZyoSIpsFXC9u/VE3/ldpyg5AAMEoJMTQi2hANKBgyKdy0h/eoChqcf9MimvVAHjd/fdiG0NRwgQpDAp1agBpDZwdHKJLKZzc+h5e3kCSexh5c5j8fmhW0HGpNZXFkqfsQpAKgcFKGmAlAxHXp5bkkmsrhosjh4cCIJ5pG5qfQXgtMslqO1qgEMWTPrR+eriEhoA4wN7L8TWh0KVXzfgY2RQAUjVBenWLH4UCrj04Wa9BNXEo5va+w63xCiJ6WRVP2MVgNQIgjgEA17MTODZ7Lt+AtSaGDG4377a1m2FAkKrc11/dUwIID1dSKHEcW3yft4RbpR6kK1PYgaJtaY1nNp5jIeMsjKNbs1AWRUcjvTnp2Kh9LtLJGTDINUhcTIZ3L+hzdq9ZgvWmSF9/Wu5gI8L03gzP5l3hddL/3/zKDdA9MdE0UERrdzaFGMUaap75Y/pX9Yfap76EQYaCeEAAAAASUVORK5CYII%3D%22%2C%0A%09%09notUserChoiceImg%3A%20%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACNUlEQVR42qXTT2jTUBwH8G9e0ta2ks5ND0Ww/qX1oGyevEwQnOBA6EHXwLwoUh3eRGRs501RPE6xgp6KrexQECZY8DBPXmbRS4Z/K0gRtmmDa2yb5PlLX7p2Gwpi4EfCy8sn3/dPwn9e0saGnCRF6XYFnA9DkhKtRs51ep6jmtEcp/JHIM9Yivl9mf0XNDV2Ngn1YLzVxdB1lJ8U8P5hzuCWnR6xrPwmIM8kLRjdkT326BaLHNgLKAFA9ouXdhOw6qi++4j589cd89vSaMqyc2sAPUXlgF8fyt9WI3t2Av4w4NsCMJ8AHAKav6hqqH76iuLINcNuNhOawyttYCp+7tRE/6XT9GFQAG4CpniATQkIaNQIMVG6/xSL2WfTGueTbWDh5L2rA9t29QGBrQQEPUDuAuoEmFSr+P5lGc8v33mtAUfaQO3M4/GgDOoYCIkUin8D0BDDoBQ2ZMxqN0wCQh0gMxaUnYb4uzt+dwIZ8wBHTGQbYAHMpu+uAxaGxpMDvSr3AHcFaAIlD+BtoN6ag5WqhOLNwrohTMWPH5roP7pdLIwb3wW6EziWGAZhpVdLWHzxdpqAyc4yKrJ+4uKg2oMV+lgRK9CdwAVsG1WpF8UH84Zt2QkCKmsbiRAtFAllB5OHWQ9fpr81OwlcgBL9kPrwsvDGMQ1zNMV5ZyN1ISlZYZl9/TE1tjuMSFgA1VWO8uef+FAqG47tpFMcm7dyFyIOEzBMlfCadao5qhk39l9P479evwFbiOcRSXKueAAAAABJRU5ErkJggg%3D%3D%22%2C%0A%09%09UserAltImg%3A%20%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIfSURBVDhPpVM9b9NQFD02cSKKFVGKIFFREFsmFiCA1AEQQrQjC0gssLCkC0jJj0iFWFoGdiT4Ay0SEmJBhPI5FBokikL4SCC0Te2UxInt13Mdu1CVrVc6713fe86x/T6w09DCeTNKJ7Q0pzyUmoCmZYOiUhXms8RMcd6vB7UwthhM5fTLWix2L3PmYjKdOwdz9DDFGtr1KuovnqD29JGlfO9Goew9DCV/DaZy2pXE8PD9Y/mbupk6xE6cVWPQhEujHo2+4fXdO76ztnq1UPYfSCcwKB1HWjeMyunCraSZOsDqbkBPsBOTNoMGvkOTLto/f+F56bble262OK/qesiYzIydTJojFLjrgEe4bcIOEdXWYe6LITN2KgmFSRFGBuPpo0eAngX0SexTJHD5LOgLpEZTcgKuUuMijAyy5l7+r0NSb21g5LQI5gGYSy2AjYBLjQyRAUniTnJXsBoayBzm3RBBndwwIoOK3fgNdIREQYCV/0DqLdiNZqCRITKYayx85RfQuUNiZ3k7IgO+vfGeXGpkiAyma++WLHtZhZ8o5H/FEVpos1V7u8TFwLQId8nw+Afa51Oq2vyycmlk9KCW0GXFZeu63IUO8z88Bx5s28SbuUXfddzrxVcobxpI0GTh7H734/dPzQt9d0/CGBpCPB7nbhmwbAPVxR4+PPtsuU7/WuElth/lKORUcsoTE8TgMg0WbJaY4Zu3XKYdBrABARUk+ls4DfQAAAAASUVORK5CYII%3D%22%2C%0A%09%09upd%28node%29%20%7B%0A%09%09%09var%20%7Bpref%7D%20%3D%20node%2C%20def%20%3D%20false%2C%20user%20%3D%20false%2C%20val%3B%0A%09%09%09if%20%28prefs.getPrefType%28pref.pref%29%20%21%3D%20prefs.PREF_INVALID%29%20%7B%0A%09%09%09%09var%20pn%20%3D%20pref.pref%3B%0A%09%09%09%09try%20%7Bval%20%3D%20pref.defVal%20%3D%20db%5Bpref.get.name%5D%28pn%29%3B%20def%20%3D%20true%7D%0A%09%09%09%09catch%28ex%29%20%7Bdef%20%3D%20false%3B%7D%0A%09%09%09%09var%20user%20%3D%20prefs.prefHasUserValue%28pn%29%3B%0A%09%09%09%09if%20%28user%29%20try%20%7Bval%20%3D%20pref.get%28pn%2C%20undefined%29%3B%7D%20catch%28ex%29%20%7B%7D%0A%09%09%09%7D%0A%09%09%09if%20%28val%20%3D%3D%20pref.val%20%26%26%20def%20%3D%3D%20pref.def%20%26%26%20user%20%3D%3D%20pref.user%29%20return%3B%0A%09%09%09pref.val%20%3D%20val%3B%20pref.def%20%3D%20def%3B%20pref.user%20%3D%20user%3B%0A%09%09%09var%20exists%20%3D%20def%20%7C%7C%20user%3B%0A%0A%09%09%09var%20ttt%20%3D%20exists%20%3F%20val%20%3A%20%22%u042D%u0442%u043E%u0433%u043E%20%u043F%u0440%u0435%u0444%u0430%20%u043D%u0435%20%u0441%u0443%u0449%u0435%u0441%u0442%u0432%u0443%u0435%u0442%22%3B%0A%09%09%09if%20%28ttt%20%3D%3D%3D%20%22%22%29%20ttt%20%3D%20%22%5B%20empty_string%20%5D%22%3B%0A%09%09%09ttt%20+%3D%20%22%5Cn%22%20+%20pref.pref%3B%0A%09%09%09if%20%28pref.ttt%29%20ttt%20+%3D%20%22%5Cn%22%20+%20pref.ttt%3B%0A%09%09%09node.tooltipText%20%3D%20ttt%3B%0A%0A%09%09%09var%20img%2C%20alt%20%3D%20%22userAlt%22%20in%20pref%20%26%26%20val%20%3D%3D%20pref.userAlt%3B%0A%09%09%09if%20%28alt%29%20img%20%3D%20this.UserAltImg%3B%0A%09%09%09if%20%28%22userChoice%22%20in%20pref%29%0A%09%09%09%09if%20%28val%20%3D%3D%20pref.userChoice%29%0A%09%09%09%09%09//node.style.removeProperty%28%22color%22%29%2C%0A%09%09%09%09%09img%20%3D%20this.UserChoiceImg%3B%0A%09%09%09%09else%20%7B%0A%09%09%09%09%09//node.style.setProperty%28%22color%22%2C%20%22maroon%22%2C%20%22important%22%29%3B%0A%09%09%09%09%09if%20%28%21alt%29%20img%20%3D%20this.notUserChoiceImg%3B%0A%09%09%09%09%7D%0A%09%09%09if%20%28%21pref.img%29%20img%0A%09%09%09%09%3F%20node.setAttribute%28%22image%22%2C%20img%29%0A%09%09%09%09%3A%20node.removeAttribute%28%22image%22%29%3B%0A%09%09%09user%0A%09%09%09%09%3F%20node.style.setProperty%28%22font-style%22%2C%20%22italic%22%2C%20%22important%22%29%0A%09%09%09%09%3A%20node.style.removeProperty%28%22font-style%22%29%3B%0A%0A%09%09%09var%20%7Blab%7D%20%3D%20pref%3B%0A%09%09%09if%20%28exists%20%26%26%20pref.hasVals%29%20%7B%0A%09%09%09%09if%20%28val%20in%20pref.vals%29%20var%20sfx%20%3D%20pref.vals%5Bval%5D%20%7C%7C%20val%3B%0A%09%09%09%09else%20var%20sfx%20%3D%20user%20%3F%20%22%u0414%u0440%u0443%u0433%u043E%u0435%22%20%3A%20%22%u041F%u043E%20%u0443%u043C%u043E%u043B%u0447%u0430%u043D%u0438%u044E%22%3B%0A%09%09%09%09lab%20+%3D%20%60%20%u2014%20%22%24%7Bsfx%7D%22%60%3B%0A%09%09%09%7D%0A%09%09%09node.setAttribute%28%22label%22%2C%20lab%29%3B%0A%09%09%7D%2C%0A%09%09createRadios%28doc%2C%20vals%2C%20popup%29%20%7B%0A%09%09%09for%28var%20arr%20of%20vals%29%20%7B%0A%09%09%09%09if%20%28%21arr%29%20%7B%0A%09%09%09%09%09popup.append%28doc.createElementNS%28xul_ns%2C%20%22menuseparator%22%29%29%3B%0A%09%09%09%09%09continue%3B%0A%09%09%09%09%7D%0A%09%09%09%09var%20%5Bval%2C%20lab%2C%20key%2C%20ttt%5D%20%3D%20arr%3B%0A%09%09%09%09var%20menuitem%20%3D%20doc.createElementNS%28xul_ns%2C%20%22menuitem%22%29%3B%0A%09%09%09%09menuitem.setAttribute%28%22type%22%2C%20%22radio%22%29%3B%0A%09%09%09%09menuitem.setAttribute%28%22closemenu%22%2C%20%22none%22%29%3B%0A%09%09%09%09menuitem.style.setProperty%28%22font-style%22%2C%20%22italic%22%2C%20%22important%22%29%2C%0A%09%09%09%09menuitem.setAttribute%28%22label%22%2C%20popup.parentNode.pref.vals%5Bval%5D%20%3D%20lab%29%3B%0A%09%09%09%09key%20%26%26%20menuitem.setAttribute%28%22accesskey%22%2C%20key%29%3B%0A%09%09%09%09var%20tip%20%3D%20menuitem.val%20%3D%20val%3B%0A%09%09%09%09if%20%28ttt%29%20tip%20+%3D%20%22%5Cn%22%20+%20ttt%3B%0A%09%09%09%09menuitem.tooltipText%20%3D%20tip%3B%0A%09%09%09%09popup.append%28menuitem%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%0A%09%09openPopup%28popup%29%20%7B%0A%09%09%09var%20btn%20%3D%20popup.parentNode%3B%0A%09%09%09if%20%28btn.domParent%20%21%3D%20btn.parentNode%29%20%7B%0A%09%09%09%09btn.domParent%20%3D%20btn.parentNode%3B%0A%09%09%09%09var%20pos%3B%0A%09%09%09%09if%20%28btn.matches%28%22.widget-overflow-list%20%3E%20%3Ascope%22%29%29%0A%09%09%09%09%09pos%20%3D%20%22after_start%22%3B%0A%09%09%09%09else%20var%20win%20%3D%20btn.ownerGlobal%2C%20%7Bwidth%2C%20height%2C%20top%2C%20bottom%2C%20left%2C%20right%7D%20%3D%0A%09%09%09%09%09btn.closest%28%22toolbar%22%29.getBoundingClientRect%28%29%2C%20pos%20%3D%20width%20%3E%20height%0A%09%09%09%09%09%09%3F%20%60%24%7Bwin.innerHeight%20-%20bottom%20%3E%20top%20%3F%20%22after%22%20%3A%20%22before%22%7D_start%60%0A%09%09%09%09%09%09%3A%20%60%24%7Bwin.innerWidth%20-%20right%20%3E%20left%20%3F%20%22end%22%20%3A%20%22start%22%7D_before%60%3B%0A%09%09%09%09for%28var%20p%20of%20btn.popups%29%20p.setAttribute%28%22position%22%2C%20pos%29%3B%0A%09%09%09%7D%0A%09%09%09popup.openPopup%28btn%29%3B%0A%09%09%7D%2C%0A%09%09maybeRestart%28node%2C%20conf%29%20%7B%0A%09%09%09var%20msgRest%20%3D%20%22%u041F%u0435%u0440%u0435%u0437%u0430%u043F%u0443%u0441%u0442%u0438%u0442%u044C%20%u0431%u0440%u0430%u0443%u0437%u0435%u0440%3F%22%2C%20msgAbort%20%3D%20%22%u0417%u0430%u043F%u0440%u043E%u0441%20%u043D%u0430%20%u0432%u044B%u0445%u043E%u0434%20%u043E%u0442%u043C%u0435%u043D%u0435%u043D.%22%3B%0A%09%09%09if%20%28pv%20%3E%3D%2077%29%20%7B%0A%09%09%09%09var%20title%20%3D%20node.closest%28%22toolbarbutton%22%29.label%3B%0A%09%09%09%09var%20pp%20%3D%20domWin%20%3D%3E%20Services.prompt.wrappedJSObject.pickPrompter%28%7B%0A%09%09%09%09%09domWin%2C%20modalType%3A%20Ci.nsIPrompt.MODAL_TYPE_WINDOW%0A%09%09%09%09%7D%29%3B%0A%09%09%09%09var%20confirm%20%3D%20win%20%3D%3E%20pp%28win%29.confirm%28title%2C%20msgRest%29%3B%0A%09%09%09%09var%20alert%20%3D%20win%20%3D%3E%20pp%28win%29.alert%28title%2C%20msgAbort%29%3B%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09var%20confirm%20%3D%20win%20%3D%3E%20win.confirm%28msgRest%29%3B%0A%09%09%09%09var%20alert%20%3D%20win%20%3D%3E%20win.alert%28msgAbort%29%3B%0A%09%09%09%7D%0A%09%09%09return%20%28this.mayBeRestart%20%3D%20%28node%2C%20conf%29%20%3D%3E%20%7B%0A%09%09%09%09var%20win%20%3D%20node.ownerGlobal%3B%0A%09%09%09%09if%20%28conf%20%26%26%20%21confirm%28win%29%29%20return%3B%0A%09%09%09%09if%20%28win.BrowserUtils.restartApplication%28%29%20%3D%3D%3D%20false%29%20alert%28win%29%3B%0A%09%09%09%09else%20return%20true%3B%0A%09%09%09%7D%29%28node%2C%20conf%29%3B%0A%09%09%7D%2C%0A%09%09regexpRefresh%3A%20/%5E%28%3F%3Aview-source%3A%29%3F%28%3F%3Ahttps%3F%7Cftp%29/%2C%0A%09%09maybeRe%28node%2C%20fe%29%20%7B%0A%09%09%09var%20%7Bpref%7D%20%3D%20node%3B%0A%09%09%09if%20%28%22restart%22%20in%20pref%29%20%7B%0A%09%09%09%09if%20%28this.maybeRestart%28node%2C%20pref.restart%29%29%20return%3B%0A%09%09%09%7D%0A%09%09%09else%20this.popupshowing%28fe%2C%20node.parentNode%29%3B%0A%09%09%09if%20%28%22refresh%22%20in%20pref%29%20%7B%0A%09%09%09%09var%20win%20%3D%20node.ownerGlobal%3B%0A%09%09%09%09if%20%28this.regexpRefresh.test%28win.gBrowser.currentURI.spec%29%29%20pref.refresh%0A%09%09%09%09%09%3F%20win.BrowserReloadSkipCache%28%29%20%3A%20win.BrowserReload%28%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%0A%09%09maybeClosePopup%28e%2C%20trg%29%20%7B%0A%09%09%09%21e.ctrlKey%20%26%26%20prefs.getBoolPref%28this.closePref%2C%20undefined%29%0A%09%09%09%09%26%26%20trg.parentNode.hidePopup%28%29%3B%0A%09%09%7D%2C%0A%09%09command%28e%29%20%7B%0A%09%09%09var%20trg%20%3D%20e.target%3B%0A%09%09%09if%20%28trg.btn%29%20return%20this.openPopup%28trg.primaryPopup%29%3B%0A%0A%09%09%09var%20menu%20%3D%20trg.closest%28%22menu%22%29%2C%20newVal%20%3D%20trg.val%3B%0A%09%09%09this.maybeClosePopup%28e%2C%20menu%29%3B%0A%09%09%09if%20%28newVal%20%21%3D%20menu.pref.val%29%0A%09%09%09%09menu.pref.set%28menu.pref.pref%2C%20newVal%29%2C%0A%09%09%09%09this.maybeRe%28menu%2C%20true%29%3B%0A%09%09%7D%2C%0A%09%09popupshowing%28e%2C%20trg%20%3D%20e.target%29%20%7B%0A%09%09%09if%20%28trg.state%20%3D%3D%20%22closed%22%29%20return%3B%0A%09%09%09if%20%28trg.id%29%20%7B%0A%09%09%09%09for%28var%20node%20of%20trg.children%29%20%7B%0A%09%09%09%09%09if%20%28node.nodeName.endsWith%28%22r%22%29%29%20continue%3B%0A%09%09%09%09%09this.upd%28node%29%3B%0A%09%09%09%09%09%21e%20%26%26%20node.open%20%26%26%20this.popupshowing%28null%2C%20node.querySelector%28%22menupopup%22%29%29%3B%0A%09%09%09%09%7D%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09var%20%7Bpref%7D%20%3D%20trg.closest%28%22menu%22%29%2C%20findChecked%20%3D%20true%3B%0A%0A%09%09%09var%20findDef%20%3D%20%22defVal%22%20in%20pref%3B%0A%09%09%09var%20checked%20%3D%20trg.querySelector%28%22%5Bchecked%5D%22%29%3B%0A%09%09%09if%20%28checked%29%20%7B%0A%09%09%09%09if%20%28checked.val%20%3D%3D%20pref.val%29%20%7B%0A%09%09%09%09%09if%20%28findDef%29%20findChecked%20%3D%20false%3B%0A%09%09%09%09%09else%20return%3B%0A%09%09%09%09%7D%0A%09%09%09%09else%20checked.removeAttribute%28%22checked%22%29%3B%0A%09%09%09%7D%0A%09%09%09if%20%28findDef%29%20%7B%0A%09%09%09%09var%20def%20%3D%20trg.querySelector%28%22menuitem%3Anot%28%5Bstyle*%3Dfont-style%5D%22%29%3B%0A%09%09%09%09if%20%28def%29%0A%09%09%09%09%09if%20%28def.val%20%3D%3D%20pref.defVal%29%20%7B%0A%09%09%09%09%09%09if%20%28findChecked%29%20findDef%20%3D%20false%3B%0A%09%09%09%09%09%09else%20return%3B%0A%09%09%09%09%09%7D%0A%09%09%09%09%09else%20def.style.setProperty%28%22font-style%22%2C%20%22italic%22%2C%20%22important%22%29%3B%0A%09%09%09%7D%0A%09%09%09for%28var%20node%20of%20trg.children%29%20if%20%28%22val%22%20in%20node%29%20%7B%0A%09%09%09%09if%20%28findChecked%20%26%26%20node.val%20%3D%3D%20pref.val%29%20%7B%0A%09%09%09%09%09node.setAttribute%28%22checked%22%2C%20true%29%3B%0A%09%09%09%09%09if%20%28findDef%29%20findChecked%20%3D%20false%3B%0A%09%09%09%09%09else%20break%3B%0A%09%09%09%09%7D%0A%09%09%09%09if%20%28findDef%20%26%26%20node.val%20%3D%3D%20pref.defVal%29%20%7B%0A%09%09%09%09%09node.style.removeProperty%28%22font-style%22%29%3B%0A%09%09%09%09%09if%20%28findChecked%29%20findDef%20%3D%20false%3B%0A%09%09%09%09%09else%20break%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%2C%0A%09%09contextmenu%28e%29%20%7B%0A%09%09%09var%20trg%20%3D%20e.target%3B%0A%09%09%09if%20%28trg.btn%29%20%7B%0A%09%09%09%09if%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%29%20return%3B%0A%09%09%09%09if%20%28e.detail%20%3D%3D%202%29%20return%20trg.secondaryPopup.hidePopup%28%29%3B%0A%09%09%09%09this.openPopup%28trg.secondaryPopup%29%3B%0A%09%09%09%7D%0A%09%09%09else%20if%20%28%22pref%22%20in%20trg%29%20%7B%0A%09%09%09%09this.maybeClosePopup%28e%2C%20trg%29%3B%0A%09%09%09%09if%20%28trg.pref.user%29%0A%09%09%09%09%09prefs.clearUserPref%28trg.pref.pref%29%2C%0A%09%09%09%09%09this.maybeRe%28trg%29%3B%0A%09%09%09%7D%0A%09%09%09e.preventDefault%28%29%3B%0A%09%09%7D%2C%0A%09%09click%28e%29%20%7B%0A%09%09%09if%20%28e.button%29%20return%3B%0A%09%09%09var%20trg%20%3D%20e.target%2C%20%7Bpref%7D%20%3D%20trg%3B%0A%09%09%09if%20%28%21pref%29%20return%3B%0A%0A%09%09%09this.maybeClosePopup%28e%2C%20trg%29%3B%0A%09%09%09if%20%28%21%28%22noAlt%22%20in%20pref%29%29%20return%3B%0A%0A%09%09%09if%20%28pref.val%20%3D%3D%20pref.userChoice%29%0A%09%09%09%09if%20%28pref.noAlt%29%20return%3B%0A%09%09%09%09else%20%20pref.set%28pref.pref%2C%20pref.userAlt%29%3B%0A%09%09%09else%0A%09%09%09%09pref.set%28pref.pref%2C%20pref.userChoice%29%3B%0A%09%09%09this.maybeRe%28trg%29%3B%0A%09%09%7D%0A%09%7D%3B%0A%7D%29%3B%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E


4. В настройках Custom Buttons включить обратно инициализацию кнопок
    (так же как выключил, только наоборот).
5. Открыть вкладку с адресом about:restartrequired и нажать кнопку «Перезапустить Firefox».


Dobrov пишет

Эта кнопка по коду от моей отличается только отсутствием Mouse LongClick…

Это не совсем так.
Немного отличается метод contextmenu(), а метод click() вообще отсутствует.
То есть, хорошо бы заменить contextmenu(e) {...}, на это

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

Выделить код

Код:

...
		contextmenu(e) {
			var trg = e.target;
			if (trg.btn) {
				if (e.ctrlKey || e.shiftKey) return;
				if (e.detail == 2) return trg.secondaryPopup.hidePopup();
				this.openPopup(trg.secondaryPopup);
			}
			else if ("pref" in trg) {
				this.maybeClosePopup(e, trg);
				if (trg.pref.user)
					prefs.clearUserPref(trg.pref.pref),
					this.maybeRe(trg);
			}
			e.preventDefault();
		},
		click(e) {
			if (e.button) return;
			var trg = e.target, {pref} = trg;
			if (!pref) return;

			this.maybeClosePopup(e, trg);
			if (!("noAlt" in pref)) return;

			if (pref.val == pref.userChoice)
				if (pref.noAlt) return;
				else  pref.set(pref.pref, pref.userAlt);
			else
				pref.set(pref.pref, pref.userChoice);
			this.maybeRe(trg);
		},

Dobrov пишет

Уточню, для QuickToggleSettings все варианты не нужны! Наиболее удобный, это убрать подсказку совсем или переделать, чтобы её текст был строкой с ключевым словом. А текст, начинающийся НЕ с ключевого слова, запускать как строку кода.

Выделить код

Код:

values: [
    ["https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "TOOLTIP после ключевого слова - текст подсказки", 
    "custombuttons.setPrefs("network.proxy.type", 2)"], нет ключевого слова TOOLTIP, значит выполнить эту строку как Java-код.

Полезное уточнение, только какое-то слегка ин-валидное.
Описание не соответствует коду.
И вообще, зачем трогать подсказку? Не проще ли так:
если в массиве есть пятый элемент — значит это строка кода,
и нужно «выполнить эту строку как Java-код».
Что-то типа такого

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

Выделить код

Код:

/*
			pref.set = prefs[`set${str}Pref`];
*/
			var map, set = prefs[`set${str}Pref`];
			if (pref.hasVals) {
				for(var [val, , , , code] of obj.values)
					code && (map || (map = new Map())).set(val, code);

				if (map) pref.set = (key, val) => {
					set(key, val);
					map.has(val) && eval(map.get(val));
				}
			}
			if (!map) pref.set = set;

Dobrov пишет

ещё хотелка для QuickToggleSettings

Что за странная тяга напихать в одну кнопку всего побольше.
Там и так уже лис ногу сломит. Сделай себе такую отдельную,
большого труда, полагаю, не составит.

Отсутствует

 

№1535625-03-2021 11:09:16

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

Re: Custom Buttons

Dumby пишет

если в массиве есть пятый элемент — значит это строка кода,

Конечно, так лучше, чем анализировать элементы массива!


Dumby пишет

Немного отличается метод contextmenu(), а метод click() вообще отсутствует.

Но ведь в мою кнопку click не нужен? В ней только mousedown(e) {…


Dumby пишет

Что за странная тяга напихать в одну кнопку всего побольше.
Там и так уже лис ногу сломит. Сделай себе такую отдельную,

Я и хотел проще - по левому клику открывать меню настроек, а по правому простое меню, где каждый пункт запускается сразу!


Dumby - исправил кнопку, но код в пятом элементе массива не запускается:

Выделить код

Код:

["https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "Надёжный доступ на заблокированные сайты\n\nУстановите «Настройки прокси» = 2"
, "e.view.alert('JS CODE');"]
Выделить код

Код:

// Quick Toggle https://forum.mozilla-russia.org/viewtopic.php?pid=784139#p784139
// https://forum.mozilla-russia.org/viewtopic.php?pid=784165#p784165
// Быстрое переключение параметров about:config
// LongClick не срабатывает второй раз, сначала нужно открыть меню

(async (name, id, func) => {
	if (name == "Object") return CustomizableUI.createWidget(func());
	var win = name == "Window", g = Components.utils.import("resource://gre/modules/Services.jsm", {});
	if (g[id]) {if (win) return;} else g[id] = func();
	if (win) return CustomizableUI.createWidget(g[id]);
	addDestructor(r => r[5] == "e" && delete g[id]);
	g[id].onCreated(this);
})(this.constructor.name, "QuickToggleAboutConfigSettingsUCF", () => {
	var {prefs} = Services, db = prefs.getDefaultBranch("");
	var pv = parseInt(Services.appinfo.platformVersion);
	var xul_ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

//=====================================================================================

	// refresh:
	//	false - reload current tab
	//	true - reload current tab skip cache
	//
	// restart:
	//	false - restart browser
	//	true - restart browser with confirm

	var primary = [{
			pref: ["network.proxy.autoconfig_url", "Прокси (VPN) URL"],
			userChoice: 0, userAlt: 1, refresh: true,
			values: [
				["127.0.0.1", "отключен…", "0"],
				["https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "Надёжный доступ на заблокированные сайты\n\nУстановите «Настройки прокси» = 2", "e.view.alert('JS CODE');"],
				[prefs.getStringPref("user.pacfile", "file:///etc/proxy.pac"), "user .pac файл", "2"],
				["https://git.io/ac-anticensority-pac", "ac-anticensority", "3"],
				["localhost", "Tor Browser", "4"]
	]},{
			pref: ["network.proxy.type", "Режим прокси"],
			userChoice: 0, userAlt: 2, refresh: true,
			values: [
				[0, "Без прокси", "0", "по-умолчанию"],
				[5, "Системные (из IE)", "5"],
				[2, "URL автонастройки", "2", "about:config — user.pacfile"],
				[1, "Ручная настройка", "1", "вторая строка"],
				[4, "Автоопределение", "4"]
	]},{
			pref: ["network.proxy.share_proxy_settings", "Прокси для всех протоколов"],
			userChoice: true, refresh: true,
			values: [[true, "Да", "", "Прокси для всех протоколов при ручной настройке"], [false, "Нет"]]
	},{
			pref: ["network.trr.mode", "DNS через HTTPS"],
			userChoice: 2, userAlt: 0, refresh: true,
			values: [
				[0, "Выключен", "0"], [2, "TRR + мой", "2"], [3, "только TRR", "3"]
	]},null,{
			pref: ["permissions.default.image", "Разрешить загрузку изображений"],
			userChoice: 1, userAlt: 3, refresh: true,
			values: [[1, "Да"], [3, "Только с сайта"], [2, "Нет"]]
	},{
			pref: ["image.animation_mode", "Анимация изображений"],
			userChoice: "none", refresh: true,
			values: [["none", "Выключена"], ["normal", "Включена"], ["once", "Единожды"]]
	},{
			pref: ["browser.display.use_document_fonts", "Загружать web-шрифты"],
			userChoice: 1, refresh: true,
			values: [[1, "Да"], [0, "Нет"]]
	},null,{
			pref: ["media.autoplay.default", "Авто-play аудио/видео"],
			userChoice: 5, refresh: true,
			values: [
				[0, "Разрешить", "0"],
				[1, "Запретить", "1"],
				[2, "Спрашивать", "2"],
				[5, "Блокировать", "5"]
	]},{
			pref: ["media.autoplay.blocking_policy", "Автозапуск (политика)"],
			userChoice: 1, userAlt: 2, refresh: true,
			values: [
				[1, "Временная", "1"],
				[2, "По действию", "2"],
				[0, "Постоянная", "0"]
	]},{
			pref: ["plugin.state.flash", "Flash-plugin"],
			userChoice: 2, refresh: true,
			values: [
				[2, "Всегда включать", "2"],
				[1, "Включать по запросу", "1"],
				[0, "Никогда не включать", "0"]
	]},null,{
			pref: ["network.cookie.cookieBehavior", "Cookies"],
			userChoice: 1, userAlt: 3, refresh: false,
			values: [
				[1, "Не принимать сторонние"], [3, "Не принимать с не посещенных"], [4, "Не принимать от трекеров"],
				[2, "Не принимать со всех"], [0, "Принимать со всех"]
	]},{
			pref: ["javascript.enabled", "Выполнять скрипты Java"],
			userChoice: true, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	},null,{
			pref: ["dom.storage.enabled", "Локальное хранилище"],
			userChoice: true
	}
];

//=====================================================================================

	var secondary = [{

			pref: ["dom.enable_performance", "Статус загрузки страницы"],
			userChoice: false
	},{
			pref: ["browser.display.document_color_use", "Использовать цвета сайтов"],
			userChoice: 0,
			values: [[0, "Авто", "0"], [1, "Всегда", "1"], [2, "Никогда", "2"]]
	},{
			pref: ["intl.accept_languages", "Язык для веб-страниц"],
			userChoice: "ru-RU, ru, en-US, en",
			values: [["chrome://global/locale/intl.properties", "По-умолчанию"], ["en-US, en, ru-RU, ru", "Английская локаль"], ["ru-RU, ru, en-US, en", "Русская локаль"]]
	},null,{
			pref: ["network.http.sendRefererHeader", "Referer - для чего"],
			userChoice: 1,
			values: [[0, "Ни для чего", "0"], [1, "Только ссылки", "1"], [2, "Ссылки и изобр.", "2"]]
  },{
			pref: ["media.peerconnection.enabled", "WebRTC утечка IP"],
			userChoice: false
	},{
			pref: ["gfx.webrender.all", "WebRender для всего"],
			userChoice: false, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	},{
			pref: ["media.webm.enabled", "Декодер WebM VP8"],
			userChoice: false, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	}
	];

	return {
		label: "Quick Toggle Settings",
		id: "QuickToggleAboutConfigSettings",
		tooltiptext: "Quick Toggle Settings\n	ЛКМ	ПКМ",
		localized: false,
		image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFPSURBVDhPnVPNSsNAEJ5tamnBk+A7BMEcikohp/gi9i18nRafQoT00kK16tnn8CJo4vp9m5m41eSgH0zmd3d+diJ/gfdedvl0QW7k1PcLwem+3TjowZagK+Nn6yc3gNCJ+LCCh9LzzTMdqeoNbkQSFZmpJLGCW5Gx2hZaQahMbZ52VuDSfHpnAVJXOb4FKzianbzCXiLrHLYl5C3t5NTRwtxaKJxUTZ/JcOTr6q2Rxwf0aVb2/hLs4KqL3Isckz/mmSdRRksjyg+z7IM6LzDCBfuvAEOJmIKBOqAWmo1YodxLlQNsyO0rsIV/AZM+JGc2a4GgzhZ2p9mFmrpboCMqNYBDdMlwompoTWN6F2nFT5hBXb0PEpmo/Gk+oH+RrqNZINPeIlnZViV1jQuLFJQuWGB0gJdwgShvqdPXZv6J+F/QS7oXqQ9xBTFZ5oa8fAGs9fed5YhPSwAAAABJRU5ErkJggg==",
		onCreated(btn) {
			btn.setAttribute("image", this.image);
			var doc = btn.ownerDocument;

			btn.btn = true;
			btn.domParent = null;
			btn.popups = new btn.ownerGlobal.Array();
			this.createPopup(doc, btn, "primary", primary);
			this.createPopup(doc, btn, "secondary", secondary);
			this.createCloseMenusOption(doc, btn);

			btn.linkedObject = this;
			for(var type of ["command", "contextmenu", "mousedown"])
				btn.setAttribute("on" + type, `linkedObject.${type}(event)`);
		},
		createPopup(doc, btn, name, data) {
			var popup = doc.createElementNS(xul_ns, "menupopup");
			var prop = name + "Popup";
			btn.popups.push(btn[prop] = popup);
			popup.id = this.id + "-" + prop;
			for (var type of ["popupshowing", "click"])
				popup.setAttribute("on" + type, `parentNode.linkedObject.${type}(event)`);
			for(var obj of data) popup.append(this.createElement(doc, obj));
			btn.append(popup);
		},
		map: {b: "Bool", n: "Int", s: "String"},
		createElement(doc, obj) {
			if (!obj) return doc.createElementNS(xul_ns, "menuseparator");
			var pref = doc.ownerGlobal.Object.create(null), node, img, bool;
			for(var [key, val] of Object.entries(obj)) {
				if (key == "pref") {
					var [apref, lab, akey, ttt] = val;
					pref.pref = apref; pref.lab = lab || apref;
					if (ttt) pref.ttt = ttt;
				}
				else if (key == "image") img = val, pref.img = true;
				else if (key != "values") pref[key] = val;
				else pref.hasVals = true;
			}
			var type = prefs.getPrefType(pref.pref);
			var str = this.map[type == prefs.PREF_INVALID
				? obj.values ? (typeof obj.values[0][0])[0] : "b"
				: type == prefs.PREF_BOOL ? "b" : type == prefs.PREF_INT ? "n" : "s"
			];
			pref.get = prefs[`get${str}Pref`];
/*
			pref.set = prefs[`set${str}Pref`];
*/
			var map, set = prefs[`set${str}Pref`];
			if (pref.hasVals) {
				for(var [val, , , , code] of obj.values)
					code && (map || (map = new Map())).set(val, code);
				if (map) pref.set = (key, val) => {
					set(key, val);
					map.has(val) && eval(map.get(val)); // выполнить код
				}
			}
			if (!map) pref.set = set;

			node = doc.createElementNS(xul_ns, "menu");
			node.className = "menu-iconic";
			node.setAttribute("closemenu", "none");
			img && node.setAttribute("image", img);
			akey && node.setAttribute("accesskey", akey);
			(node.pref = pref).vals = doc.ownerGlobal.Object.create(null);
			this.createRadios(doc,
				str.startsWith("B") && !pref.hasVals ? [[true, "true"], [false, "false"]] : obj.values,
				node.appendChild(doc.createElementNS(xul_ns, "menupopup"))
			);
			if ("userChoice" in obj) pref.noAlt = !("userAlt" in obj);
			return node;
		},
		createCloseMenusOption(doc, btn) {
			var pn = this.closePref = "QuickToggleAboutConfigSettings.closeMenus";
			var data = [null, {
				pref: [pn, "Закрывать меню этой кнопки"], values: [[true, "Да"], [false, "Нет"]]
			}];
			var setCloseMenus = e => {
				e.stopPropagation();
				var trg = e.target, {pref, val} = trg, updPopup = true, clear;
				switch(e.type) {
					case "command": pref = (trg = trg.closest("menu")).pref; updPopup = false; break;
					case "click": if (e.button) return; break;
					case "contextmenu": e.preventDefault(); clear = pref;
				}
				if (!pref) return;
				if (clear) prefs.clearUserPref(pn);
				else if (!updPopup && val === pref.val) return;
				else pref.set(pn, val !== undefined ? val : !pref.val);
				this.upd(trg);
				updPopup && this.popupshowing(null, trg.querySelector("menupopup"));
			}
			(this.createCloseMenusOption = (doc, btn) => {
				for(var obj of data)
					btn.secondaryPopup.append(this.createElement(doc, obj));
				var m = btn.secondaryPopup.lastChild;
				m.style.cssText = "fill: lightblue !important; list-style-image: url(chrome://browser/skin/menu.svg) !important;";
				m.setAttribute("oncommand", "setCloseMenus(event)");
				m.onclick = m.oncontextmenu = m.setCloseMenus = setCloseMenus;
			})(doc, btn);
		},
		UserChoiceImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRUlEQVR42qWTS2gTQRjH/zPJZo2BDfgkB62vYg5CjQdvRUE8WB8HKyahYotIQQOeFKGCF7EgvQlBqOCjWFKlevBRDyL4uHloLXhYqWJroaEqlETSptndGb+ZPDH0ojN8O8vA98vv+/Itw38u1nSRYRE6UhKyg4FF1R292/Q+xhhLi4TIrgjgIzwe4MbgmR2nrZMtxxEN63zYORuPZp7gzpehvCu9XjfuPmwCUHIiEtw4fK89zVvD2+FHAD56quXBpV3CVO4ret6nxHzxZxdBRuqADCKmz7RHD9y2tlmbYbBVfwE8DXBkEd/y39H5+mze8ZyoSIpsFXC9u/VE3/ldpyg5AAMEoJMTQi2hANKBgyKdy0h/eoChqcf9MimvVAHjd/fdiG0NRwgQpDAp1agBpDZwdHKJLKZzc+h5e3kCSexh5c5j8fmhW0HGpNZXFkqfsQpAKgcFKGmAlAxHXp5bkkmsrhosjh4cCIJ5pG5qfQXgtMslqO1qgEMWTPrR+eriEhoA4wN7L8TWh0KVXzfgY2RQAUjVBenWLH4UCrj04Wa9BNXEo5va+w63xCiJ6WRVP2MVgNQIgjgEA17MTODZ7Lt+AtSaGDG4377a1m2FAkKrc11/dUwIID1dSKHEcW3yft4RbpR6kK1PYgaJtaY1nNp5jIeMsjKNbs1AWRUcjvTnp2Kh9LtLJGTDINUhcTIZ3L+hzdq9ZgvWmSF9/Wu5gI8L03gzP5l3hddL/3/zKDdA9MdE0UERrdzaFGMUaap75Y/pX9Yfap76EQYaCeEAAAAASUVORK5CYII=",
		notUserChoiceImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACNUlEQVR42qXTT2jTUBwH8G9e0ta2ks5ND0Ww/qX1oGyevEwQnOBA6EHXwLwoUh3eRGRs501RPE6xgp6KrexQECZY8DBPXmbRS4Z/K0gRtmmDa2yb5PlLX7p2Gwpi4EfCy8sn3/dPwn9e0saGnCRF6XYFnA9DkhKtRs51ep6jmtEcp/JHIM9Yivl9mf0XNDV2Ngn1YLzVxdB1lJ8U8P5hzuCWnR6xrPwmIM8kLRjdkT326BaLHNgLKAFA9ouXdhOw6qi++4j589cd89vSaMqyc2sAPUXlgF8fyt9WI3t2Av4w4NsCMJ8AHAKav6hqqH76iuLINcNuNhOawyttYCp+7tRE/6XT9GFQAG4CpniATQkIaNQIMVG6/xSL2WfTGueTbWDh5L2rA9t29QGBrQQEPUDuAuoEmFSr+P5lGc8v33mtAUfaQO3M4/GgDOoYCIkUin8D0BDDoBQ2ZMxqN0wCQh0gMxaUnYb4uzt+dwIZ8wBHTGQbYAHMpu+uAxaGxpMDvSr3AHcFaAIlD+BtoN6ag5WqhOLNwrohTMWPH5roP7pdLIwb3wW6EziWGAZhpVdLWHzxdpqAyc4yKrJ+4uKg2oMV+lgRK9CdwAVsG1WpF8UH84Zt2QkCKmsbiRAtFAllB5OHWQ9fpr81OwlcgBL9kPrwsvDGMQ1zNMV5ZyN1ISlZYZl9/TE1tjuMSFgA1VWO8uef+FAqG47tpFMcm7dyFyIOEzBMlfCadao5qhk39l9P479evwFbiOcRSXKueAAAAABJRU5ErkJggg==",
		UserAltImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIfSURBVDhPpVM9b9NQFD02cSKKFVGKIFFREFsmFiCA1AEQQrQjC0gssLCkC0jJj0iFWFoGdiT4Ay0SEmJBhPI5FBokikL4SCC0Te2UxInt13Mdu1CVrVc6713fe86x/T6w09DCeTNKJ7Q0pzyUmoCmZYOiUhXms8RMcd6vB7UwthhM5fTLWix2L3PmYjKdOwdz9DDFGtr1KuovnqD29JGlfO9Goew9DCV/DaZy2pXE8PD9Y/mbupk6xE6cVWPQhEujHo2+4fXdO76ztnq1UPYfSCcwKB1HWjeMyunCraSZOsDqbkBPsBOTNoMGvkOTLto/f+F56bble262OK/qesiYzIydTJojFLjrgEe4bcIOEdXWYe6LITN2KgmFSRFGBuPpo0eAngX0SexTJHD5LOgLpEZTcgKuUuMijAyy5l7+r0NSb21g5LQI5gGYSy2AjYBLjQyRAUniTnJXsBoayBzm3RBBndwwIoOK3fgNdIREQYCV/0DqLdiNZqCRITKYayx85RfQuUNiZ3k7IgO+vfGeXGpkiAyma++WLHtZhZ8o5H/FEVpos1V7u8TFwLQId8nw+Afa51Oq2vyycmlk9KCW0GXFZeu63IUO8z88Bx5s28SbuUXfddzrxVcobxpI0GTh7H734/dPzQt9d0/CGBpCPB7nbhmwbAPVxR4+PPtsuU7/WuElth/lKORUcsoTE8TgMg0WbJaY4Zu3XKYdBrABARUk+ls4DfQAAAAASUVORK5CYII=",
		upd(node) {
			var {pref} = node, def = false, user = false, val;
			if (prefs.getPrefType(pref.pref) != prefs.PREF_INVALID) {
				var pn = pref.pref;
				try {val = pref.defVal = db[pref.get.name](pn); def = true}
				catch(ex) {def = false;}
				var user = prefs.prefHasUserValue(pn);
				if (user) try {val = pref.get(pn, undefined);} catch(ex) {}
			}
			if (val == pref.val && def == pref.def && user == pref.user) return;
			pref.val = val; pref.def = def; pref.user = user;
			var exists = def || user;

			var ttt = exists ? val : "Этого префа не существует";
			if (ttt === "") ttt = "[ empty_string ]";
			ttt += "\n" + pref.pref;
			if (pref.ttt) ttt += "\n" + pref.ttt;
			node.tooltipText = ttt;

			var img, alt = "userAlt" in pref && val == pref.userAlt;
			if (alt) img = this.UserAltImg;
			if ("userChoice" in pref)
				if (val == pref.userChoice)
					//node.style.removeProperty("color"),
					img = this.UserChoiceImg;
				else {
					//node.style.setProperty("color", "maroon", "important");
					if (!alt) img = this.notUserChoiceImg;
				}
			if (!pref.img) img
				? node.setAttribute("image", img)
				: node.removeAttribute("image");
			user
				? node.style.setProperty("font-style", "italic", "important")
				: node.style.removeProperty("font-style");

			var {lab} = pref;
			if (exists && pref.hasVals) {
				if (val in pref.vals) var sfx = pref.vals[val] || val;
				else var sfx = user ? "Другое" : "По умолчанию";
				lab += ` — "${sfx}"`;
			}
			node.setAttribute("label", lab);
		},
		createRadios(doc, vals, popup) {
			for(var arr of vals) {
				if (!arr) {
					popup.append(doc.createElementNS(xul_ns, "menuseparator"));
					continue;
				}
				var [val, lab, key, ttt] = arr;
				var menuitem = doc.createElementNS(xul_ns, "menuitem");
				menuitem.setAttribute("type", "radio");
				menuitem.setAttribute("closemenu", "none");
				menuitem.style.setProperty("font-style", "italic", "important"),
				menuitem.setAttribute("label", popup.parentNode.pref.vals[val] = lab);
				key && menuitem.setAttribute("accesskey", key);
				var tip = menuitem.val = val;
				if (ttt) tip += "\n" + ttt;
				menuitem.tooltipText = tip;
				popup.append(menuitem);
			}
		},
		openPopup(popup) {
			var btn = popup.parentNode;
			if (btn.domParent != btn.parentNode) {
				btn.domParent = btn.parentNode;
				var pos;
				if (btn.matches(".widget-overflow-list > :scope"))
					pos = "after_start";
				else var win = btn.ownerGlobal, {width, height, top, bottom, left, right} =
					btn.closest("toolbar").getBoundingClientRect(), pos = width > height
						? `${win.innerHeight - bottom > top ? "after" : "before"}_start`
						: `${win.innerWidth - right > left ? "end" : "start"}_before`;
				for(var p of btn.popups) p.setAttribute("position", pos);
			}
			popup.openPopup(btn);
		},
		maybeRestart(node, conf) {
			var msgRest = "Перезапустить браузер?", msgAbort = "Запрос на выход отменен.";
			if (pv >= 77) {
				var title = node.closest("toolbarbutton").label;
				var pp = domWin => Services.prompt.wrappedJSObject.pickPrompter({
					domWin, modalType: Ci.nsIPrompt.MODAL_TYPE_WINDOW
				});
				var confirm = win => pp(win).confirm(title, msgRest);
				var alert = win => pp(win).alert(title, msgAbort);
			} else {
				var confirm = win => win.confirm(msgRest);
				var alert = win => win.alert(msgAbort);
			}
			return (this.mayBeRestart = (node, conf) => {
				var win = node.ownerGlobal;
				if (conf && !confirm(win)) return;
				if (win.BrowserUtils.restartApplication() === false) alert(win);
				else return true;
			})(node, conf);
		},
		regexpRefresh: /^(?:view-source:)?(?:https?|ftp)/,
		maybeRe(node, fe) {
			var {pref} = node;
			if ("restart" in pref) {
				if (this.maybeRestart(node, pref.restart)) return;
			}
			else this.popupshowing(fe, node.parentNode);
			if ("refresh" in pref) {
				var win = node.ownerGlobal;
				if (this.regexpRefresh.test(win.gBrowser.currentURI.spec)) pref.refresh
					? win.BrowserReloadSkipCache() : win.BrowserReload();
			}
		},
		maybeClosePopup(e, trg) {
			!e.ctrlKey && prefs.getBoolPref(this.closePref, undefined)
				&& trg.parentNode.hidePopup();
		},
		command(e) {
			var trg = e.target;
			if (trg.btn) return this.openPopup(trg.primaryPopup);

			var menu = trg.closest("menu"), newVal = trg.val;
			this.maybeClosePopup(e, menu);
			if (newVal != menu.pref.val)
				menu.pref.set(menu.pref.pref, newVal),
				this.maybeRe(menu, true);
		},
		popupshowing(e, trg = e.target) {
			if (trg.state == "closed") return;
			if (trg.id) {
				for(var node of trg.children) {
					if (node.nodeName.endsWith("r")) continue;
					this.upd(node);
					!e && node.open && this.popupshowing(null, node.querySelector("menupopup"));
				}
				return;
			}
			var {pref} = trg.closest("menu"), findChecked = true;

			var findDef = "defVal" in pref;
			var checked = trg.querySelector("[checked]");
			if (checked) {
				if (checked.val == pref.val) {
					if (findDef) findChecked = false;
					else return;
				}
				else checked.removeAttribute("checked");
			}
			if (findDef) {
				var def = trg.querySelector("menuitem:not([style*=font-style]");
				if (def)
					if (def.val == pref.defVal) {
						if (findChecked) findDef = false;
						else return;
					}
					else def.style.setProperty("font-style", "italic", "important");
			}
			for(var node of trg.children) if ("val" in node) {
				if (findChecked && node.val == pref.val) {
					node.setAttribute("checked", true);
					if (findDef) findChecked = false;
					else break;
				}
				if (findDef && node.val == pref.defVal) {
					node.style.removeProperty("font-style");
					if (findChecked) findDef = false;
					else break;
				}
			}
		},
		contextmenu(e) {
			var trg = e.target;
			if (trg.btn) {
				if (e.ctrlKey || e.shiftKey) return;
				if (e.detail == 2) return trg.secondaryPopup.hidePopup();
				this.openPopup(trg.secondaryPopup);
			}
			else if ("pref" in trg && trg.pref.user)
				prefs.clearUserPref(trg.pref.pref),
				this.maybeRe(trg, true);
			e.preventDefault();
		},
		mousedown(e) {
			var reset = e => e.target.linkedObject = this;
			var id, lo = {command: reset, mousedown: reset};

			var lin = e.view.AppConstants.platform == "linux";
			var stop = e => reset(e) && e.preventDefault();

			lo.contextmenu = lin
				? e => e.ctrlKey || e.shiftKey ? dsp(e) : stop(e) : stop;
			var context = lin
				? e => e.button == 2 && e.type.endsWith("p") && this.contextmenu(e) : () => {};

			var dsp = (e, timeout) => {
				var trg = e.target;
				trg.onmouseup = trg.onmouseleave = null;
				if (timeout) return this.londPress(e);
				e.view.clearTimeout(id);
				reset(e);
				context(e);
			}
			(this.mousedown = e => {
				var trg = e.target;
				if (!trg.btn) return;
				trg.linkedObject = lo;
				trg.onmouseup = trg.onmouseleave = dsp;
				id = e.view.setTimeout(dsp, 500, e, true);
			})(e);
		},
		londPress(e) { // удержание кнопки мыши, выбирать команды, отводящие мышь от кнопки
			var msg = "QuickSettings\nLONG PRESS: e.button = " + e.button;
			// Components.utils.reportError(msg);
			e.view.alert(msg);
		}
	};
});

Отредактировано Dobrov (25-03-2021 11:32:16)

Отсутствует

 

№1535725-03-2021 12:52:10

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

Re: Custom Buttons

Dobrov пишет

Но ведь в мою кнопку click не нужен?

Как это не нужен?
Вот здесь, в методе createPopup(), посредством установки атрибута "onclick",
задаётся обработчик события "click", который пробрасывает event в метод click()

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

Выделить код

Код:

...
		createPopup(doc, btn, name, data) {
			...
			for (var type of ["popupshowing", "click"])
				popup.setAttribute("on" + type, `parentNode.linkedObject.${type}(event)`);
			...
		},

Dobrov пишет

исправил кнопку, но код в пятом элементе массива не запускается

Как это не запускается?
Когда я жму на menuitem «АнтиЗапрет (1)», в консоли прявляется запись
«Uncaught ReferenceError: e is not defined».
Значит код запускается.

Отсутствует

 

№1535825-03-2021 13:08:17

DenisRodman
Участник
 
Группа: Members
Зарегистрирован: 24-03-2021
Сообщений: 7
UA: Firefox 63.0

Re: Custom Buttons

Dumby
Так это не моя кнопка. Точнее я не просил делать мне кнопку с кучей команд и функций. Я же говорил, что кнопка CB которая у меня, она не работает после обновления на версию 69.0.3 и просил решить вопрос с запуском её.


Код который я разместил в своём первом сообщении его можно подправить?


Я указал код скопировал его из вкладки Инициализация, а ваш код который мне предложили он другого вида для URL, вот у меня тоже есть такой же код начинающийся с custombutton:// я не знал, что его нужно было разместить, поэтому скопировал из Инициализации. Тогда я тоже размещу код для URL

для URL

Выделить код

Код:

custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EQuick%20toggle%20for%20about%3Aconfig%20preferences%20%5BFix%21%5D%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAACXBIWXMAAABnAAAAZwHVKNQmAAADGGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjaY2BgnuDo4uTKJMDAUFBUUuQe5BgZERmlwH6egY2BmYGBgYGBITG5uMAxIMCHgYGBIS8/L5UBA3y7xsDIwMDAcFnX0cXJlYE0wJpcUFTCwMBwgIGBwSgltTiZgYHhCwMDQ3p5SUEJAwNjDAMDg0hSdkEJAwNjAQMDg0h2SJAzAwNjCwMDE09JakUJAwMDg3N+QWVRZnpGiYKhpaWlgmNKflKqQnBlcUlqbrGCZ15yflFBflFiSWoKAwMD1A4GBgYGXpf8EgX3xMw8BUMDVQYqg4jIKAX08EGIIUByaVEZhMXIwMDAoM2Qw7CDkY8xi/EskynTYmYR5i4WFpZGVibWNjYetmnsyuybOVw5bnIWcHFyLeV24n7E08KrwXuOr4xfnv+0QIWguuANoS5hO+EvIqtFU8TkxW6Jz5AIlxSXvCE1RzpBRk3mrexWuXp5LwUxhSeKm5SalENU1FR+qp5TW6JerRGsqaPFpvVIe5/ObN0qvSh9KwMZg3+Gj4yOG68xmWxaZZZs7mNhbqlkxWf12/qlzQ3bE3Y77Vc7zHWc6NTqXOVS4JruFuce7hHg6eXl6u3oY+dr7WfpbxFgEWgRZBlsHWIX6hTmFu4dERgZHhUfnR5TEFsZ1xzflzArcVnS5uSDKedT76W9S/+XKZClmG2S454bnZef31owq3Bj0YniByU/ygTLtStcKxOqaqpn1GytvVT3oYG/Ua/Jrzm/ZULrprYr7d87pbvsu5N7OnvX9V3t/zNRZZLP5JIp86aemPZphuxMz1mlsxfOOT/3z3ztBVELOxftXPxqqfQyn+V1KzaufLJaYo3P2sZ129a/2ai0KXLzxC0ntjFut9pRvHPtrhd7lPbG7Zu1/9pB4UOBh/uPnD3Gc9z7RPfJM6d5zvidnXDu0gXRixGX5lx+cFXlWtb19Te+3rK53Xzn1D2h+9EPljx8+9j8SePTM8/FXyS9XPfq9xuPt1PfPf5g+LHh0/kv8l/zv+3/IfAz6deWP2x/I/6t/v8fAATCIM0IpJTRAAAAIGNIUk0AAHolAACAgwAA+f8AAIDoAABSCAABFVgAADqXAAAXb9daH5AAAAEOSURBVHjabJGtS0MBFMXPJojBMMPwC1nV6FCZoGj/ZVGYiIJDBOEFm3XFP2DFIAu6ZrAYBM0OREEUnN20ICI40OfbsTzYB48b7oF74J4PWUnDjMU4GSv5PEubCo/UuwjMs8FEjLOEPNCkRloWAyxb3GEOGWKRTSLeLFYwXyLFBeaGH8w7z/yyRZlvilR5YV+kuMYY04r3NpNEfBByaYksZUyDAoPsYELmmKJKjj0CS0QYU4rl3WLMeceRCBMItW7CMEd9LxbIcUqOXQJLFld9Iks9Ii0qPTYjAo5pscYJrxzIIs1SV1B5ivzRsFjFfHaiLrDOaIxHCLmnyRmp5LLytKnw1FNWH2XaYoyM9T8AOvnw3YUOg90AAAAASUVORK5CYII%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20%u0411%u044B%u0441%u0442%u0440%u043E%u0435%20%u043F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%20about%3Aconfig%20%u043E%u0442%2024.07.2016%0Athis._handleClick%3D%28%29%3D%3EmenuPopup.openPopup%28this%2C%22after_start%22%29%3Bvar%20menuPopup%3Dself.appendChild%28document.createElement%28%22menupopup%22%29%29%3BmenuPopup.id%3D%27quick-aboutconfig-menupopup%27%3B%0A//%20%u0418%u0437%u043C%u0435%u043D%u0438%u0442%u044C%20%u0438%u043A%u043E%u043D%u043A%u0443%20%u043F%u0440%u0438%20%u043D%u0435%u0441%u043E%u043E%u0442%u0432%u0435%u0442%u0441%u0442%u0432%u0438%u0435%20%u043B%u044E%u0431%u043E%u0433%u043E%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430%20%u043F%u043E%u043B%u044C%u0437%u043E%u0432%u0430%u0442%u0435%u043B%u044C%u0441%u043A%u043E%u043C%u0443%20%u043F%u0440%u0435%u0434%u043F%u043E%u0447%u0442%u0435%u043D%u0438%u044E%20%28%u0441%u043C.%u043D%u0438%u0436%u0435%29%7C%7C%u0418%u043A%u043E%u043D%u043A%u0430%20%u043C%u0435%u043D%u044F%u0435%u0442%u0441%u044F%20%u0442%u043E%u043B%u044C%u043A%u043E%20%u043F%u0440%u0438%20%u0438%u0437%u043C%u0435%u043D%u0435%u0438%u0438%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%20%u0447%u0435%u0440%u0435%u0437%20%u043C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%2C%20%u043B%u0438%u0431%u043E%20%u043F%u043E%u0441%u043B%u0435%20%u0435%u0433%u043E%20%u043E%u0442%u043A%u0440%u044B%u0442%u0438%u044F.%0A%20%20var%20s%3D%27CB.hasNotUserChoice%27%3Bfunction%20toggleImage%28%29%7Bvar%20val%3Dcustombuttons.getPrefs%28s%29%3Bself.image%3Dval%0A//var%20s%3D%27CB.hasNotUserChoice%27%3Bfunction%20toggleImage%28%29%7Bcustombuttons.getPrefs%28s%29%3F%20%20%20%20%20%20%20%20self.style.cssText%3D%27%27%3Aself.style.cssText%3D%27filter%3Agrayscale%28100%25%29%27%3B%7D%3B%0A%3F%20%27data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB6klEQVQ4jZWTv2tUQRDHv8ntd28GLLQQfwS5VkuDSgRF/wlRiIiCQQQhhZ1VII1/wDUWkkLTBAsbC0FJYZGQ3NuZRcHYW6UQEQzoeXkW791xXh5CptodZr8z85kd4BBWRJwDgB5wyoCjh3mLbfK8C/ddW11XJlduNgYaeTFpvJWA0+P+BBx3Cf2sLEy5m4WrS8A0AGANaBUSrgKAKzdcY5k0PF4HJGm47NK6nSUMXOIXAEgSrrnG0oU/AGDKNb6qHe9c+Ms1lqbxqws/uoTfWVp3ksRll/DTJM6bcMWEn1KbDysBCW+zsnSNpWssTbg3PNf3uw7MuHDgym8uoW8aX496SxKXs7J0iTsFObcGRBfey8rShP1EXthSnDHhShJ0vM0H1uYiAKBSHWZqLYyDc+H7sSpeNlMX9l1jWWebEAgjgSxcbRRYB46YhCcVxH9bqDP3nbyUBB0XPk+Cjgnvj1qoqohvJqDtTUBdcGAmSzgIEQBM2R0fY/U41GPkwNpcTBKfmnDPNN4w4TOX+NnbfAQAWAKmXcMVAMgaNqrM1UfqkbMmrXkT/nGJO1XF4Xod8/0Ak4KcKzTe3AROjPs/AMdM2M8atk25a8IXAKYawTZZj5jNEvZN2TVldg3Ny/RfkYizALAFnByu819tzvCRWXKqTwAAAABJRU5ErkJggg%3D%3D%27%0A%3A%20%27data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAACXBIWXMAAABnAAAAZwHVKNQmAAADGGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjaY2BgnuDo4uTKJMDAUFBUUuQe5BgZERmlwH6egY2BmYGBgYGBITG5uMAxIMCHgYGBIS8/L5UBA3y7xsDIwMDAcFnX0cXJlYE0wJpcUFTCwMBwgIGBwSgltTiZgYHhCwMDQ3p5SUEJAwNjDAMDg0hSdkEJAwNjAQMDg0h2SJAzAwNjCwMDE09JakUJAwMDg3N+QWVRZnpGiYKhpaWlgmNKflKqQnBlcUlqbrGCZ15yflFBflFiSWoKAwMD1A4GBgYGXpf8EgX3xMw8BUMDVQYqg4jIKAX08EGIIUByaVEZhMXIwMDAoM2Qw7CDkY8xi/EskynTYmYR5i4WFpZGVibWNjYetmnsyuybOVw5bnIWcHFyLeV24n7E08KrwXuOr4xfnv+0QIWguuANoS5hO+EvIqtFU8TkxW6Jz5AIlxSXvCE1RzpBRk3mrexWuXp5LwUxhSeKm5SalENU1FR+qp5TW6JerRGsqaPFpvVIe5/ObN0qvSh9KwMZg3+Gj4yOG68xmWxaZZZs7mNhbqlkxWf12/qlzQ3bE3Y77Vc7zHWc6NTqXOVS4JruFuce7hHg6eXl6u3oY+dr7WfpbxFgEWgRZBlsHWIX6hTmFu4dERgZHhUfnR5TEFsZ1xzflzArcVnS5uSDKedT76W9S/+XKZClmG2S454bnZef31owq3Bj0YniByU/ygTLtStcKxOqaqpn1GytvVT3oYG/Ua/Jrzm/ZULrprYr7d87pbvsu5N7OnvX9V3t/zNRZZLP5JIp86aemPZphuxMz1mlsxfOOT/3z3ztBVELOxftXPxqqfQyn+V1KzaufLJaYo3P2sZ129a/2ai0KXLzxC0ntjFut9pRvHPtrhd7lPbG7Zu1/9pB4UOBh/uPnD3Gc9z7RPfJM6d5zvidnXDu0gXRixGX5lx+cFXlWtb19Te+3rK53Xzn1D2h+9EPljx8+9j8SePTM8/FXyS9XPfq9xuPt1PfPf5g+LHh0/kv8l/zv+3/IfAz6deWP2x/I/6t/v8fAATCIM0IpJTRAAAAIGNIUk0AAHolAACAgwAA+f8AAIDoAABSCAABFVgAADqXAAAXb9daH5AAAAEOSURBVHjabJGtS0MBFMXPJojBMMPwC1nV6FCZoGj/ZVGYiIJDBOEFm3XFP2DFIAu6ZrAYBM0OREEUnN20ICI40OfbsTzYB48b7oF74J4PWUnDjMU4GSv5PEubCo/UuwjMs8FEjLOEPNCkRloWAyxb3GEOGWKRTSLeLFYwXyLFBeaGH8w7z/yyRZlvilR5YV+kuMYY04r3NpNEfBByaYksZUyDAoPsYELmmKJKjj0CS0QYU4rl3WLMeceRCBMItW7CMEd9LxbIcUqOXQJLFld9Iks9Ii0qPTYjAo5pscYJrxzIIs1SV1B5ivzRsFjFfHaiLrDOaIxHCLmnyRmp5LLytKnw1FNWH2XaYoyM9T8AOvnw3YUOg90AAAAASUVORK5CYII%3D%27%3B%7D%3B%0AtoggleImage%28%29%3BServices.prefs.addObserver%28s%2CtoggleImage%2Cfalse%29%3BaddDestructor%28%28%29%3D%3EServices.prefs.removeObserver%28s%2CtoggleImage%29%29%3B%0A%0A//%20nodeName%3A%20menuitem%20-%20%u0434%u043B%u044F%20%u043B%u043E%u0433%u0438%u0447%u0435%u0441%u043A%u0438%u0445%28boolean%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%2C%20menu%20-%20%u0434%u043B%u044F%20%u0446%u0435%u043B%u044B%u0445%28integer%29%20%u0438%20%u0441%u0442%u0440%u043E%u043A%u043E%u0432%u044B%u0445%28string%29.%20menuseparator%20-%20%u0434%u043B%u044F%20%u0440%u0430%u0437%u0434%u0435%u043B%u0438%u0442%u0435%u043B%u044F.%0A//%20pref%20-%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%20about%3Aconfig.%0A//%20%u041F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u044B%20%u0438%u043C%u0435%u044E%u0449%u0438%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F%20%u043E%u0442%u043B%u0438%u0447%u043D%u044B%u0435%20%u043E%u0442%20%u0434%u0435%u0444%u043E%u043B%u0442%u043D%u044B%u0445%20-%20%u0432%u044B%u0434%u0435%u043B%u0435%u043D%u044B%20%u0436%u0438%u0440%u043D%u044B%u043C%20%u0441%u0442%u0438%u043B%u0435%u043C%20%u0442%u0435%u043A%u0441%u0442%u0430.%0A//%20restart%20%28%u0437%u0430%u0434%u0430%u0432%u0430%u0442%u044C%20%u0441%20%u043F%u0443%u0441%u0442%u044B%u043C%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%u043C.%20%u0442.%u0435.%2C%20restart%3A%20%22%22%29%20-%20%u0434%u043E%u0431%u0430%u0432%u043B%u044F%u0435%u0442%20%u0432%u043E%u0437%u043C%u043E%u0436%u043D%u043E%u0441%u0442%u044C%20%u043F%u0435%u0440%u0435%u0437%u0430%u043F%u0443%u0441%u043A%u0430%20%u0431%u0440%u0430%u0443%u0437%u0435%u0440%u0430%0A//%20%28%u0441%20%u043F%u043E%u0434%u0442%u0432%u0435%u0440%u0436%u0434%u0435%u043D%u0438%u0435%u043C%20%u0432%20%u0434%u0438%u0430%u043B%u043E%u0433%u043E%u0432%u043E%u043C%20%u043E%u043A%u043D%u0435%29%20%u043F%u043E%u0441%u043B%u0435%20%u0438%u0437%u043C%u0435%u043D%u0435%u043D%u0438%u044F%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430.%0A//%20key%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%20accesskey%20-%20%u043A%u043B%u0430%u0432%u0438%u0448%u0438%20%u0434%u043B%u044F%20%u0431%u044B%u0441%u0442%u0440%u043E%u0439%20%u043D%u0430%u0432%u0438%u0433%u0430%u0446%u0438%u0438%20%u043F%u043E%20%u043C%u0435%u043D%u044E.%0A//%20userChoice%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%20%u043F%u0440%u0435%u0434%u043F%u043E%u0447%u0438%u0442%u0430%u0435%u043C%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u0438%20%u0435%u0441%u043B%u0438%20%u0442%u0435%u043A%u0443%u0449%u0435%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u0441%20%u043D%u0438%u043C%20%u043D%u0435%20%u0441%u043E%u0432%u043F%u0430%u0434%u0430%u0435%u0442%2C%20%u043F%u0443%u043D%u043A%u0442%20%u043C%u0435%u043D%u044E/%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%20%u043C%u0435%u043D%u044E%20%u043F%u043E%u043C%u0435%u0447%u0430%u044E%u0442%u0441%u044F%20%u043A%u0440%u0430%u0441%u043D%u044B%u043C%20%u0446%u0432%u0435%u0442%u043E%u043C.%0A//%20%u0422%u0430%u043A%u0436%u0435%20%u043C%u043E%u0436%u043D%u043E%20%u0443%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u0440%u0435%u0434%u0443%u043F%u0440%u0435%u0436%u0434%u0430%u044E%u0449%u0443%u044E%20%u0438%u043A%u043E%u043D%u043A%u0443%20%u0434%u043B%u044F%20%u0442%u0430%u043A%u0438%u0445%20%u043F%u0443%u043D%u043A%u0442%u043E%u0432.%20%u0421%u043C.%20%u0441%u0442%u0438%u043B%u044C%20%u0432%20%u043F%u043E%u0441%u0442%u0435%20%u043A%u043A%u043D%u043E%u043F%u043A%u0438.%0A//%20%u0410%20%u0442%u0430%u043A%u0436%u0435%20%u043C%u0435%u043D%u044F%u0435%u0442%u0441%u044F%20%u0438%u043A%u043E%u043D%u043A%u0430%20%u0441%u0430%u043C%u043E%u0439%20%u043A%u043D%u043E%u043F%u043A%u0438%20%28%u0441%u043C.%20%u0432%u044B%u0448%u0435%29.%0A//%20strValues%20-%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F%20%u0438%20%u043E%u0442%u043E%u0431%u0440%u0430%u0436%u0430%u0435%u043C%u043E%u0435%20%u0432%20%u043C%u0435%u043D%u044E%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F.%20%u0417%u0430%u0434%u0430%u0432%u0430%u0442%u044C%20%u0434%u043B%u044F%20%u0446%u0435%u043B%u044B%u0445%28integer%29%20%u0438%20%u0441%u0442%u0440%u043E%u043A%u043E%u0432%u044B%u0445%28string%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432.%0A//%20%u0417%u0430%u0434%u0430%u0435%u0442%u0441%u044F%20%u0432%20%u0432%u0438%u0434%u0435%3A%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%2C%2C%2C%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%2C%2C%2Caccesskey%7C%7C%7C%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u04352%2C%2C%2C%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u04352%2C%2C%2Caccesskey2%7C%7C%7C%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u04353%2C%2C%2C%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u04353%20%u0438%20%u0442.%u0434.%20%28accesskey%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%u0441%u044F%20%u043E%u043F%u0446%u0438%u043E%u043D%u0430%u043B%u044C%u043D%u043E%29%0A//%20%u041F%u043E%u043B%u043D%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u043E%u0442%u043E%u0431%u0440%u0430%u0436%u0430%u0435%u0442%u0441%u044F%20%u0432%20%u043F%u043E%u0434%u0441%u043A%u0430%u0437%u043A%u0430%u0445%2C%20%u043F%u0440%u0438%20%u043D%u0430%u0432%u0435%u0434%u0435%u043D%u0438%u0438%20%u043D%u0430%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%20%u043F%u043E%u0434%u043C%u0435%u043D%u044E/%u043F%u0443%u043D%u043A%u0442%20%u043F%u043E%u0434%u043C%u0435%u043D%u044E.%0A//%20%u0414%u043B%u044F%20%u043B%u043E%u0433%u0438%u0447%u0435%u0441%u043A%u0438%u0445%28boolean%29%20-%20%u043E%u0442%u043E%u0431%u0440%u0430%u0436%u0430%u0435%u0442%u0441%u044F%20%u0441%u0440%u0430%u0437%u0443%20%u043F%u043E%u0441%u043B%u0435%20%u0441%u0430%u043C%u043E%u0433%u043E%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430%20%28%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20true%20-%20%u0442%u0430%u043A%u0436%u0435%20%u0441%u0442%u0430%u0432%u0438%u0442%20%u0433%u0430%u043B%u043E%u0447%u043A%u0443%20%u0434%u043B%u044F%20%u043D%u0435%u0433%u043E%29.%0A//%20%u041B%u041A%u041C%20%u043F%u043E%20%u043F%u0443%u043D%u043A%u0442%u0430%u043C%20%u043C%u0435%u043D%u044E%20-%20%u043F%u0435%u0440%u043A%u043B%u044E%u0447%u0430%u0435%u0442%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F%20%u0434%u043B%u044F%20%u043B%u043E%u0433%u0438%u0447%u0435%u0441%u043A%u0438%u0445%28boolean%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%2C%0A//%20%u043B%u044E%u0431%u0430%u044F%20%u043A%u043D%u043E%u043F%u043A%u0430%20%u043F%u043E%20%u043F%u0443%u043D%u043A%u0442%u0430%u043C%20%u0432%20%u0441%u0443%u0431%u043C%u0435%u043D%u044E%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%20%u044D%u0442%u043E%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u0434%u043B%u044F%20%u0446%u0435%u043B%u044B%u0445%28integer%29%20%u0438%20%u0441%u0442%u0440%u043E%u043A%u043E%u0432%u044B%u0445%28string%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432.%0A//%20%u041F%u041A%u041C%20%u043F%u043E%20%u043F%u0443%u043D%u043A%u0442%u0430%u043C%20%u043C%u0435%u043D%u044E%20%u0438%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u044E%20%u0441%u0443%u0431%u043C%u0435%u043D%u044E%20-%20%u0441%u0431%u0440%u0430%u0441%u044B%u0432%u0430%u0435%u0442%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430%20%u0432%20%u0434%u0435%u0444%u043E%u043B%u0442%u043D%u043E%u0435.%0A//%20%u041A%u043B%u0430%u0432%u0438%u0430%u0442%u0443%u0440%u0430%3A%20Enter%20-%20%u043F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430.%0A//%20%u0421%u043F%u0435%u0446%u043A%u043B%u0430%u0432%u0438%u0448%u0430%20%u0432%u044B%u0437%u043E%u0432%u0430%20%u043A%u043E%u043D%u0442%u0435%u043A%u0441%u0442%u043D%u043E%u0433%u043E%20%u043C%u0435%u043D%u044E%20/%20Shift+Enter%20-%20%u0441%u0431%u0440%u043E%u0441%20%u0432%20%u0434%u0435%u0444%u043E%u043B%u0442%u043D%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435.%0A//%20Alt%20+%20M%20-%20%u043E%u0442%u043A%u0440%u044B%u0442%u044C%20%u043C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438.%20%28%u0421%u043E%u0447%u0435%u0442%u0430%u043D%u0438%u0435%20%u043C%u043E%u0436%u043D%u043E%20%u0441%u043C%u0435%u043D%u0438%u0442%u044C%20%u043D%u0430%20%u0441%u0432%u043E%u0435.%20%u0421%u043C.%20%u0432%20%u043A%u043E%u043D%u0446%u0435%20%u043A%u043E%u0434%u0430%29%0A%5B%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u0434%u0438%u0441%u043A%u043E%u0432%u043E%u0433%u043E%20%u043A%u044D%u0448%u0430%22%2C%20pref%3A%22browser.cache.disk.enable%22%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u043A%u044D%u0448%u0430%20%u0432%20%u043E%u043F%u0435%u0440%u0430%u0442%u0438%u0432%u043D%u043E%u0439%20%u043F%u0430%u043C%u044F%u0442%u0438%22%2C%20pref%3A%22browser.cache.memory.enable%22%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u043B%u043E%u043A%u0430%u043B%u044C%u043D%u043E%u0433%u043E%20%u0445%u0440%u0430%u043D%u0438%u043B%u0438%u0449%u0430%20DB%20%28Storage%29%22%2C%20pref%3A%22dom.indexedDB.enabled%22%2C%20key%3A%27d%27%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u043B%u043E%u043A%u0430%u043B%u044C%u043D%u043E%u0433%u043E%20%u0445%u0440%u0430%u043D%u0438%u043B%u0438%u0449%u0430%22%2C%20pref%3A%22dom.storage.enabled%22%2C%20key%3A%27s%27%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22Back-story-cash%20%5BTessssttt%5D%22%2C%20pref%3A%22browser.sessionhistory.max_total_viewers%22%2C%20strValues%3A%220%2C%2C%2C0%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22image.animation_mode%22%2C%20key%3A%27i%27%2C%20userChoice%3A%22none%22%2C%20strValues%3A%22normal%2C%2C%2C%u0410%u043D%u0438%u043C%u0430%u0446%u0438%u044F%20%u043A%u0430%u0440%u0442%u0438%u043D%u043E%u043A%20%u0432%u043A%u043B.%2C%2C%2C%7C%7C%7Cnone%2C%2C%2C%u0410%u043D%u0438%u043C%u0430%u0446%u0438%u044F%20%u043A%u0430%u0440%u0442%u0438%u043D%u043E%u043A%20%u0432%u044B%u043A%u043B.%2C%2C%2C%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22network.cookie.cookieBehavior%22%2C%20key%3A%27k%27%2C%20userChoice%3A%221%22%2C%20strValues%3A%222%2C%2C%2C%u041D%u0435%20%u043F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%20%u0441%u0430%u0439%u0442%u043E%u0432%2C%2C%2C%7C%7C%7C0%2C%2C%2C%u041F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%u043E%20%u0441%u0442%u043E%u0440%u043E%u043D%u043D%u0438%u0445%20%u0441%u0430%u0439%u0442%u043E%u0432%20%u0432%u0441%u0435%u0433%u0434%u0430%2C%2C%2C%7C%7C%7C3%2C%2C%2C%u041F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%u043E%20%u0441%u0442%u043E%u0440%u043E%u043D%u043D%u0438%u0445%20%u043F%u043E%u0441%u0435%u0449%u0451%u043D%u043D%u044B%u0445%20%u0441%u0430%u0439%u0442%u043E%u0432%2C%2C%2C%7C%7C%7C1%2C%2C%2C%u041F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%u043E%20%u0441%u0442%u043E%u0440%u043E%u043D%u043D%u0438%u0445%20%u0441%u0430%u0439%u0442%u043E%u0432%20%u043D%u0438%u043A%u043E%u0433%u0434%u0430%2C%2C%2C%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22general.useragent.locale%22%2C%20key%3A%27l%27%2C%20restart%3A%22%22%2C%20strValues%3A%22en-US%2C%2C%2CEnglish%2C%2C%2Ce%7C%7C%7Cru%2C%2C%2C%u0420%u0443%u0441%u0441%u043A%u0438%u0439%2C%2C%2Cr%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22language%22%2C%20pref%3A%22intl.accept_languages%22%2C%20strValues%3A%22en-US%2C%20en%3Bq%3D0.5%2C%2C%2Cen-US%2C%20en%3Bq%3D0.5%2C%2C%2Ce%7C%7C%7Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cr%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22browser.display.document_color_use%22%2C%20key%3A%27c%27%2C%20userChoice%3A%220%22%2C%20strValues%3A%220%2C%2C%2CAutomatic%2C%2C%2C0%7C%7C%7C1%2C%2C%2CAlways%2C%2C%2C1%7C%7C%7C2%2C%2C%2CNever%2C%2C%2C2%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22CB.TEST%22%2C%20key%3A%27t%27%2C%20userChoice%3A%22C%3A%5C%5CDownloads%5C%5CTEST1%22%2C%20strValues%3A%22C%3A%5C%5CDownloads%5C%5CTEST1%2C%2C%2CTEST1%2C%2C%2C1%7C%7C%7CC%3A%5C%5CDownloads%5C%5CTEST2%2C%2C%2CTEST2%2C%2C%2C2%22%7D%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u0438%u043D%u0444%u0443%20%u043D%u0430%u0447%u0430%u043B%u043E/%u043A%u043E%u043D%u0435%u0446%20%u0437%u0430%u0433%u0440%u0443%u0437%u043A%u0438%20%u0441%u0442%u0440%22%2C%20pref%3A%22dom.enable_performance%22%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22%u0412%u043A%u043B/%u0412%u044B%u043A%u043B%20Referer%22%2C%20pref%3A%22network.http.sendRefererHeader%22%2C%20strValues%3A%220%2C%2C%2C0%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u0412%20%u043A%u0430%u0447%u0435%u0441%u0442%u0432%u0435%20%u0440%u0435%u0444%u0435%u0440%u0435%u0440%u0430%20%u043A%u043E%u0440%u0435%u043D%u044C%20%u0441%u0430%u0439%u0442%u0430%22%2C%20pref%3A%22network.http.referer.spoofSource%22%2C%20userChoice%3A%22true%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22referer.trimmingPolicy%22%2C%20pref%3A%22network.http.referer.trimmingPolicy%22%2C%20strValues%3A%222%2C%2C%2C2%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22On/Off%20Image%22%2C%20pref%3A%22permissions.default.image%22%2C%20userChoice%3A1%2C%20strValues%3A%222%2C%2C%2COff%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20Multiprocessing%22%2C%20pref%3A%22browser.tabs.remote.autostart%22%2C%20restart%3A%22%22%2C%20userChoice%3A%22true%22%7D%2C%20%20%20//about%3Asupport%3DMultiprocess%20Windows%7Cforum.ru-board.com/topic.cgi%3Fforum%3D5%26topic%3D49695%26start%3D0%26limit%3D1%26m%3D9%231%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//opennet.ru/opennews/art.shtml%3Fnum%3D50691%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20javascript%22%2C%20pref%3A%22javascript.enabled%22%2C%20key%3A%27j%27%2C%20userChoice%3A%22true%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22dom.workers.enabled%22%2C%20key%3A%27w%27%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22media.autoplay.enabled%22%2C%20key%3A%27m%27%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22Stopautoplay%22%2C%20pref%3A%22media.autoplay.default%22%2C%20userChoice%3A0%2C%20strValues%3A%220%2C%2C%2CStop%2C%2C%2C0%7C%7C%7C1%2C%2C%2CPlay%2C%2C%2C1%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22xpinstall.signatures.required%22%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//Check%20is%20compatibility%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22browser.bookmarks.autoExportHTML%22%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//BookmarksHtml%20%5Bfalse%3Dplaces.sqlite%5D%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22media.peerconnection.enabled%22%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//WebRTC%20false%3Doff%21%0A%0A%0A%20%20%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20useragentS%22%2C%20pref%3A%22general.useragent.site_specific_overrides%22%2C%20userChoice%3A%22true%22%7D%2C%0A%20%20%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20media.play-stand-alone%22%2C%20pref%3A%22media.play-stand-alone%22%7D%2C%20%20%20//%u0441%u0440%u0430%u0437%u0443%20%u0441%u043A%u0430%u0447%u0438%u0432%u0430%u0442%u044C%20%u043C%u0435%u0434%u0438%u0430%u0444%u0430%u0439%u043B%u044B%2C%20%u0431%u0435%u0437%20%u043F%u0435%u0440%u0435%u0445%u043E%u0434%u0430%20%u043D%u0430%20%u043D%u043E%u0432%u0443%u044E%20%u0441%u0442%u0440%u0430%u043D%u0438%u0446%u0443.%0A%20%20%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20pref%3A%22general.useragent.locale%22%2C%20key%3A%27l%27%2C%20restart%3A%22%22%2C%20strValues%3A%22en-US%2C%2C%2CEnglish%2C%2C%2Ce%7C%7C%7Cru%2C%2C%2C%u0420%u0443%u0441%u0441%u043A%u0438%u0439%2C%2C%2Cr%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22language%22%2C%20pref%3A%22intl.accept_languages%22%2C%20strValues%3A%22en-US%2C%20en%3Bq%3D0.5%2C%2C%2Cen-US%2C%20en%3Bq%3D0.5%2C%2C%2Ce%7C%7C%7Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cr%22%7D%2C%0A%20%20%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22Configure%20Proxies%22%2C%20pref%3A%22network.proxy.type%22%2C%20userChoice%3A5%2C%20strValues%3A%221%2C%2C%2ChttpP%2C%2C%2C1%7C%7C%7C2%2C%2C%2CAutomaticP%2C%2C%2C2%7C%7C%7C5%2C%2C%2CUse%20systemP%2C%2C%2C5%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22AutomaticP%22%2C%20pref%3A%22network.proxy.autoconfig_url%22%2C%20strValues%3A%22file%3A///X%3A/FFQ/_.pac%2C%2C%2Cfile%3A///X%3A/FFQ/_.pac%2C%2C%2C1%7C%7C%7Chttps%3A//antizapret.prostovpn.org/proxy.pac%2C%2C%2Chttps%3A//antizapret.prostovpn.org/proxy.pac%2C%2C%2C2%22%7D%2C%0A%20%20%7BnodeName%3A%22menuseparator%22%7D%2C%20%0A%20%20%0A%20%20//userChoice%3A%22Mozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010.13%3B%20rv%3A57.0%29%20Gecko/20100101%20Firefox/99.0%22%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22User%20Agent%22%2C%20pref%3A%22general.useragent.override%22%2C%20key%3A%27u%27%2C%20strValues%3A%22Mozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010.13%3B%20rv%3A60.0%29%20Gecko/20100101%20Firefox/60.0%2C%2C%2CFirefox%2060/MacOSX%2010.13%7C%7C%7CMozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_13_5%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/66.0.3359.181%20Safari/537.36%2C%2C%2CChrome%2066/MacOSX%2010.13.5%7C%7C%7CMozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_11_6%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/57.0.2987.133%20Safari/537.36%2C%2C%2CChrome%2057/MacOSX%7C%7C%7CMozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_12_4%29%20AppleWebKit/603.1.30%20%28KHTML%2C%20like%20Gecko%29%20Version/10.1%20Safari/603.1.30%2C%2C%2CSafari%20Generic/MacOSX%7C%7C%7CMozilla/5.0%20%28Windows%20NT%206.1%3B%20WOW64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/57.0.2987.133%20Safari/537.36%2C%2C%2CChrome57/W7%7C%7C%7COpera/9.80%20%28Windows%20NT%206.2%3B%20Win64%3B%20x64%29%20Presto/2.12%20Version/12.16%2C%2C%2COpera12/W8%7C%7C%7CMozilla/5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/61.0.3163.98%20Safari/537.36%2C%2C%2CChrome61/W10%7C%7C%7CMozilla/5.0%20%28Linux%3B%20Android%207.0%3B%20PLUS%20Build/NRD90M%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/61.0.3163.98%20Mobile%20Safari/537.36%2C%2C%2CChrome61/Android7%7C%7C%7CMozilla/5.0%20%28compatible%3B%20Googlebot/2.1%3B%20+http%3A//www.google.com/bot.html%29%2C%2C%2CGoogleBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20YandexBot/3.0%3B%20+http%3A//yandex.com/bots%29%2C%2C%2CYandexBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20Yahoo%21%20Slurp%3B%20http%3A//help.yahoo.com/help/us/ysearch/slurp%29%2C%2C%2CYahooBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20bingbot/2.0%3B%20+http%3A//www.bing.com/bingbot.htm%29%2C%2C%2CBingBot%7C%7C%7CDuckDuck%20bot/1.0%3B%20%28+http%3A//duckduckgo.com/duckduckbot.html%29%2C%2C%2CDuckDuckBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20Baiduspider/2.0%3B%20+http%3A//www.baidu.com/search/spider.html%29%2C%2C%2CBaiduspiderBot%7C%7C%7Cia_archiver%20%28+http%3A//www.alexa.com/site/help/webmasters%3B%20crawler@alexa.com%29%2C%2C%2CAlexaCrawlerBot%7C%7C%7CMozilla/5.0%20%28Linux%3B%20Android%205.1.1%3B%20SM-G928X%20Build/LMY47X%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/47.0.2526.83%20Mobile%20Safari/537.36%2C%2C%2CSamsung%20Galaxy%20S6%20Edge%20Plus%7C%7C%7CMozilla/5.0%20%28Windows%20Phone%2010.0%3B%20Android%204.2.1%3B%20Microsoft%3B%20Lumia%20950%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/46.0.2486.0%20Mobile%20Safari/537.36%20Edge/13.10586%2C%2C%2CMicrosoft%20Lumia%20950%7C%7C%7CMozilla/5.0%20%28Windows%20Phone%2010.0%3B%20Android%204.2.1%3B%20Xbox%3B%20Xbox%20One%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/46.0.2486.0%20Mobile%20Safari/537.36%20Edge/13.10586%2C%2C%2CXbox%20One%7C%7C%7CMozilla/5.0%20%28PlayStation%204%203.11%29%20AppleWebKit/537.73%20%28KHTML%2C%20like%20Gecko%29%2C%2C%2CPlaystation%204%7C%7C%7C%2C%2C%2C%u041F%u0443%u0441%u0442%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%22%7D%2C%0A%5D.forEach%28function%28m%29%7Bvar%20mItem%3Ddocument.createElement%28m.nodeName%29%3Bvar%20browserRestart%3D%27%27%3B%0Aif%20%28%22restart%22%20in%20m%29%20browserRestart%3D%27%20if%20%28custombuttons.confirmBox%28null%2C%20%22Restart%3F%22%2C%20%22Yes%22%2C%20%22Cancel%22%29%29%20Services.startup.quit%28Services.startup.eAttemptQuit%20%7C%20Services.startup.eRestart%29%3B%27%3B%0Aif%20%28%22name%22%20in%20m%29%20mItem.setAttribute%28%27name%27%2Cm.name%29%3Bif%20%28%22pref%22%20in%20m%29%20%7BmItem.setAttribute%28%27closemenu%27%2C%27none%27%29%3B%0AmItem.setAttribute%28%27oncontextmenu%27%2C%27event.preventDefault%28%29%3Bcustombuttons.clearPrefs%28%22%27+m.pref+%27%22%29%3B%27+browserRestart%29%3B%7D%0Aif%20%28%22key%22%20in%20m%29%20mItem.setAttribute%28%27accesskey%27%2C%20m.key%29%3Bif%20%28m.nodeName%3D%3D%3D%22menuitem%22%29%20%7BmItem.setAttribute%28%27type%27%2C%27checkbox%27%29%3B%0AmItem.setAttribute%28%27oncommand%27%2C%27custombuttons.setPrefs%28%22%27+m.pref+%27%22%2C%21custombuttons.getPrefs%28%22%27+m.pref+%27%22%29%29%3Bif%20%28event.shiftKey%20%26%26%20event.keyCode%3D%3Devent.DOM_VK_RETURN%29%7Bevent.preventDefault%28%29%3Bcustombuttons.clearPrefs%28%22%27+m.pref+%27%22%29%7D%3B%27+browserRestart%29%3B%7D%0Aif%20%28m.nodeName%3D%3D%3D%22menu%22%29%7BmItem.setAttribute%28%27class%27%2C%27menu-iconic%27%29%3B%0A%0Avar%20subMenu%3DmItem.appendChild%28document.createElement%28%22menupopup%22%29%29%3B%0A%0Afor%20%28var%20value%20of%20m.strValues.split%28%27%7C%7C%7C%27%29%29%7Bvar%20submItem%3Ddocument.createElement%28%22menuitem%22%29%3Bvar%20smVal%3Dvalue.split%28%27%2C%2C%2C%27%29%5B0%5D%3B%0Avar%20smValConv%3DconvertFromUnicode%28%22UTF-8%22%2CsmVal%29%3Bvar%20smName%3Dvalue.split%28%27%2C%2C%2C%27%29%5B1%5D%3Bvar%20key%3Dvalue.split%28%27%2C%2C%2C%27%29%5B2%5D%3B%0A%0Akey%20%26%26%20submItem.setAttribute%28%27accesskey%27%2Ckey%29%3BsubmItem.setAttribute%28%27type%27%2C%27radio%27%29%3BsubmItem.setAttribute%28%27label%27%2CsmName%29%3BsubmItem.setAttribute%28%27tooltiptext%27%2CsmVal%29%3BsubmItem.setAttribute%28%27closemenu%27%2C%27none%27%29%3B%0AsubmItem.setAttribute%28%27oncommand%27%2C%27try%7Bcustombuttons.setPrefs%28%22%27+m.pref+%27%22%2C%22%27+smValConv.replace%28/%5C%5C/g%2C%27%5C%5C%5C%5C%27%29+%27%22%29%7Dcatch%28e%29%7BServices.prefs.setIntPref%28%22%27+m.pref+%27%22%2C%22%27+smValConv+%27%22%29%7D%3B%27+browserRestart%29%3B%0AsubMenu.appendChild%28submItem%29%3B%7D%7D%0A%0AmenuPopup.appendChild%28mItem%29%3B%0A%0A%20%20//%20%u041B%u0438%u0441%u0442%u0435%u043D%u0435%u0440%u044B%20%u043E%u0442%u0441%u043B%u0435%u0436%u0438%u0432%u0430%u044E%u0449%u0438%u0435%20%u043F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%0A%20%20//%20%u0438%20%u0443%u0441%u0442%u0430%u043D%u0430%u0432%u043B%u0438%u0432%u0430%u044E%u0449%u0438%u0435%20%u0441%u043E%u043E%u0442%u0432%u0435%u0442%u0441%u0442%u0432%u0443%u044E%u0449%u0438%u0435%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u044F%20%u0438%20%u0447%u0435%u043A%u0431%u043E%u043A%u0441%u044B%20%u0434%u043B%u044F%20%u043F%u0443%u043D%u043A%u0442%u043E%u0432%20%u043C%u0435%u043D%u044E%20%u043F%u0440%u0438%20%u043E%u0442%u043A%u0440%u044B%u0442%u0438%u0438%20%u043C%u0435%u043D%u044E%20%u0438%20%u043A%u043B%u0438%u043A%u0430%u0445%0A%20%20for%20%28var%20type%20of%20%5B%27command%27%2C%27popupshowing%27%2C%27contextmenu%27%5D%29%7BaddEventListener%28type%2C%28e%29%3D%3E%7BsetTimeout%28%28%29%3D%3E%7Bif%20%28%22pref%22%20in%20m%29%7Bvar%20val%2Cdef%3B%0A%20%20%20def%3DServices.prefs.prefHasUserValue%28m.pref%29%3B%0A%20%20%20try%20%7Bval%3DServices.prefs.getComplexValue%28m.pref%2CCi.nsISupportsString%29.data%3B%7D%20catch%28e%29%20%7B%0A%20%20%20if%20%28Services.prefs.getPrefType%28m.pref%29%3D%3D64%29%20val%3Dcustombuttons.getPrefs%28m.pref%29.toString%28%29%3Belse%20val%3Dcustombuttons.getPrefs%28m.pref%29%3B%7D%0A%20%20%20def%20%3F%20mItem.style.setProperty%28%27font-weight%27%2C%20%27bold%27%2C%20%27important%27%29%20%3A%20mItem.style.removeProperty%28%27font-weight%27%29%3B%7D%0A%0A%20%20%20%20%20if%20%28m.nodeName%3D%3D%3D%27menuitem%27%29%7BmItem.setAttribute%28%27checked%27%2Cval%29%3BmItem.label%3D%28mItem.hasAttribute%28%27name%27%29%20%3F%20mItem.getAttribute%28%27name%27%29%20%3A%20m.pref%29+%27%20-%20%22%27+val+%27%22%27%3B%0A%20%20%20%20%20if%20%28%22userChoice%22%20in%20m%29%7Btry%20%7Bvar%20usrChc%3D%28val.toString%28%29%3D%3D%3Dm.userChoice%29%7D%20catch%28e%29%20%7BusrChc%3Dfalse%7D%3B%0A%0A%20%20%20%20%20mItem.setAttribute%28%27user-choice%27%2CusrChc%29%3BusrChc%20%3F%20mItem.style.removeProperty%28%27color%27%29%20%3A%20mItem.style.setProperty%28%27color%27%2C%27orangered%27%2C%27important%27%29%3B%7D%7D%0A%20%20%20%20%20if%20%28subMenu%29%7Bfor%20%28var%20smitem%20of%20subMenu.getElementsByTagName%28%27menuitem%27%29%29%20%7Bvar%20smval%3Dsmitem.getAttribute%28%27tooltiptext%27%29%3Bsmitem.setAttribute%28%27checked%27%2C%28val%3D%3D%3Dsmval%29%20%3F%20true%20%3A%20false%29%3B%7D%7D%0A%20%20%20%20%20if%20%28m.nodeName%3D%3D%3D%22menu%22%29%20%7Bvar%20vname%3B%0A%20%20%20%20%20try%20%7Bvname%3DsubMenu.getElementsByAttribute%28%27checked%27%2C%27true%27%29%5B0%5D.getAttribute%28%27label%27%29%3B%7D%20catch%28e%29%20%7Bif%20%28%21Services.prefs.prefHasUserValue%28m.pref%29%29%20vname%3D%27Default%27%3Belse%20vname%3D%27Other%27%3B%7D%0A%0A%20%20%20%20%20mItem.setAttribute%28%27label%27%2C%28mItem.hasAttribute%28%27name%27%29%20%3F%20mItem.getAttribute%28%27name%27%29%20%3A%20m.pref%29+%27%20-%20%22%27+vname+%27%22%27%29%3B%0A%20%20%20%20%20mItem.setAttribute%28%27tooltiptext%27%2Cval%20%7C%7C%20%27This%20preferences%20has%20null%20value%20or%20does%20not%20exist.%27%29%3B%0A%0A%20%20%20%20%20if%20%28%22userChoice%22%20in%20m%29%20%7Bvar%20smUsrChc%3D%28val%3D%3D%3Dm.userChoice.toString%28%29%29%3BmItem.setAttribute%28%27user-choice%27%2CsmUsrChc%29%3B%0A%20%20%20%20%20smUsrChc%20%3F%20mItem.style.removeProperty%28%27color%27%29%20%3A%20mItem.style.setProperty%28%27color%27%2C%27orangered%27%2C%27important%27%29%3B%7D%7D%0A%0A%20%20%20%20%20if%20%28%22userChoice%22%20in%20m%29%20%7Bvar%20hasNotUserChoice%3DmenuPopup.getElementsByAttribute%28%27user-choice%27%2C%27false%27%29%5B0%5D%3Bcustombuttons.setPrefs%28s%2ChasNotUserChoice%20%3F%20true%20%3A%20false%29%3B%7D%7D%2C%200%29%7D%2Cfalse%2CmenuPopup%29%7D%7D%29%3B%0A%0A//%20%u041B%u0438%u0441%u0442%u0435%u043D%u0435%u0440%20%u043F%u043E%u0437%u0432%u043E%u043B%u044F%u044E%u0449%u0438%u0439%20%u0441%u0431%u0440%u043E%u0441%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%20%u0441%20%u0441%u0443%u0431%u043C%u0435%u043D%u044E%20%u043F%u043E%20Shift%20+%20Enter%7C%7C%u0417%u0430%20%u043A%u043E%u0434%20%u0441%u043F%u0430%u0441%u0438%u0431%u043E%20Dumby%0AaddEventListener%28%22popupshown%22%2C%7BhandleEvent%3A%20function%28e%29%7Bthis%5Be.type%5D%28e%29%3B%7D%2C%0Apopupshown%3A%20function%28e%29%20%7Bif%20%28e.target%21%3DmenuPopup%29%20return%3BmenuPopup.addEventListener%28%22popuphidden%22%2C%20this%2C%20false%29%3Bwindow.addEventListener%28%22keydown%22%2C%20this%2C%20true%29%3B%7D%2C%0Apopuphidden%3A%20function%28e%29%20%7Bif%20%28e.target%21%3DmenuPopup%29%20return%3BmenuPopup.removeEventListener%28%22popuphidden%22%2C%20this%2C%20false%29%3Bwindow.removeEventListener%28%22keydown%22%2C%20this%2C%20true%29%3B%7D%2C%0Apopupshowing%3A%20function%28e%29%20%7Be.target.parentNode.removeEventListener%28%22popupshowing%22%2C%20this%2C%20false%29%3Be.preventDefault%28%29%3B%7D%2Cget%20old%28%29%20%7Bdelete%20this.old%3B%0Athis.e%20%3D%20new%20MouseEvent%28%22contextmenu%22%2C%20%7B%7D%29%3Breturn%20this.old%3DparseInt%28Services.appinfo.platformVersion%29%20%3C%2025%3B%7D%2Cget%20prop%28%29%20%7Bdelete%20this.prop%3B%0Aif%20%28%22key%22%20in%20KeyboardEvent.prototype%29%20this.prop%20%3D%20%22key%22%2C%20this.val%3D%22Enter%22%3Belse%20this.prop%20%3D%20%22keyCode%22%2C%20this.val%3DKeyboardEvent.DOM_VK_RETURN%3Breturn%20this.prop%3B%7D%2C%0Akeydown%3A%20function%28e%29%20%7Bif%20%28%21e.shiftKey%20%7C%7C%20e.ctrlKey%20%7C%7C%20e.altKey%20%7C%7C%20e%5Bthis.prop%5D%20%21%3D%20this.val%29%20return%3Bvar%20target%3DmenuPopup.querySelector%28%22menu%5B_moz-menuactive%5D%3Anot%28%5Bopen%5D%29%22%29%3B%0Aif%20%28%21target%29%20return%3Bthis.old%20%3F%20target.addEventListener%28%22popupshowing%22%2C%20this%2C%20false%29%20%3A%20e.stopPropagation%28%29%3Btarget.dispatchEvent%28this.e%29%3BmenuPopup.dispatchEvent%28this.e%29%3B%7D%7D%2C%20false%2C%20menuPopup%29%3B%0A%0A//%20%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u043C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%20%u043F%u043E%20%u0441%u043E%u0447%u0435%u0442%u0430%u043D%u0438%u044E%20%u043A%u043B%u0430%u0432%u0438%u0448%20Alt%20+%20M%20%28%u043D%u0435%20%u0437%u0430%u0432%u0438%u0441%u0438%u0442%20%u043E%u0442%20%u0442%u0435%u043A%u0443%u0449%u0435%u0439%20%u0440%u0430%u0441%u043A%u043B%u0430%u0434%u043A%u0438%20%u043A%u043B%u0430%u0432%u0438%u0430%u0442%u0443%u0440%u044B%29%0A//%20%u041F%u043E%u0441%u043C%u043E%u0442%u0440%u0435%u0442%u044C%20%u043A%u043E%u0434%u044B%20%u043A%u043B%u0430%u0432%u0438%u0448%20%u043C%u043E%u0436%u043D%u043E%20%u0437%u0434%u0435%u0441%u044C%3A%20https%3A//developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode%23Constants_for_keyCode_value%0AaddEventListener%28%27keyup%27%2C%28e%29%3D%3E%7Bif%20%28e.altKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.ctrlKey%20%26%26%20e.keyCode%3D%3D77%29%7Be.preventDefault%28%29%3Be.stopPropagation%28%29%3B%0AmenuPopup.showPopup%28this%2C-1%2C-1%2C%22popup%22%2C%22bottomleft%22%2C%22topleft%22%29%3B%7D%7D%2Cfalse%2Cwindow%29%3B%0A//%20%u041A%u043E%u043D%u0432%u0435%u0440%u0442%u0438%u0440%u043E%u0432%u0430%u0442%u044C%20%u0442%u0435%u043A%u0441%u0442%20%u0432%20%u044E%u043D%u0438%u043A%u043E%u0434%20.............%0Afunction%20convertFromUnicode%28charset%2Cstr%29%20%7Bvar%20converter%3DCc%5B%22@mozilla.org/intl/scriptableunicodeconverter%22%5D.createInstance%28Ci.nsIScriptableUnicodeConverter%29%3B%0Aconverter.charset%3Dcharset%3Bstr%3Dconverter.ConvertFromUnicode%28str%29%3Breturn%20str+converter.Finish%28%29%3B%7D%3B%0A%0A%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E

Вот этот код прошу подправить, чтобы он создавал рабочую кнопку для [firefox] 69.0.3 .

Отсутствует

 

№1535925-03-2021 14:12:06

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

Re: Custom Buttons

Dumby пишет

Как это не запускается?
Когда я жму на menuitem «АнтиЗапрет (1)», в консоли прявляется запись

Ясно, что код в пятом элементе массива был с ошибкой. Это я исправил.

Dumby пишет

Немного отличается метод contextmenu(), а метод click() вообще отсутствует.
То есть, хорошо бы заменить contextmenu(e) {...}, на это

Заменил, но если я добавляю в мою кнопку метод click, то перестаёт работать LongPress - действие по удержанию кнопки. Пользуюсь в своей старой кнопке этой удобной фишкой много лет.

Выделить код

Код:

// Quick Toggle https://forum.mozilla-russia.org/viewtopic.php?pid=784139#p784139
// https://forum.mozilla-russia.org/viewtopic.php?pid=784165#p784165
// Быстрое переключение параметров about:config
// LongClick не срабатывает второй раз, сначала нужно открыть меню

(async (name, id, func) => {
	if (name == "Object") return CustomizableUI.createWidget(func());
	var win = name == "Window", g = Components.utils.import("resource://gre/modules/Services.jsm", {});
	if (g[id]) {if (win) return;} else g[id] = func();
	if (win) return CustomizableUI.createWidget(g[id]);
	addDestructor(r => r[5] == "e" && delete g[id]);
	g[id].onCreated(this);
})(this.constructor.name, "QuickToggleAboutConfigSettingsUCF", () => { // BEGIN (this.constructor… {код кнопки});

	var {prefs} = Services, db = prefs.getDefaultBranch("");
	var pv = parseInt(Services.appinfo.platformVersion);
	var xul_ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

//=====================================================================================

	// refresh:
	//	false - reload current tab
	//	true - reload current tab skip cache
	//
	// restart:
	//	false - restart browser
	//	true - restart browser with confirm

	var primary = [{
			pref: ["network.proxy.autoconfig_url", "Прокси (VPN) URL"],
			userChoice: 0, userAlt: 1, refresh: true,
			values: [
				["127.0.0.1", "отключен…", "0", "", "Services.prefs.setIntPref('network.proxy.type', 0);"],
				["https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "Надёжный доступ на заблокированные сайты\n\n«Режим прокси» меняется на 2", "Services.prefs.setIntPref('network.proxy.type', 2);"],
				[prefs.getStringPref("user.pacfile", "file:///etc/proxy.pac"), "user .pac файл", "2"],
				["https://git.io/ac-anticensority-pac", "ac-anticensority", "3"],
				["localhost", "Tor Browser", "4"]
	]},{
			pref: ["network.proxy.type", "Режим прокси"],
			userChoice: 0, userAlt: 2, refresh: true,
			values: [
				[0, "Без прокси", "0", "по-умолчанию"],
				[5, "Системные (из IE)", "5"],
				[2, "Автонастройка", "2", "about:config — user.pacfile"],
				[1, "Ручная настройка", "1", "вторая строка"],
				[4, "Автоопределение", "4"]
	]},{
			pref: ["network.proxy.share_proxy_settings", "Прокси для всех протоколов"],
			userChoice: true, refresh: true,
			values: [[true, "Да", "", "Прокси для всех протоколов при ручной настройке"], [false, "Нет"]]
	},{
			pref: ["network.trr.mode", "DNS через HTTPS"],
			userChoice: 2, userAlt: 0, refresh: true,
			values: [
				[0, "Выключен", "0"], [2, "TRR + мой", "2"], [3, "только TRR", "3"]
	]},null,{
			pref: ["permissions.default.image", "Загрузка изображений"],
			userChoice: 1, userAlt: 3, refresh: true,
			values: [[1, "Разрешена"], [3, "Только с сайта"], [2, "Отключить"]]
	},{
			pref: ["image.animation_mode", "Анимация изображений"],
			userChoice: "none", refresh: true,
			values: [["none", "Выключена"], ["normal", "Включена"], ["once", "Единожды"]]
	},{
			pref: ["browser.display.use_document_fonts", "Загружать web-шрифты"],
			userChoice: 1, refresh: true,
			values: [[1, "Да"], [0, "Нет"]]
	},null,{
			pref: ["media.autoplay.default", "Авто-play аудио/видео"],
			userChoice: 5, refresh: true,
			values: [
				[0, "Разрешить", "0"],
				[1, "Запретить", "1"],
				[2, "Спрашивать", "2"],
				[5, "Блокировать", "5"]
	]},{
			pref: ["media.autoplay.blocking_policy", "Автозапуск (политика)"],
			userChoice: 1, userAlt: 2, refresh: true,
			values: [
				[1, "Временная", "1"],
				[2, "По действию", "2"],
				[0, "Постоянная", "0"]
	]},{
			pref: ["plugin.state.flash", "Flash-plugin"],
			userChoice: 2, refresh: true,
			values: [
				[2, "Всегда включать", "2"],
				[1, "Включать по запросу", "1"],
				[0, "Никогда не включать", "0"]
	]},null,{
			pref: ["network.cookie.cookieBehavior", "Cookies"],
			userChoice: 1, userAlt: 3, refresh: false,
			values: [
				[1, "Не принимать сторонние"], [3, "Не принимать с не посещенных"], [4, "Не принимать от трекеров"],
				[2, "Не принимать со всех"], [0, "Принимать со всех"]
	]},{
			pref: ["javascript.enabled", "Выполнять скрипты Java"],
			userChoice: true, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	},null,{
			pref: ["dom.storage.enabled", "Локальное хранилище"],
			userChoice: true
	}
];

//=====================================================================================

	var secondary = [{

			pref: ["dom.enable_performance", "Статус загрузки страницы"],
			userChoice: false
	},{
			pref: ["browser.display.document_color_use", "Использовать цвета сайтов"],
			userChoice: 0,
			values: [[0, "Авто", "0"], [1, "Всегда", "1"], [2, "Никогда", "2"]]
	},{
			pref: ["intl.accept_languages", "Язык для веб-страниц"],
			userChoice: "ru-RU, ru, en-US, en",
			values: [["chrome://global/locale/intl.properties", "По-умолчанию"], ["en-US, en, ru-RU, ru", "Английская локаль"], ["ru-RU, ru, en-US, en", "Русская локаль"]]
	},null,{
			pref: ["network.http.sendRefererHeader", "Referer - для чего"],
			userChoice: 1,
			values: [[0, "Ни для чего", "0"], [1, "Только ссылки", "1"], [2, "Ссылки и изобр.", "2"]]
  },{
			pref: ["media.peerconnection.enabled", "WebRTC утечка IP"],
			userChoice: false
	},{
			pref: ["gfx.webrender.all", "WebRender для всего"],
			userChoice: false, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	},{
			pref: ["media.webm.enabled", "Декодер WebM VP8"],
			userChoice: false, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	}
	];

	return {
		label: "Quick Toggle Settings",
		id: "QuickToggleAboutConfigSettings",
		tooltiptext: "Quick Toggle Settings\n	ЛКМ	ПКМ",
		localized: false,
		image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFPSURBVDhPnVPNSsNAEJ5tamnBk+A7BMEcikohp/gi9i18nRafQoT00kK16tnn8CJo4vp9m5m41eSgH0zmd3d+diJ/gfdedvl0QW7k1PcLwem+3TjowZagK+Nn6yc3gNCJ+LCCh9LzzTMdqeoNbkQSFZmpJLGCW5Gx2hZaQahMbZ52VuDSfHpnAVJXOb4FKzianbzCXiLrHLYl5C3t5NTRwtxaKJxUTZ/JcOTr6q2Rxwf0aVb2/hLs4KqL3Isckz/mmSdRRksjyg+z7IM6LzDCBfuvAEOJmIKBOqAWmo1YodxLlQNsyO0rsIV/AZM+JGc2a4GgzhZ2p9mFmrpboCMqNYBDdMlwompoTWN6F2nFT5hBXb0PEpmo/Gk+oH+RrqNZINPeIlnZViV1jQuLFJQuWGB0gJdwgShvqdPXZv6J+F/QS7oXqQ9xBTFZ5oa8fAGs9fed5YhPSwAAAABJRU5ErkJggg==",
		onCreated(btn) {
			btn.setAttribute("image", this.image);
			var doc = btn.ownerDocument;

			btn.btn = true;
			btn.domParent = null;
			btn.popups = new btn.ownerGlobal.Array();
			this.createPopup(doc, btn, "primary", primary);
			this.createPopup(doc, btn, "secondary", secondary);
			this.createCloseMenusOption(doc, btn);

			btn.linkedObject = this;
			for(var type of ["command", "contextmenu", "mousedown"])
				btn.setAttribute("on" + type, `linkedObject.${type}(event)`);
		},
		createPopup(doc, btn, name, data) {
			var popup = doc.createElementNS(xul_ns, "menupopup");
			var prop = name + "Popup";
			btn.popups.push(btn[prop] = popup);
			popup.id = this.id + "-" + prop;
			for (var type of ["popupshowing", "click"])
				popup.setAttribute("on" + type, `parentNode.linkedObject.${type}(event)`);
			for(var obj of data) popup.append(this.createElement(doc, obj));
			btn.append(popup);
		},
		map: {b: "Bool", n: "Int", s: "String"},
		createElement(doc, obj) {
			if (!obj) return doc.createElementNS(xul_ns, "menuseparator");
			var pref = doc.ownerGlobal.Object.create(null), node, img, bool;
			for(var [key, val] of Object.entries(obj)) {
				if (key == "pref") {
					var [apref, lab, akey, ttt] = val;
					pref.pref = apref; pref.lab = lab || apref;
					if (ttt) pref.ttt = ttt;
				}
				else if (key == "image") img = val, pref.img = true;
				else if (key != "values") pref[key] = val;
				else pref.hasVals = true;
			}
			var type = prefs.getPrefType(pref.pref);
			var str = this.map[type == prefs.PREF_INVALID
				? obj.values ? (typeof obj.values[0][0])[0] : "b"
				: type == prefs.PREF_BOOL ? "b" : type == prefs.PREF_INT ? "n" : "s"
			];
			pref.get = prefs[`get${str}Pref`];
/*
			pref.set = prefs[`set${str}Pref`];
*/
			var map, set = prefs[`set${str}Pref`];
			if (pref.hasVals) {
				for(var [val, , , , code] of obj.values)
					code && (map || (map = new Map())).set(val, code);
				if (map) pref.set = (key, val) => {
					set(key, val);
					map.has(val) && eval(map.get(val)); // выполнить код
				}
			}
			if (!map) pref.set = set;

			node = doc.createElementNS(xul_ns, "menu");
			node.className = "menu-iconic";
			node.setAttribute("closemenu", "none");
			img && node.setAttribute("image", img);
			akey && node.setAttribute("accesskey", akey);
			(node.pref = pref).vals = doc.ownerGlobal.Object.create(null);
			this.createRadios(doc,
				str.startsWith("B") && !pref.hasVals ? [[true, "true"], [false, "false"]] : obj.values,
				node.appendChild(doc.createElementNS(xul_ns, "menupopup"))
			);
			if ("userChoice" in obj) pref.noAlt = !("userAlt" in obj);
			return node;
		},
		createCloseMenusOption(doc, btn) {
			var pn = this.closePref = "QuickToggleAboutConfigSettings.closeMenus";
			var data = [null, {
				pref: [pn, "Закрывать меню этой кнопки"], values: [[true, "Да"], [false, "Нет"]]
			}];
			var setCloseMenus = e => {
				e.stopPropagation();
				var trg = e.target, {pref, val} = trg, updPopup = true, clear;
				switch(e.type) {
					case "command": pref = (trg = trg.closest("menu")).pref; updPopup = false; break;
					case "click": if (e.button) return; break;
					case "contextmenu": e.preventDefault(); clear = pref;
				}
				if (!pref) return;
				if (clear) prefs.clearUserPref(pn);
				else if (!updPopup && val === pref.val) return;
				else pref.set(pn, val !== undefined ? val : !pref.val);
				this.upd(trg);
				updPopup && this.popupshowing(null, trg.querySelector("menupopup"));
			}
			(this.createCloseMenusOption = (doc, btn) => {
				for(var obj of data)
					btn.secondaryPopup.append(this.createElement(doc, obj));
				var m = btn.secondaryPopup.lastChild;
				m.style.cssText = "fill: lightblue !important; list-style-image: url(chrome://browser/skin/menu.svg) !important;";
				m.setAttribute("oncommand", "setCloseMenus(event)");
				m.onclick = m.oncontextmenu = m.setCloseMenus = setCloseMenus;
			})(doc, btn);
		},
		UserChoiceImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRUlEQVR42qWTS2gTQRjH/zPJZo2BDfgkB62vYg5CjQdvRUE8WB8HKyahYotIQQOeFKGCF7EgvQlBqOCjWFKlevBRDyL4uHloLXhYqWJroaEqlETSptndGb+ZPDH0ojN8O8vA98vv+/Itw38u1nSRYRE6UhKyg4FF1R292/Q+xhhLi4TIrgjgIzwe4MbgmR2nrZMtxxEN63zYORuPZp7gzpehvCu9XjfuPmwCUHIiEtw4fK89zVvD2+FHAD56quXBpV3CVO4ret6nxHzxZxdBRuqADCKmz7RHD9y2tlmbYbBVfwE8DXBkEd/y39H5+mze8ZyoSIpsFXC9u/VE3/ldpyg5AAMEoJMTQi2hANKBgyKdy0h/eoChqcf9MimvVAHjd/fdiG0NRwgQpDAp1agBpDZwdHKJLKZzc+h5e3kCSexh5c5j8fmhW0HGpNZXFkqfsQpAKgcFKGmAlAxHXp5bkkmsrhosjh4cCIJ5pG5qfQXgtMslqO1qgEMWTPrR+eriEhoA4wN7L8TWh0KVXzfgY2RQAUjVBenWLH4UCrj04Wa9BNXEo5va+w63xCiJ6WRVP2MVgNQIgjgEA17MTODZ7Lt+AtSaGDG4377a1m2FAkKrc11/dUwIID1dSKHEcW3yft4RbpR6kK1PYgaJtaY1nNp5jIeMsjKNbs1AWRUcjvTnp2Kh9LtLJGTDINUhcTIZ3L+hzdq9ZgvWmSF9/Wu5gI8L03gzP5l3hddL/3/zKDdA9MdE0UERrdzaFGMUaap75Y/pX9Yfap76EQYaCeEAAAAASUVORK5CYII=",
		notUserChoiceImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACNUlEQVR42qXTT2jTUBwH8G9e0ta2ks5ND0Ww/qX1oGyevEwQnOBA6EHXwLwoUh3eRGRs501RPE6xgp6KrexQECZY8DBPXmbRS4Z/K0gRtmmDa2yb5PlLX7p2Gwpi4EfCy8sn3/dPwn9e0saGnCRF6XYFnA9DkhKtRs51ep6jmtEcp/JHIM9Yivl9mf0XNDV2Ngn1YLzVxdB1lJ8U8P5hzuCWnR6xrPwmIM8kLRjdkT326BaLHNgLKAFA9ouXdhOw6qi++4j589cd89vSaMqyc2sAPUXlgF8fyt9WI3t2Av4w4NsCMJ8AHAKav6hqqH76iuLINcNuNhOawyttYCp+7tRE/6XT9GFQAG4CpniATQkIaNQIMVG6/xSL2WfTGueTbWDh5L2rA9t29QGBrQQEPUDuAuoEmFSr+P5lGc8v33mtAUfaQO3M4/GgDOoYCIkUin8D0BDDoBQ2ZMxqN0wCQh0gMxaUnYb4uzt+dwIZ8wBHTGQbYAHMpu+uAxaGxpMDvSr3AHcFaAIlD+BtoN6ag5WqhOLNwrohTMWPH5roP7pdLIwb3wW6EziWGAZhpVdLWHzxdpqAyc4yKrJ+4uKg2oMV+lgRK9CdwAVsG1WpF8UH84Zt2QkCKmsbiRAtFAllB5OHWQ9fpr81OwlcgBL9kPrwsvDGMQ1zNMV5ZyN1ISlZYZl9/TE1tjuMSFgA1VWO8uef+FAqG47tpFMcm7dyFyIOEzBMlfCadao5qhk39l9P479evwFbiOcRSXKueAAAAABJRU5ErkJggg==",
		UserAltImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIfSURBVDhPpVM9b9NQFD02cSKKFVGKIFFREFsmFiCA1AEQQrQjC0gssLCkC0jJj0iFWFoGdiT4Ay0SEmJBhPI5FBokikL4SCC0Te2UxInt13Mdu1CVrVc6713fe86x/T6w09DCeTNKJ7Q0pzyUmoCmZYOiUhXms8RMcd6vB7UwthhM5fTLWix2L3PmYjKdOwdz9DDFGtr1KuovnqD29JGlfO9Goew9DCV/DaZy2pXE8PD9Y/mbupk6xE6cVWPQhEujHo2+4fXdO76ztnq1UPYfSCcwKB1HWjeMyunCraSZOsDqbkBPsBOTNoMGvkOTLto/f+F56bble262OK/qesiYzIydTJojFLjrgEe4bcIOEdXWYe6LITN2KgmFSRFGBuPpo0eAngX0SexTJHD5LOgLpEZTcgKuUuMijAyy5l7+r0NSb21g5LQI5gGYSy2AjYBLjQyRAUniTnJXsBoayBzm3RBBndwwIoOK3fgNdIREQYCV/0DqLdiNZqCRITKYayx85RfQuUNiZ3k7IgO+vfGeXGpkiAyma++WLHtZhZ8o5H/FEVpos1V7u8TFwLQId8nw+Afa51Oq2vyycmlk9KCW0GXFZeu63IUO8z88Bx5s28SbuUXfddzrxVcobxpI0GTh7H734/dPzQt9d0/CGBpCPB7nbhmwbAPVxR4+PPtsuU7/WuElth/lKORUcsoTE8TgMg0WbJaY4Zu3XKYdBrABARUk+ls4DfQAAAAASUVORK5CYII=",
		upd(node) {
			var {pref} = node, def = false, user = false, val;
			if (prefs.getPrefType(pref.pref) != prefs.PREF_INVALID) {
				var pn = pref.pref;
				try {val = pref.defVal = db[pref.get.name](pn); def = true}
				catch(ex) {def = false;}
				var user = prefs.prefHasUserValue(pn);
				if (user) try {val = pref.get(pn, undefined);} catch(ex) {}
			}
			if (val == pref.val && def == pref.def && user == pref.user) return;
			pref.val = val; pref.def = def; pref.user = user;
			var exists = def || user;

			var ttt = exists ? val : "Этого префа не существует";
			if (ttt === "") ttt = "[ empty_string ]";
			ttt += "\n" + pref.pref;
			if (pref.ttt) ttt += "\n" + pref.ttt;
			node.tooltipText = ttt;

			var img, alt = "userAlt" in pref && val == pref.userAlt;
			if (alt) img = this.UserAltImg;
			if ("userChoice" in pref)
				if (val == pref.userChoice)
					//node.style.removeProperty("color"),
					img = this.UserChoiceImg;
				else {
					//node.style.setProperty("color", "maroon", "important");
					if (!alt) img = this.notUserChoiceImg;
				}
			if (!pref.img) img
				? node.setAttribute("image", img)
				: node.removeAttribute("image");
			user
				? node.style.setProperty("font-style", "italic", "important")
				: node.style.removeProperty("font-style");

			var {lab} = pref;
			if (exists && pref.hasVals) {
				if (val in pref.vals) var sfx = pref.vals[val] || val;
				else var sfx = user ? "Другое" : "По умолчанию";
				lab += ` — "${sfx}"`;
			}
			node.setAttribute("label", lab);
		},
		createRadios(doc, vals, popup) {
			for(var arr of vals) {
				if (!arr) {
					popup.append(doc.createElementNS(xul_ns, "menuseparator"));
					continue;
				}
				var [val, lab, key, ttt] = arr;
				var menuitem = doc.createElementNS(xul_ns, "menuitem");
				menuitem.setAttribute("type", "radio");
				menuitem.setAttribute("closemenu", "none");
				menuitem.style.setProperty("font-style", "italic", "important"),
				menuitem.setAttribute("label", popup.parentNode.pref.vals[val] = lab);
				key && menuitem.setAttribute("accesskey", key);
				var tip = menuitem.val = val;
				if (ttt) tip += "\n" + ttt;
				menuitem.tooltipText = tip;
				popup.append(menuitem);
			}
		},
		openPopup(popup) {
			var btn = popup.parentNode;
			if (btn.domParent != btn.parentNode) {
				btn.domParent = btn.parentNode;
				var pos;
				if (btn.matches(".widget-overflow-list > :scope"))
					pos = "after_start";
				else var win = btn.ownerGlobal, {width, height, top, bottom, left, right} =
					btn.closest("toolbar").getBoundingClientRect(), pos = width > height
						? `${win.innerHeight - bottom > top ? "after" : "before"}_start`
						: `${win.innerWidth - right > left ? "end" : "start"}_before`;
				for(var p of btn.popups) p.setAttribute("position", pos);
			}
			popup.openPopup(btn);
		},
		maybeRestart(node, conf) {
			var msgRest = "Перезапустить браузер?", msgAbort = "Запрос на выход отменен.";
			if (pv >= 77) {
				var title = node.closest("toolbarbutton").label;
				var pp = domWin => Services.prompt.wrappedJSObject.pickPrompter({
					domWin, modalType: Ci.nsIPrompt.MODAL_TYPE_WINDOW
				});
				var confirm = win => pp(win).confirm(title, msgRest);
				var alert = win => pp(win).alert(title, msgAbort);
			} else {
				var confirm = win => win.confirm(msgRest);
				var alert = win => win.alert(msgAbort);
			}
			return (this.mayBeRestart = (node, conf) => {
				var win = node.ownerGlobal;
				if (conf && !confirm(win)) return;
				if (win.BrowserUtils.restartApplication() === false) alert(win);
				else return true;
			})(node, conf);
		},
		regexpRefresh: /^(?:view-source:)?(?:https?|ftp)/,
		maybeRe(node, fe) {
			var {pref} = node;
			if ("restart" in pref) {
				if (this.maybeRestart(node, pref.restart)) return;
			}
			else this.popupshowing(fe, node.parentNode);
			if ("refresh" in pref) {
				var win = node.ownerGlobal;
				if (this.regexpRefresh.test(win.gBrowser.currentURI.spec)) pref.refresh
					? win.BrowserReloadSkipCache() : win.BrowserReload();
			}
		},
		maybeClosePopup(e, trg) {
			!e.ctrlKey && prefs.getBoolPref(this.closePref, undefined)
				&& trg.parentNode.hidePopup();
		},
		command(e) {
			var trg = e.target;
			if (trg.btn) return this.openPopup(trg.primaryPopup);

			var menu = trg.closest("menu"), newVal = trg.val;
			this.maybeClosePopup(e, menu);
			if (newVal != menu.pref.val)
				menu.pref.set(menu.pref.pref, newVal),
				this.maybeRe(menu, true);
		},
		popupshowing(e, trg = e.target) {
			if (trg.state == "closed") return;
			if (trg.id) {
				for(var node of trg.children) {
					if (node.nodeName.endsWith("r")) continue;
					this.upd(node);
					!e && node.open && this.popupshowing(null, node.querySelector("menupopup"));
				}
				return;
			}
			var {pref} = trg.closest("menu"), findChecked = true;

			var findDef = "defVal" in pref;
			var checked = trg.querySelector("[checked]");
			if (checked) {
				if (checked.val == pref.val) {
					if (findDef) findChecked = false;
					else return;
				}
				else checked.removeAttribute("checked");
			}
			if (findDef) {
				var def = trg.querySelector("menuitem:not([style*=font-style]");
				if (def)
					if (def.val == pref.defVal) {
						if (findChecked) findDef = false;
						else return;
					}
					else def.style.setProperty("font-style", "italic", "important");
			}
			for(var node of trg.children) if ("val" in node) {
				if (findChecked && node.val == pref.val) {
					node.setAttribute("checked", true);
					if (findDef) findChecked = false;
					else break;
				}
				if (findDef && node.val == pref.defVal) {
					node.style.removeProperty("font-style");
					if (findChecked) findDef = false;
					else break;
				}
			}
		},
		contextmenu(e) {
			var trg = e.target;
			if (trg.btn) {
				if (e.ctrlKey || e.shiftKey) return;
				if (e.detail == 2) return trg.secondaryPopup.hidePopup();
				this.openPopup(trg.secondaryPopup);
			}
			else if ("pref" in trg && trg.pref.user)
				prefs.clearUserPref(trg.pref.pref),
				this.maybeRe(trg, true);
			e.preventDefault();
		},
		mousedown(e) {
			var reset = e => e.target.linkedObject = this;
			var id, lo = {command: reset, mousedown: reset};

			var lin = e.view.AppConstants.platform == "linux";
			var stop = e => reset(e) && e.preventDefault();

			lo.contextmenu = lin
				? e => e.ctrlKey || e.shiftKey ? dsp(e) : stop(e) : stop;
			var context = lin
				? e => e.button == 2 && e.type.endsWith("p") && this.contextmenu(e) : () => {};

			var dsp = (e, timeout) => {
				var trg = e.target;
				trg.onmouseup = trg.onmouseleave = null;
				if (timeout) return this.londPress(e);
				e.view.clearTimeout(id);
				reset(e);
				context(e);
			}
			(this.mousedown = e => {
				var trg = e.target;
				if (!trg.btn) return;
				trg.linkedObject = lo;
				trg.onmouseup = trg.onmouseleave = dsp;
				id = e.view.setTimeout(dsp, 500, e, true);
			})(e);
		},
		londPress(e) { // удержание кнопки мыши, выбирать команды, отводящие мышь от кнопки
			var msg = "QuickSettings\nLONG PRESS: e.button = " + e.button;
			e.view.alert(msg);
		}
	};
}); // END код кнопки

Отредактировано Dobrov (26-03-2021 04:19:21)

Отсутствует

 

№1536025-03-2021 17:49:51

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 298
UA: Firefox 87.0

Re: Custom Buttons

Dumby
Посмотрите, пожалуйста эту кнопку.
Перестала работать в 87

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

Выделить код

Код:

//Дополнительные пункты контекстного меню на странице about:addons для аддонов, плагинов, тем, CB.....................................................................................
((id, g, iconizer) => addDestructor(r => r[5] == "e" && id in g && g[id].destroy()) + addEventListener("shown", {
    //------------------------------------------------------------------
    "Копировать имя_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать имя"(addon, hideOn) {
        if (hideOn) return false;

        gClipboard.write(addon.name);
    },
    //------------------------------------------------------------------
    "Копировать ID_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать ID"(addon, hideOn) {
        if (hideOn) return false;

        gClipboard.write(addon.id);
    },
    //------------------------------------------------------------------
    "Копировать версию_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать версию"(addon, hideOn) {
        if (hideOn) return ["custombuttons"];

        gClipboard.write(addon.version);
    },
    //------------------------------------------------------------------
    "Копировать имя и версию_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать имя и версию"(addon, hideOn) {
        if (hideOn) return ["custombuttons"];

        gClipboard.write(addon.name + " " + addon.version);
    },
    //------------------------------------------------------------------
    "Домашняя страница_i": "data:image/png;base64,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",
    "Домашняя страница"(addon, hideOn) {
        if (hideOn) return !addon.homepageURL;

        var url = addon.homepageURL;
        if (!url) {
        if (addon.reviewURL) {
        url = addon.reviewURL.replace(/\/reviews\/.*$/, "/");
        }
        }
       openURL(url);
    },
    //------------------------------------------------------------------
    "Поиск на АМО_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJGSURBVDjLjdJLSNRBHMDx78yqLZaKS75DPdgDDaFDbdJmde5QlhCJGxgpRJfqEEKnIsJLB7skQYQKZaSmdLaopPCgEvSCShCMzR5a7oq7/3l12RVtjfzBMA/4fWZ+MyOccwBM3g8HEbIdfCEhfAFnLVapOa28Uevpjrqz/WOsERJgsu9Uq5CZQzgqrJfo9BajNd5irEYn4p3OUiFExtCLmw2tawFi4l5zUMjMIau9u7K+qxeoAcoAA0wDb2OPwmfA16LiiaOHLj1edRLpkO3WmIis7+oBDgJbgQ2AH6gC6jY19N62RkcctKeVIJAhp9QgUA3kJXdONZVcq9JxPSgQoXRAyIDRth8oAXQyKdWnoCKrTD9CBv4GMqx1WGNZkeRWJKbG2hiD1Cb9FbTnzWFdY/LCdLKlgNQ84gyNKqHm0gDjqVHnxDHgA/B9RQkpaB6YklkZl62np9KBhOqwjpKFgeY2YAz4BESBWHI8Hhs6PVVSvc3v98ye4fP7T676B845nt040ip98qpWJmI9PWiU6bfWgXGN2YHcKwU7tsuc4kpUPMbU0+f8+vKt+Pitl7PLAMDI9cNBoB0hQwICzjqUp6MZvsy8yvp95BRuQUjJ75mPvH4wYo1NlJ64Mza7DPwrhi8cCOeXl/aUB4P4c/NJxKLMvpngycCrzxVFG2v/CwAMnguF80oLe8p27cQh+fnpPV/fTc95S6piXQDAw7a9YbWkezZXFbAwMx/xPFXb1D3+Y90AQF/L7kAsri9mZ4lrTd0TcYA/Kakr+x2JSPUAAAAASUVORK5CYII=",
    "Поиск на АМО"(addon, hideOn) {
        if (hideOn) return ["custombuttons","theme","plugin"];

        var url = addon.homepageURL;
        if (!url) {
        url = "https://addons.mozilla.org/search/?q="
            + encodeURIComponent(addon.name);
        }
       openURL(url);
    },
    //------------------------------------------------------------------
    "Папка установки_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABAklEQVR42mNkoBAwAjEXEAcCMTsW+U9AvB6I/+I0gJ2Noe3QJoZKASEgjwkq+h+C795lYPCKZMgC8mZg0fsfbICIIMOcF6cZkrGZ/v8fA0PndIa/7z8BXfAPqgVKv//A8GPeZoYERmE+hjmP1+AwAOgiTjOIP7HZLyjLMJNRmB/ogjMMyYzsUC8wIhQwsgCFWHAHoKAy0AARIYY5r69idwEhIKgBMgAYBq8vkGmALsyAU2QaYAwz4CiZBliADBAAGnCATANsYQbsJtMAJ5ABwGh8uZE8A4R9gAYwMzHkT8hl6Bfgxp5ecIH3Xxj+F05hyIdpUmXAnpnwge9AfJckW7EBAC/gSzisxsnmAAAAAElFTkSuQmCC",
        "Папка установки"(addon, hideOn) {
        if (hideOn) return ["custombuttons","theme","plugin"];

                    switch (addon.type) {
                    case "plugin":
                    var pathes = addon.pluginFullpath;
                    for (var i = 0; i < pathes.length; i++) {
                        this.revealPath(pathes[i]);
                    }
                    return;
                case "userchromejs":
                    var file = addon._script.file;
                    if (file.exists())
                        file.reveal();
                    return;
            }

            var gecko = parseInt(Services.appinfo.platformVersion);
            var nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", (gecko >= 14) ? "nsIFile" : "nsILocalFile",
                "initWithPath");

            var dir = Services.dirsvc.get("ProfD", Ci.nsIFile);
            dir.append("extensions");
            dir.append(addon.id);
            var fileOrDir = dir.path + (dir.exists() ? "" : ".xpi");

            try {
                (new nsLocalFile(fileOrDir)).reveal();
            } catch (ex) {
                var addonDir = /.xpi$/.test(fileOrDir) ? dir.parent : dir;
                try {
                    if (addonDir.exists()) {
                        addonDir.launch();
                    }
                } catch (ex) {
                    var uri = Services.io.newFileURI(addonDir);
                    var protSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
                    getService(Ci.nsIExternalProtocolService);
                    protSvc.loadUrl(uri);
                }
            }
    },
    //------------------------------------------------------------------
    "Файл установки_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA51AAAOdQG5Y1EyAAAAhklEQVQ4y6WT0QnAIAxE78Bt2v1cod3PznP9kVLTRKUGBD+Sd5eQUBJWggCWCAkAJPGXOqlUPyVKkrSPQIoCQJGE6AF4HFyGuBmrR3cGQX8Wmp2cL8Cqv5JPD5Zm1D0nFZjTjHpQ7DuI1L3iBjBS9/pvhtjr21OukVkXiX/ug6SWj4mr53wDMz1vldHlLJkAAAAASUVORK5CYII=",
        "Файл установки"(addon, hideOn) {
        if (hideOn) return ["custombuttons","theme","plugin"];

            var gecko = parseInt(Services.appinfo.platformVersion);
            var nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", (gecko >= 14) ? "nsIFile" : "nsILocalFile",
                "initWithPath");
            var dir = Services.dirsvc.get("ProfD", Ci.nsIFile); 
                        dir.append('extensions');
                        dir.append(addon.id);
                            if ( dir.exists() ) dir.launch();
                            var file = Components.classes['@mozilla.org/file/directory_service;1']
                                      .getService(Components.interfaces.nsIProperties)
                                     .get('ProfD', Components.interfaces.nsIFile);
                            file.append('extensions');
                            file.append( addon.id + '.xpi' )
                            if ( file.exists() ) file.launch(); 
                            return;
    },
    //------------------------------------------------------------------
    url: "chrome://mozapps/content/extensions/aboutaddons.html",
    handleEvent(e) {
        if (e.target.baseURI != this.url) return;
        var item = this.getItem(e.target.ownerDocument);
        var addon = item.addon = e.target.closest("addon-card").addon;
        
        for(var child of item.children) {
            var res = this[child.textContent](addon, true);
            child.hidden = Array.isArray(res)
                ? res.includes(addon.type) : res;
        }
        e.target.contains(item) || requestAnimationFrame(
            () => e.target.prepend(item)
        );
    },
    click(e) {
        e.stopPropagation();
        iconizer.item.parentNode.hide();
        this[e.target.textContent](iconizer.item.addon);
    },
    getItem(doc) {
        if (iconizer.item) {
            if (iconizer.item.ownerDocument == doc) return iconizer.item;
            iconizer.handleEvent();
        }
        var item = doc.createElement("div");
        item.id = id;
        for(var lab of this.labels) item.appendChild(
            doc.createElement("panel-item")
        ).append(lab);
        
        item.onclick = this.click;
        doc.ownerGlobal.addEventListener("unload", iconizer);
        return iconizer.item = item;
    },
    get labels() {
        delete this.labels;
        this.click = this.click.bind(this);
        if (id in g) return this.labels = (iconizer = g[id]).labs;

        g[id] = iconizer;
        var css = "", ind = 0, arr = [];
        var push = (ind, icon) => {
            var chromeImg = `chrome://custombuttons/content/${id + ind}`;
            arr.push(["override", chromeImg, icon]);
            return chromeImg;
        }
        var labs = iconizer.labs = Object.keys(this).filter(key => {
            var res = String(this[key]).startsWith('"');
            if (!res) return false;
            ind++;
            var icon = this[key + "_i"];
            if (icon) css += `\n\t#${
                id
            } > panel-item:nth-child(${ind}) {\n\t\t--icon: url(${
                push(ind, icon)
            }) !important;\n\t}`;
            return true;
        });
        var ams = Cc["@mozilla.org/addons/addon-manager-startup;1"].getService(Ci.amIAddonManagerStartup);
        var mUri = Services.io.getProtocolHandler("resource").getSubstitution("custombuttons-modules");
        iconizer.iconHelper = ams.registerChrome(mUri, arr);

        var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
        var md = "@-moz-document url(chrome://mozapps/content/extensions/aboutaddons.html) {";
        var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent(md + css + "\n}"));
        var args = [uri, sss.USER_SHEET];
        sss.loadAndRegisterSheet(...args);

        iconizer.handleEvent = function() {
            if (!this.item) return;
            this.item.ownerGlobal.removeEventListener("unload", this);
            this.item.remove();
            this.item = null;
        }
        iconizer.destroy = function() {
            delete g[id];
            this.handleEvent();
            sss.unregisterSheet(...args);
            this.iconHelper.destruct();
        }
        return this.labels = labs;
    },
    revealPath: function(path){
            var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
            file.initWithPath(path);
            if(file.exists())
                file.reveal();
        }
}, true, gBrowser.tabpanels || 1))("CBAddonsMenuExt", Cu.import("resource://gre/modules/Services.jsm", {}), {});


//Дополнительные кнопки на странице about:addons для аддонов, плагинов, тем, CB.....................................................................................

((cn, flag, css) => addEventListener("update", ({
    btnActions: ["preferences", "toggle-disabled", "remove", "install-update"],
    every(reason) {
        reason || addDestructor(this.every, this);
        var g = this.g || (this.g = Cu.import(
            "resource://gre/modules/AddonManager.jsm", {}
        ));
        var has = flag in g;
        if (reason) {
            if (!has || reason[5] != "e") return;
        } else if (has) return this;

        var method, wins = Array.from(
            g.AddonManagerInternal.addonListeners, Cu.getGlobalForObject
        ).filter(
            w => w.docShell && w.docShell.name == "html-view-browser"
        );
        if (reason) method = "destroyDoc", delete g[flag];
        else method = "initDoc", g[flag] = true;
        for(var win of new Set(wins)) this[method](win.document);
        return this;
    },
    initDoc(doc, onlyStyle) {
        if (doc[flag]) return; doc[flag] = true;
        doc.ownerGlobal.windowUtils.loadSheetUsingURIString(this.url, this.type);
        if (onlyStyle) return;
        for(var card of doc.getElementsByTagName("addon-card")) this.onCard(card);
    },
    destroyDoc(doc) {
        if (!doc[flag]) return; delete doc[flag];
        for(var span of Array.from(doc.getElementsByClassName(cn))) span.remove();
        doc.ownerGlobal.windowUtils.removeSheetUsingURIString(this.url, this.type);
    },
    get url() {
        this.type = windowUtils.USER_SHEET;
        this.btnActions = this.btnActions.map(
            action => `panel-list > panel-item[action="${action}"]`
        );
        delete this.url;
        return this.url = "data:text/css;charset=utf-8," +
            encodeURIComponent(css.replace(/;/g, " !important;"));
    },
    handleEvent(e) {
        var card = e.target;
        card.nodeName == "ADDON-CARD" && this.onCard(card);
    },
    onCard(card, again) {
        var div = card.querySelector("div.more-options-menu");
        if (!div) return again || card.ownerGlobal.requestAnimationFrame(
            () => this.onCard(card, true)
        );
        var [span] = card.getElementsByClassName(cn);
        if (span) span.textContent = "";
        else {
            var doc = card.ownerDocument;
            doc[flag] || this.initDoc(doc, true);
            div.before(span = doc.createElement("span"));
            span.className = cn;
            span.onclick = this.onclick;
        }
        var btns = this.btnActions.map(sel => {
            var item = div.querySelector(sel);
            return item && item.cloneNode(true);
        });
        var {addon} = card, cbbtn = addon.type == "custombuttons";
        for(var item of btns) if (item) {
            span.append(item);
            item.shadowRoot.querySelector("button").classList.add("cb-cloned-button");
            if (cbbtn) item.closest = this.closest;
        }
        if (addon.id != "custombuttons@xsms.org") return;
        var item = span.querySelector("[action=preferences]");
        if (item) item.removeAttribute("hidden"), item.onclick = this.cbprefs;
    },
    onclick(e) {
        InspectorUtils.removeContentState(e.target, 4, true);
        Services.focus.clearFocus(e.target.ownerGlobal);
    },
    closest(sel) {
        return sel == ".more-options-menu" || this.ownerGlobal
            .Element.prototype.closest.call(this, sel);
    },
    cbprefs(e) {
        var url = "chrome://custombuttons/content/prefs.xul";
        for(var win of Services.wm.getEnumerator(null))
            if (!win.closed && win.document.documentURI == url)
                return win.focus();
        e.view.requestAnimationFrame(() => openDialog(
            url, "", "chrome,titlebar,toolbar,centerscreen,modal"
        ));
    }
}).every(), true))("cb-cloned-buttons-container", "AAcbButtonizedFlag", `

    addon-card:not([expanded]) .card-contents {
        width: 1px;
    }
    span.cb-cloned-buttons-container {
        display: flex;
    }
    button.cb-cloned-button {
        width: auto;
        padding: 1px 6px 3px 6px;
        margin: 0 1px;
        background-image: none;
//background: #CCFFFF ;
  border: 1px solid var(--in-content-box-border-color); 

//border-style: solid;  
//border-color: #99FFFF #99FFFF;
        border-radius: 0px;

        font-size: 13px;
        font-family: Segoe UI;
    }
button.cb-cloned-button:hover {
background: gold ;
}
    button.cb-cloned-button:after {
        display: none;
    }
`);

Отсутствует

 

№1536126-03-2021 10:56:19

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

Re: Custom Buttons

DenisRodman пишет

Вот этот код прошу подправить

Интересно, откуда уверенность, что его вообще можно подправить.
И копаться там радости мало. Ладно, подпаял кой-что, вроде завелась.

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

Выделить код

Код:

custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EQuick%20toggle%20for%20about%3Aconfig%20preferences%20%5BFix%21%5D%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB6klEQVQ4jZWTv2tUQRDHv8ntd28GLLQQfwS5VkuDSgRF/wlRiIiCQQQhhZ1VII1/wDUWkkLTBAsbC0FJYZGQ3NuZRcHYW6UQEQzoeXkW791xXh5CptodZr8z85kd4BBWRJwDgB5wyoCjh3mLbfK8C/ddW11XJlduNgYaeTFpvJWA0+P+BBx3Cf2sLEy5m4WrS8A0AGANaBUSrgKAKzdcY5k0PF4HJGm47NK6nSUMXOIXAEgSrrnG0oU/AGDKNb6qHe9c+Ms1lqbxqws/uoTfWVp3ksRll/DTJM6bcMWEn1KbDysBCW+zsnSNpWssTbg3PNf3uw7MuHDgym8uoW8aX496SxKXs7J0iTsFObcGRBfey8rShP1EXthSnDHhShJ0vM0H1uYiAKBSHWZqLYyDc+H7sSpeNlMX9l1jWWebEAgjgSxcbRRYB46YhCcVxH9bqDP3nbyUBB0XPk+Cjgnvj1qoqohvJqDtTUBdcGAmSzgIEQBM2R0fY/U41GPkwNpcTBKfmnDPNN4w4TOX+NnbfAQAWAKmXcMVAMgaNqrM1UfqkbMmrXkT/nGJO1XF4Xod8/0Ak4KcKzTe3AROjPs/AMdM2M8atk25a8IXAKYawTZZj5jNEvZN2TVldg3Ny/RfkYizALAFnByu819tzvCRWXKqTwAAAABJRU5ErkJggg%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20%u0411%u044B%u0441%u0442%u0440%u043E%u0435%20%u043F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%20about%3Aconfig%20%u043E%u0442%2024.07.2016%0Athis._handleClick%3D%28%29%3D%3EmenuPopup.openPopup%28this%2C%22after_start%22%29%3Bvar%20menuPopup%3Dself.appendChild%28document.createXULElement%28%22menupopup%22%29%29%3BmenuPopup.id%3D%27quick-aboutconfig-menupopup%27%3B%0A//%20%u0418%u0437%u043C%u0435%u043D%u0438%u0442%u044C%20%u0438%u043A%u043E%u043D%u043A%u0443%20%u043F%u0440%u0438%20%u043D%u0435%u0441%u043E%u043E%u0442%u0432%u0435%u0442%u0441%u0442%u0432%u0438%u0435%20%u043B%u044E%u0431%u043E%u0433%u043E%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430%20%u043F%u043E%u043B%u044C%u0437%u043E%u0432%u0430%u0442%u0435%u043B%u044C%u0441%u043A%u043E%u043C%u0443%20%u043F%u0440%u0435%u0434%u043F%u043E%u0447%u0442%u0435%u043D%u0438%u044E%20%28%u0441%u043C.%u043D%u0438%u0436%u0435%29%7C%7C%u0418%u043A%u043E%u043D%u043A%u0430%20%u043C%u0435%u043D%u044F%u0435%u0442%u0441%u044F%20%u0442%u043E%u043B%u044C%u043A%u043E%20%u043F%u0440%u0438%20%u0438%u0437%u043C%u0435%u043D%u0435%u0438%u0438%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%20%u0447%u0435%u0440%u0435%u0437%20%u043C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%2C%20%u043B%u0438%u0431%u043E%20%u043F%u043E%u0441%u043B%u0435%20%u0435%u0433%u043E%20%u043E%u0442%u043A%u0440%u044B%u0442%u0438%u044F.%0A%20%20var%20s%3D%27CB.hasNotUserChoice%27%3Bfunction%20toggleImage%28%29%7Bvar%20val%3Dcustombuttons.getPrefs%28s%29%3Bself.image%3Dval%0A//var%20s%3D%27CB.hasNotUserChoice%27%3Bfunction%20toggleImage%28%29%7Bcustombuttons.getPrefs%28s%29%3F%20%20%20%20%20%20%20%20self.style.cssText%3D%27%27%3Aself.style.cssText%3D%27filter%3Agrayscale%28100%25%29%27%3B%7D%3B%0A%3F%20%27data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB6klEQVQ4jZWTv2tUQRDHv8ntd28GLLQQfwS5VkuDSgRF/wlRiIiCQQQhhZ1VII1/wDUWkkLTBAsbC0FJYZGQ3NuZRcHYW6UQEQzoeXkW791xXh5CptodZr8z85kd4BBWRJwDgB5wyoCjh3mLbfK8C/ddW11XJlduNgYaeTFpvJWA0+P+BBx3Cf2sLEy5m4WrS8A0AGANaBUSrgKAKzdcY5k0PF4HJGm47NK6nSUMXOIXAEgSrrnG0oU/AGDKNb6qHe9c+Ms1lqbxqws/uoTfWVp3ksRll/DTJM6bcMWEn1KbDysBCW+zsnSNpWssTbg3PNf3uw7MuHDgym8uoW8aX496SxKXs7J0iTsFObcGRBfey8rShP1EXthSnDHhShJ0vM0H1uYiAKBSHWZqLYyDc+H7sSpeNlMX9l1jWWebEAgjgSxcbRRYB46YhCcVxH9bqDP3nbyUBB0XPk+Cjgnvj1qoqohvJqDtTUBdcGAmSzgIEQBM2R0fY/U41GPkwNpcTBKfmnDPNN4w4TOX+NnbfAQAWAKmXcMVAMgaNqrM1UfqkbMmrXkT/nGJO1XF4Xod8/0Ak4KcKzTe3AROjPs/AMdM2M8atk25a8IXAKYawTZZj5jNEvZN2TVldg3Ny/RfkYizALAFnByu819tzvCRWXKqTwAAAABJRU5ErkJggg%3D%3D%27%0A%3A%20%27data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAACXBIWXMAAABnAAAAZwHVKNQmAAADGGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjaY2BgnuDo4uTKJMDAUFBUUuQe5BgZERmlwH6egY2BmYGBgYGBITG5uMAxIMCHgYGBIS8/L5UBA3y7xsDIwMDAcFnX0cXJlYE0wJpcUFTCwMBwgIGBwSgltTiZgYHhCwMDQ3p5SUEJAwNjDAMDg0hSdkEJAwNjAQMDg0h2SJAzAwNjCwMDE09JakUJAwMDg3N+QWVRZnpGiYKhpaWlgmNKflKqQnBlcUlqbrGCZ15yflFBflFiSWoKAwMD1A4GBgYGXpf8EgX3xMw8BUMDVQYqg4jIKAX08EGIIUByaVEZhMXIwMDAoM2Qw7CDkY8xi/EskynTYmYR5i4WFpZGVibWNjYetmnsyuybOVw5bnIWcHFyLeV24n7E08KrwXuOr4xfnv+0QIWguuANoS5hO+EvIqtFU8TkxW6Jz5AIlxSXvCE1RzpBRk3mrexWuXp5LwUxhSeKm5SalENU1FR+qp5TW6JerRGsqaPFpvVIe5/ObN0qvSh9KwMZg3+Gj4yOG68xmWxaZZZs7mNhbqlkxWf12/qlzQ3bE3Y77Vc7zHWc6NTqXOVS4JruFuce7hHg6eXl6u3oY+dr7WfpbxFgEWgRZBlsHWIX6hTmFu4dERgZHhUfnR5TEFsZ1xzflzArcVnS5uSDKedT76W9S/+XKZClmG2S454bnZef31owq3Bj0YniByU/ygTLtStcKxOqaqpn1GytvVT3oYG/Ua/Jrzm/ZULrprYr7d87pbvsu5N7OnvX9V3t/zNRZZLP5JIp86aemPZphuxMz1mlsxfOOT/3z3ztBVELOxftXPxqqfQyn+V1KzaufLJaYo3P2sZ129a/2ai0KXLzxC0ntjFut9pRvHPtrhd7lPbG7Zu1/9pB4UOBh/uPnD3Gc9z7RPfJM6d5zvidnXDu0gXRixGX5lx+cFXlWtb19Te+3rK53Xzn1D2h+9EPljx8+9j8SePTM8/FXyS9XPfq9xuPt1PfPf5g+LHh0/kv8l/zv+3/IfAz6deWP2x/I/6t/v8fAATCIM0IpJTRAAAAIGNIUk0AAHolAACAgwAA+f8AAIDoAABSCAABFVgAADqXAAAXb9daH5AAAAEOSURBVHjabJGtS0MBFMXPJojBMMPwC1nV6FCZoGj/ZVGYiIJDBOEFm3XFP2DFIAu6ZrAYBM0OREEUnN20ICI40OfbsTzYB48b7oF74J4PWUnDjMU4GSv5PEubCo/UuwjMs8FEjLOEPNCkRloWAyxb3GEOGWKRTSLeLFYwXyLFBeaGH8w7z/yyRZlvilR5YV+kuMYY04r3NpNEfBByaYksZUyDAoPsYELmmKJKjj0CS0QYU4rl3WLMeceRCBMItW7CMEd9LxbIcUqOXQJLFld9Iks9Ii0qPTYjAo5pscYJrxzIIs1SV1B5ivzRsFjFfHaiLrDOaIxHCLmnyRmp5LLytKnw1FNWH2XaYoyM9T8AOvnw3YUOg90AAAAASUVORK5CYII%3D%27%3B%7D%3B%0AtoggleImage%28%29%3BServices.prefs.addObserver%28s%2CtoggleImage%2Cfalse%29%3BaddDestructor%28%28%29%3D%3EServices.prefs.removeObserver%28s%2CtoggleImage%29%29%3B%0A%0A//%20nodeName%3A%20menuitem%20-%20%u0434%u043B%u044F%20%u043B%u043E%u0433%u0438%u0447%u0435%u0441%u043A%u0438%u0445%28boolean%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%2C%20menu%20-%20%u0434%u043B%u044F%20%u0446%u0435%u043B%u044B%u0445%28integer%29%20%u0438%20%u0441%u0442%u0440%u043E%u043A%u043E%u0432%u044B%u0445%28string%29.%20menuseparator%20-%20%u0434%u043B%u044F%20%u0440%u0430%u0437%u0434%u0435%u043B%u0438%u0442%u0435%u043B%u044F.%0A//%20pref%20-%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%20about%3Aconfig.%0A//%20%u041F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u044B%20%u0438%u043C%u0435%u044E%u0449%u0438%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F%20%u043E%u0442%u043B%u0438%u0447%u043D%u044B%u0435%20%u043E%u0442%20%u0434%u0435%u0444%u043E%u043B%u0442%u043D%u044B%u0445%20-%20%u0432%u044B%u0434%u0435%u043B%u0435%u043D%u044B%20%u0436%u0438%u0440%u043D%u044B%u043C%20%u0441%u0442%u0438%u043B%u0435%u043C%20%u0442%u0435%u043A%u0441%u0442%u0430.%0A//%20restart%20%28%u0437%u0430%u0434%u0430%u0432%u0430%u0442%u044C%20%u0441%20%u043F%u0443%u0441%u0442%u044B%u043C%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%u043C.%20%u0442.%u0435.%2C%20restart%3A%20%22%22%29%20-%20%u0434%u043E%u0431%u0430%u0432%u043B%u044F%u0435%u0442%20%u0432%u043E%u0437%u043C%u043E%u0436%u043D%u043E%u0441%u0442%u044C%20%u043F%u0435%u0440%u0435%u0437%u0430%u043F%u0443%u0441%u043A%u0430%20%u0431%u0440%u0430%u0443%u0437%u0435%u0440%u0430%0A//%20%28%u0441%20%u043F%u043E%u0434%u0442%u0432%u0435%u0440%u0436%u0434%u0435%u043D%u0438%u0435%u043C%20%u0432%20%u0434%u0438%u0430%u043B%u043E%u0433%u043E%u0432%u043E%u043C%20%u043E%u043A%u043D%u0435%29%20%u043F%u043E%u0441%u043B%u0435%20%u0438%u0437%u043C%u0435%u043D%u0435%u043D%u0438%u044F%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430.%0A//%20key%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%20accesskey%20-%20%u043A%u043B%u0430%u0432%u0438%u0448%u0438%20%u0434%u043B%u044F%20%u0431%u044B%u0441%u0442%u0440%u043E%u0439%20%u043D%u0430%u0432%u0438%u0433%u0430%u0446%u0438%u0438%20%u043F%u043E%20%u043C%u0435%u043D%u044E.%0A//%20userChoice%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%20%u043F%u0440%u0435%u0434%u043F%u043E%u0447%u0438%u0442%u0430%u0435%u043C%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u0438%20%u0435%u0441%u043B%u0438%20%u0442%u0435%u043A%u0443%u0449%u0435%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u0441%20%u043D%u0438%u043C%20%u043D%u0435%20%u0441%u043E%u0432%u043F%u0430%u0434%u0430%u0435%u0442%2C%20%u043F%u0443%u043D%u043A%u0442%20%u043C%u0435%u043D%u044E/%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%20%u043C%u0435%u043D%u044E%20%u043F%u043E%u043C%u0435%u0447%u0430%u044E%u0442%u0441%u044F%20%u043A%u0440%u0430%u0441%u043D%u044B%u043C%20%u0446%u0432%u0435%u0442%u043E%u043C.%0A//%20%u0422%u0430%u043A%u0436%u0435%20%u043C%u043E%u0436%u043D%u043E%20%u0443%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u0440%u0435%u0434%u0443%u043F%u0440%u0435%u0436%u0434%u0430%u044E%u0449%u0443%u044E%20%u0438%u043A%u043E%u043D%u043A%u0443%20%u0434%u043B%u044F%20%u0442%u0430%u043A%u0438%u0445%20%u043F%u0443%u043D%u043A%u0442%u043E%u0432.%20%u0421%u043C.%20%u0441%u0442%u0438%u043B%u044C%20%u0432%20%u043F%u043E%u0441%u0442%u0435%20%u043A%u043A%u043D%u043E%u043F%u043A%u0438.%0A//%20%u0410%20%u0442%u0430%u043A%u0436%u0435%20%u043C%u0435%u043D%u044F%u0435%u0442%u0441%u044F%20%u0438%u043A%u043E%u043D%u043A%u0430%20%u0441%u0430%u043C%u043E%u0439%20%u043A%u043D%u043E%u043F%u043A%u0438%20%28%u0441%u043C.%20%u0432%u044B%u0448%u0435%29.%0A//%20strValues%20-%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F%20%u0438%20%u043E%u0442%u043E%u0431%u0440%u0430%u0436%u0430%u0435%u043C%u043E%u0435%20%u0432%20%u043C%u0435%u043D%u044E%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F.%20%u0417%u0430%u0434%u0430%u0432%u0430%u0442%u044C%20%u0434%u043B%u044F%20%u0446%u0435%u043B%u044B%u0445%28integer%29%20%u0438%20%u0441%u0442%u0440%u043E%u043A%u043E%u0432%u044B%u0445%28string%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432.%0A//%20%u0417%u0430%u0434%u0430%u0435%u0442%u0441%u044F%20%u0432%20%u0432%u0438%u0434%u0435%3A%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%2C%2C%2C%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%2C%2C%2Caccesskey%7C%7C%7C%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u04352%2C%2C%2C%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u04352%2C%2C%2Caccesskey2%7C%7C%7C%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u04353%2C%2C%2C%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u04353%20%u0438%20%u0442.%u0434.%20%28accesskey%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%u0441%u044F%20%u043E%u043F%u0446%u0438%u043E%u043D%u0430%u043B%u044C%u043D%u043E%29%0A//%20%u041F%u043E%u043B%u043D%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u043E%u0442%u043E%u0431%u0440%u0430%u0436%u0430%u0435%u0442%u0441%u044F%20%u0432%20%u043F%u043E%u0434%u0441%u043A%u0430%u0437%u043A%u0430%u0445%2C%20%u043F%u0440%u0438%20%u043D%u0430%u0432%u0435%u0434%u0435%u043D%u0438%u0438%20%u043D%u0430%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u0435%20%u043F%u043E%u0434%u043C%u0435%u043D%u044E/%u043F%u0443%u043D%u043A%u0442%20%u043F%u043E%u0434%u043C%u0435%u043D%u044E.%0A//%20%u0414%u043B%u044F%20%u043B%u043E%u0433%u0438%u0447%u0435%u0441%u043A%u0438%u0445%28boolean%29%20-%20%u043E%u0442%u043E%u0431%u0440%u0430%u0436%u0430%u0435%u0442%u0441%u044F%20%u0441%u0440%u0430%u0437%u0443%20%u043F%u043E%u0441%u043B%u0435%20%u0441%u0430%u043C%u043E%u0433%u043E%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430%20%28%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20true%20-%20%u0442%u0430%u043A%u0436%u0435%20%u0441%u0442%u0430%u0432%u0438%u0442%20%u0433%u0430%u043B%u043E%u0447%u043A%u0443%20%u0434%u043B%u044F%20%u043D%u0435%u0433%u043E%29.%0A//%20%u041B%u041A%u041C%20%u043F%u043E%20%u043F%u0443%u043D%u043A%u0442%u0430%u043C%20%u043C%u0435%u043D%u044E%20-%20%u043F%u0435%u0440%u043A%u043B%u044E%u0447%u0430%u0435%u0442%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u044F%20%u0434%u043B%u044F%20%u043B%u043E%u0433%u0438%u0447%u0435%u0441%u043A%u0438%u0445%28boolean%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%2C%0A//%20%u043B%u044E%u0431%u0430%u044F%20%u043A%u043D%u043E%u043F%u043A%u0430%20%u043F%u043E%20%u043F%u0443%u043D%u043A%u0442%u0430%u043C%20%u0432%20%u0441%u0443%u0431%u043C%u0435%u043D%u044E%20-%20%u0437%u0430%u0434%u0430%u0435%u0442%20%u044D%u0442%u043E%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u0434%u043B%u044F%20%u0446%u0435%u043B%u044B%u0445%28integer%29%20%u0438%20%u0441%u0442%u0440%u043E%u043A%u043E%u0432%u044B%u0445%28string%29%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432.%0A//%20%u041F%u041A%u041C%20%u043F%u043E%20%u043F%u0443%u043D%u043A%u0442%u0430%u043C%20%u043C%u0435%u043D%u044E%20%u0438%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u044E%20%u0441%u0443%u0431%u043C%u0435%u043D%u044E%20-%20%u0441%u0431%u0440%u0430%u0441%u044B%u0432%u0430%u0435%u0442%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430%20%u0432%20%u0434%u0435%u0444%u043E%u043B%u0442%u043D%u043E%u0435.%0A//%20%u041A%u043B%u0430%u0432%u0438%u0430%u0442%u0443%u0440%u0430%3A%20Enter%20-%20%u043F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u0430.%0A//%20%u0421%u043F%u0435%u0446%u043A%u043B%u0430%u0432%u0438%u0448%u0430%20%u0432%u044B%u0437%u043E%u0432%u0430%20%u043A%u043E%u043D%u0442%u0435%u043A%u0441%u0442%u043D%u043E%u0433%u043E%20%u043C%u0435%u043D%u044E%20/%20Shift+Enter%20-%20%u0441%u0431%u0440%u043E%u0441%20%u0432%20%u0434%u0435%u0444%u043E%u043B%u0442%u043D%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435.%0A//%20Alt%20+%20M%20-%20%u043E%u0442%u043A%u0440%u044B%u0442%u044C%20%u043C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438.%20%28%u0421%u043E%u0447%u0435%u0442%u0430%u043D%u0438%u0435%20%u043C%u043E%u0436%u043D%u043E%20%u0441%u043C%u0435%u043D%u0438%u0442%u044C%20%u043D%u0430%20%u0441%u0432%u043E%u0435.%20%u0421%u043C.%20%u0432%20%u043A%u043E%u043D%u0446%u0435%20%u043A%u043E%u0434%u0430%29%0A%5B%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u0434%u0438%u0441%u043A%u043E%u0432%u043E%u0433%u043E%20%u043A%u044D%u0448%u0430%22%2C%20pref%3A%22browser.cache.disk.enable%22%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u043A%u044D%u0448%u0430%20%u0432%20%u043E%u043F%u0435%u0440%u0430%u0442%u0438%u0432%u043D%u043E%u0439%20%u043F%u0430%u043C%u044F%u0442%u0438%22%2C%20pref%3A%22browser.cache.memory.enable%22%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u043B%u043E%u043A%u0430%u043B%u044C%u043D%u043E%u0433%u043E%20%u0445%u0440%u0430%u043D%u0438%u043B%u0438%u0449%u0430%20DB%20%28Storage%29%22%2C%20pref%3A%22dom.indexedDB.enabled%22%2C%20key%3A%27d%27%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u043B%u043E%u043A%u0430%u043B%u044C%u043D%u043E%u0433%u043E%20%u0445%u0440%u0430%u043D%u0438%u043B%u0438%u0449%u0430%22%2C%20pref%3A%22dom.storage.enabled%22%2C%20key%3A%27s%27%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22Back-story-cash%20%5BTessssttt%5D%22%2C%20pref%3A%22browser.sessionhistory.max_total_viewers%22%2C%20strValues%3A%220%2C%2C%2C0%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22image.animation_mode%22%2C%20key%3A%27i%27%2C%20userChoice%3A%22none%22%2C%20strValues%3A%22normal%2C%2C%2C%u0410%u043D%u0438%u043C%u0430%u0446%u0438%u044F%20%u043A%u0430%u0440%u0442%u0438%u043D%u043E%u043A%20%u0432%u043A%u043B.%2C%2C%2C%7C%7C%7Cnone%2C%2C%2C%u0410%u043D%u0438%u043C%u0430%u0446%u0438%u044F%20%u043A%u0430%u0440%u0442%u0438%u043D%u043E%u043A%20%u0432%u044B%u043A%u043B.%2C%2C%2C%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22network.cookie.cookieBehavior%22%2C%20key%3A%27k%27%2C%20userChoice%3A%221%22%2C%20strValues%3A%222%2C%2C%2C%u041D%u0435%20%u043F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%20%u0441%u0430%u0439%u0442%u043E%u0432%2C%2C%2C%7C%7C%7C0%2C%2C%2C%u041F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%u043E%20%u0441%u0442%u043E%u0440%u043E%u043D%u043D%u0438%u0445%20%u0441%u0430%u0439%u0442%u043E%u0432%20%u0432%u0441%u0435%u0433%u0434%u0430%2C%2C%2C%7C%7C%7C3%2C%2C%2C%u041F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%u043E%20%u0441%u0442%u043E%u0440%u043E%u043D%u043D%u0438%u0445%20%u043F%u043E%u0441%u0435%u0449%u0451%u043D%u043D%u044B%u0445%20%u0441%u0430%u0439%u0442%u043E%u0432%2C%2C%2C%7C%7C%7C1%2C%2C%2C%u041F%u0440%u0438%u043D%u0438%u043C%u0430%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0441%u043E%20%u0441%u0442%u043E%u0440%u043E%u043D%u043D%u0438%u0445%20%u0441%u0430%u0439%u0442%u043E%u0432%20%u043D%u0438%u043A%u043E%u0433%u0434%u0430%2C%2C%2C%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22general.useragent.locale%22%2C%20key%3A%27l%27%2C%20restart%3A%22%22%2C%20strValues%3A%22en-US%2C%2C%2CEnglish%2C%2C%2Ce%7C%7C%7Cru%2C%2C%2C%u0420%u0443%u0441%u0441%u043A%u0438%u0439%2C%2C%2Cr%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22language%22%2C%20pref%3A%22intl.accept_languages%22%2C%20strValues%3A%22en-US%2C%20en%3Bq%3D0.5%2C%2C%2Cen-US%2C%20en%3Bq%3D0.5%2C%2C%2Ce%7C%7C%7Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cr%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22browser.display.document_color_use%22%2C%20key%3A%27c%27%2C%20userChoice%3A%220%22%2C%20strValues%3A%220%2C%2C%2CAutomatic%2C%2C%2C0%7C%7C%7C1%2C%2C%2CAlways%2C%2C%2C1%7C%7C%7C2%2C%2C%2CNever%2C%2C%2C2%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20pref%3A%22CB.TEST%22%2C%20key%3A%27t%27%2C%20userChoice%3A%22C%3A%5C%5CDownloads%5C%5CTEST1%22%2C%20strValues%3A%22C%3A%5C%5CDownloads%5C%5CTEST1%2C%2C%2CTEST1%2C%2C%2C1%7C%7C%7CC%3A%5C%5CDownloads%5C%5CTEST2%2C%2C%2CTEST2%2C%2C%2C2%22%7D%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u041E%u0442%u043A%u043B.%20%u0438%u043D%u0444%u0443%20%u043D%u0430%u0447%u0430%u043B%u043E/%u043A%u043E%u043D%u0435%u0446%20%u0437%u0430%u0433%u0440%u0443%u0437%u043A%u0438%20%u0441%u0442%u0440%22%2C%20pref%3A%22dom.enable_performance%22%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22%u0412%u043A%u043B/%u0412%u044B%u043A%u043B%20Referer%22%2C%20pref%3A%22network.http.sendRefererHeader%22%2C%20strValues%3A%220%2C%2C%2C0%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22%u0412%20%u043A%u0430%u0447%u0435%u0441%u0442%u0432%u0435%20%u0440%u0435%u0444%u0435%u0440%u0435%u0440%u0430%20%u043A%u043E%u0440%u0435%u043D%u044C%20%u0441%u0430%u0439%u0442%u0430%22%2C%20pref%3A%22network.http.referer.spoofSource%22%2C%20userChoice%3A%22true%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22referer.trimmingPolicy%22%2C%20pref%3A%22network.http.referer.trimmingPolicy%22%2C%20strValues%3A%222%2C%2C%2C2%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22On/Off%20Image%22%2C%20pref%3A%22permissions.default.image%22%2C%20userChoice%3A1%2C%20strValues%3A%222%2C%2C%2COff%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20Multiprocessing%22%2C%20pref%3A%22browser.tabs.remote.autostart%22%2C%20restart%3A%22%22%2C%20userChoice%3A%22true%22%7D%2C%20%20%20//about%3Asupport%3DMultiprocess%20Windows%7Cforum.ru-board.com/topic.cgi%3Fforum%3D5%26topic%3D49695%26start%3D0%26limit%3D1%26m%3D9%231%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//opennet.ru/opennews/art.shtml%3Fnum%3D50691%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20javascript%22%2C%20pref%3A%22javascript.enabled%22%2C%20key%3A%27j%27%2C%20userChoice%3A%22true%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22dom.workers.enabled%22%2C%20key%3A%27w%27%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22media.autoplay.enabled%22%2C%20key%3A%27m%27%2C%20userChoice%3A%22false%22%7D%2C%0A%20%20//%7BnodeName%3A%22menu%22%2C%20name%3A%22Stopautoplay%22%2C%20pref%3A%22media.autoplay.default%22%2C%20userChoice%3A0%2C%20strValues%3A%220%2C%2C%2CStop%2C%2C%2C0%7C%7C%7C1%2C%2C%2CPlay%2C%2C%2C1%22%7D%2C%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22xpinstall.signatures.required%22%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//Check%20is%20compatibility%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22browser.bookmarks.autoExportHTML%22%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//BookmarksHtml%20%5Bfalse%3Dplaces.sqlite%5D%0A%20%20//%7BnodeName%3A%22menuitem%22%2C%20pref%3A%22media.peerconnection.enabled%22%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//WebRTC%20false%3Doff%21%0A%0A%0A%20%20%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20useragentS%22%2C%20pref%3A%22general.useragent.site_specific_overrides%22%2C%20userChoice%3A%22true%22%7D%2C%0A%20%20%7BnodeName%3A%22menuitem%22%2C%20name%3A%22On/Off%20media.play-stand-alone%22%2C%20pref%3A%22media.play-stand-alone%22%7D%2C%20%20%20//%u0441%u0440%u0430%u0437%u0443%20%u0441%u043A%u0430%u0447%u0438%u0432%u0430%u0442%u044C%20%u043C%u0435%u0434%u0438%u0430%u0444%u0430%u0439%u043B%u044B%2C%20%u0431%u0435%u0437%20%u043F%u0435%u0440%u0435%u0445%u043E%u0434%u0430%20%u043D%u0430%20%u043D%u043E%u0432%u0443%u044E%20%u0441%u0442%u0440%u0430%u043D%u0438%u0446%u0443.%0A%20%20%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20pref%3A%22general.useragent.locale%22%2C%20key%3A%27l%27%2C%20restart%3A%22%22%2C%20strValues%3A%22en-US%2C%2C%2CEnglish%2C%2C%2Ce%7C%7C%7Cru%2C%2C%2C%u0420%u0443%u0441%u0441%u043A%u0438%u0439%2C%2C%2Cr%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22language%22%2C%20pref%3A%22intl.accept_languages%22%2C%20strValues%3A%22en-US%2C%20en%3Bq%3D0.5%2C%2C%2Cen-US%2C%20en%3Bq%3D0.5%2C%2C%2Ce%7C%7C%7Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cen-US%2C%20en%2C%20ru-RU%2C%20ru%2C%2C%2Cr%22%7D%2C%0A%20%20%7BnodeName%3A%22menuseparator%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22Configure%20Proxies%22%2C%20pref%3A%22network.proxy.type%22%2C%20userChoice%3A5%2C%20strValues%3A%221%2C%2C%2ChttpP%2C%2C%2C1%7C%7C%7C2%2C%2C%2CAutomaticP%2C%2C%2C2%7C%7C%7C5%2C%2C%2CUse%20systemP%2C%2C%2C5%22%7D%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22AutomaticP%22%2C%20pref%3A%22network.proxy.autoconfig_url%22%2C%20strValues%3A%22file%3A///X%3A/FFQ/_.pac%2C%2C%2Cfile%3A///X%3A/FFQ/_.pac%2C%2C%2C1%7C%7C%7Chttps%3A//antizapret.prostovpn.org/proxy.pac%2C%2C%2Chttps%3A//antizapret.prostovpn.org/proxy.pac%2C%2C%2C2%22%7D%2C%0A%20%20%7BnodeName%3A%22menuseparator%22%7D%2C%20%0A%20%20%0A%20%20//userChoice%3A%22Mozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010.13%3B%20rv%3A57.0%29%20Gecko/20100101%20Firefox/99.0%22%2C%0A%20%20%7BnodeName%3A%22menu%22%2C%20name%3A%22User%20Agent%22%2C%20pref%3A%22general.useragent.override%22%2C%20key%3A%27u%27%2C%20strValues%3A%22Mozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010.13%3B%20rv%3A60.0%29%20Gecko/20100101%20Firefox/60.0%2C%2C%2CFirefox%2060/MacOSX%2010.13%7C%7C%7CMozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_13_5%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/66.0.3359.181%20Safari/537.36%2C%2C%2CChrome%2066/MacOSX%2010.13.5%7C%7C%7CMozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_11_6%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/57.0.2987.133%20Safari/537.36%2C%2C%2CChrome%2057/MacOSX%7C%7C%7CMozilla/5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_12_4%29%20AppleWebKit/603.1.30%20%28KHTML%2C%20like%20Gecko%29%20Version/10.1%20Safari/603.1.30%2C%2C%2CSafari%20Generic/MacOSX%7C%7C%7CMozilla/5.0%20%28Windows%20NT%206.1%3B%20WOW64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/57.0.2987.133%20Safari/537.36%2C%2C%2CChrome57/W7%7C%7C%7COpera/9.80%20%28Windows%20NT%206.2%3B%20Win64%3B%20x64%29%20Presto/2.12%20Version/12.16%2C%2C%2COpera12/W8%7C%7C%7CMozilla/5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/61.0.3163.98%20Safari/537.36%2C%2C%2CChrome61/W10%7C%7C%7CMozilla/5.0%20%28Linux%3B%20Android%207.0%3B%20PLUS%20Build/NRD90M%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/61.0.3163.98%20Mobile%20Safari/537.36%2C%2C%2CChrome61/Android7%7C%7C%7CMozilla/5.0%20%28compatible%3B%20Googlebot/2.1%3B%20+http%3A//www.google.com/bot.html%29%2C%2C%2CGoogleBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20YandexBot/3.0%3B%20+http%3A//yandex.com/bots%29%2C%2C%2CYandexBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20Yahoo%21%20Slurp%3B%20http%3A//help.yahoo.com/help/us/ysearch/slurp%29%2C%2C%2CYahooBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20bingbot/2.0%3B%20+http%3A//www.bing.com/bingbot.htm%29%2C%2C%2CBingBot%7C%7C%7CDuckDuck%20bot/1.0%3B%20%28+http%3A//duckduckgo.com/duckduckbot.html%29%2C%2C%2CDuckDuckBot%7C%7C%7CMozilla/5.0%20%28compatible%3B%20Baiduspider/2.0%3B%20+http%3A//www.baidu.com/search/spider.html%29%2C%2C%2CBaiduspiderBot%7C%7C%7Cia_archiver%20%28+http%3A//www.alexa.com/site/help/webmasters%3B%20crawler@alexa.com%29%2C%2C%2CAlexaCrawlerBot%7C%7C%7CMozilla/5.0%20%28Linux%3B%20Android%205.1.1%3B%20SM-G928X%20Build/LMY47X%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/47.0.2526.83%20Mobile%20Safari/537.36%2C%2C%2CSamsung%20Galaxy%20S6%20Edge%20Plus%7C%7C%7CMozilla/5.0%20%28Windows%20Phone%2010.0%3B%20Android%204.2.1%3B%20Microsoft%3B%20Lumia%20950%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/46.0.2486.0%20Mobile%20Safari/537.36%20Edge/13.10586%2C%2C%2CMicrosoft%20Lumia%20950%7C%7C%7CMozilla/5.0%20%28Windows%20Phone%2010.0%3B%20Android%204.2.1%3B%20Xbox%3B%20Xbox%20One%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/46.0.2486.0%20Mobile%20Safari/537.36%20Edge/13.10586%2C%2C%2CXbox%20One%7C%7C%7CMozilla/5.0%20%28PlayStation%204%203.11%29%20AppleWebKit/537.73%20%28KHTML%2C%20like%20Gecko%29%2C%2C%2CPlaystation%204%7C%7C%7C%2C%2C%2C%u041F%u0443%u0441%u0442%u043E%u0435%20%u0437%u043D%u0430%u0447%u0435%u043D%u0438%u0435%22%7D%2C%0A%5D.forEach%28function%28m%29%7Bvar%20mItem%3Ddocument.createXULElement%28m.nodeName%29%3Bvar%20browserRestart%3D%27%27%3B%0Aif%20%28%22restart%22%20in%20m%29%20browserRestart%3D%27%20if%20%28custombuttons.confirmBox%28null%2C%20%22Restart%3F%22%2C%20%22Yes%22%2C%20%22Cancel%22%29%29%20Services.startup.quit%28Services.startup.eAttemptQuit%20%7C%20Services.startup.eRestart%29%3B%27%3B%0Aif%20%28%22name%22%20in%20m%29%20mItem.setAttribute%28%27name%27%2Cm.name%29%3Bif%20%28%22pref%22%20in%20m%29%20%7BmItem.setAttribute%28%27closemenu%27%2C%27none%27%29%3B%0AmItem.setAttribute%28%27oncontextmenu%27%2C%27event.preventDefault%28%29%3Bcustombuttons.clearPrefs%28%22%27+m.pref+%27%22%29%3B%27+browserRestart%29%3B%7D%0Aif%20%28%22key%22%20in%20m%29%20mItem.setAttribute%28%27accesskey%27%2C%20m.key%29%3Bif%20%28m.nodeName%3D%3D%3D%22menuitem%22%29%20%7BmItem.setAttribute%28%27type%27%2C%27checkbox%27%29%3B%0AmItem.setAttribute%28%27oncommand%27%2C%27custombuttons.setPrefs%28%22%27+m.pref+%27%22%2C%21custombuttons.getPrefs%28%22%27+m.pref+%27%22%29%29%3Bif%20%28event.shiftKey%20%26%26%20event.keyCode%3D%3Devent.DOM_VK_RETURN%29%7Bevent.preventDefault%28%29%3Bcustombuttons.clearPrefs%28%22%27+m.pref+%27%22%29%7D%3B%27+browserRestart%29%3B%7D%0Aif%20%28m.nodeName%3D%3D%3D%22menu%22%29%7BmItem.setAttribute%28%27class%27%2C%27menu-iconic%27%29%3B%0A%0Avar%20subMenu%3DmItem.appendChild%28document.createXULElement%28%22menupopup%22%29%29%3B%0A%0Afor%20%28var%20value%20of%20m.strValues.split%28%27%7C%7C%7C%27%29%29%7Bvar%20submItem%3Ddocument.createXULElement%28%22menuitem%22%29%3Bvar%20smVal%3Dvalue.split%28%27%2C%2C%2C%27%29%5B0%5D%3B%0Avar%20smValConv%3DconvertFromUnicode%28%22UTF-8%22%2CsmVal%29%3Bvar%20smName%3Dvalue.split%28%27%2C%2C%2C%27%29%5B1%5D%3Bvar%20key%3Dvalue.split%28%27%2C%2C%2C%27%29%5B2%5D%3B%0A%0Akey%20%26%26%20submItem.setAttribute%28%27accesskey%27%2Ckey%29%3BsubmItem.setAttribute%28%27type%27%2C%27radio%27%29%3BsubmItem.setAttribute%28%27label%27%2CsmName%29%3BsubmItem.setAttribute%28%27tooltiptext%27%2CsmVal%29%3BsubmItem.setAttribute%28%27closemenu%27%2C%27none%27%29%3B%0AsubmItem.setAttribute%28%27oncommand%27%2C%27try%7Bcustombuttons.setPrefs%28%22%27+m.pref+%27%22%2C%22%27+smValConv.replace%28/%5C%5C/g%2C%27%5C%5C%5C%5C%27%29+%27%22%29%7Dcatch%28e%29%7BServices.prefs.setIntPref%28%22%27+m.pref+%27%22%2C%22%27+smValConv+%27%22%29%7D%3B%27+browserRestart%29%3B%0AsubMenu.appendChild%28submItem%29%3B%7D%7D%0A%0AmenuPopup.appendChild%28mItem%29%3B%0A%0A%20%20//%20%u041B%u0438%u0441%u0442%u0435%u043D%u0435%u0440%u044B%20%u043E%u0442%u0441%u043B%u0435%u0436%u0438%u0432%u0430%u044E%u0449%u0438%u0435%20%u043F%u0435%u0440%u0435%u043A%u043B%u044E%u0447%u0435%u043D%u0438%u0435%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%0A%20%20//%20%u0438%20%u0443%u0441%u0442%u0430%u043D%u0430%u0432%u043B%u0438%u0432%u0430%u044E%u0449%u0438%u0435%20%u0441%u043E%u043E%u0442%u0432%u0435%u0442%u0441%u0442%u0432%u0443%u044E%u0449%u0438%u0435%20%u043D%u0430%u0437%u0432%u0430%u043D%u0438%u044F%20%u0438%20%u0447%u0435%u043A%u0431%u043E%u043A%u0441%u044B%20%u0434%u043B%u044F%20%u043F%u0443%u043D%u043A%u0442%u043E%u0432%20%u043C%u0435%u043D%u044E%20%u043F%u0440%u0438%20%u043E%u0442%u043A%u0440%u044B%u0442%u0438%u0438%20%u043C%u0435%u043D%u044E%20%u0438%20%u043A%u043B%u0438%u043A%u0430%u0445%0A%20%20for%20%28var%20type%20of%20%5B%27command%27%2C%27popupshowing%27%2C%27contextmenu%27%5D%29%7BaddEventListener%28type%2C%28e%29%3D%3E%7BsetTimeout%28%28%29%3D%3E%7Bif%20%28%22pref%22%20in%20m%29%7Bvar%20val%2Cdef%3B%0A%20%20%20def%3DServices.prefs.prefHasUserValue%28m.pref%29%3B%0A%0A%20%20%20switch%28Services.prefs.getPrefType%28m.pref%29%29%20%7B%0A%20%20%20%20%20%20case%20Services.prefs.PREF_INT%3A%20val%20%3D%20Services.prefs.getIntPref%28m.pref%29%3B%20break%3B%0A%20%20%20%20%20%20case%20Services.prefs.PREF_BOOL%3A%20val%20%3D%20Services.prefs.getBoolPref%28m.pref%29%3B%20break%3B%0A%20%20%20%20%20%20case%20Services.prefs.PREF_STRING%3A%20val%20%3D%20Services.prefs.getStringPref%28m.pref%29%20%7C%7C%20%22%3Cempty_string%3E%22%3B%0A%20%20%20%7D%0A%20%20%20def%20%3F%20mItem.style.setProperty%28%27font-weight%27%2C%20%27bold%27%2C%20%27important%27%29%20%3A%20mItem.style.removeProperty%28%27font-weight%27%29%3B%7D%0A%0A%20%20%20%20%20if%20%28m.nodeName%3D%3D%3D%27menuitem%27%29%7BmItem.setAttribute%28%27checked%27%2Cval%29%3BmItem.label%3D%28mItem.hasAttribute%28%27name%27%29%20%3F%20mItem.getAttribute%28%27name%27%29%20%3A%20m.pref%29+%27%20-%20%22%27+val+%27%22%27%3B%0A%20%20%20%20%20if%20%28%22userChoice%22%20in%20m%29%7Btry%20%7Bvar%20usrChc%3D%28val.toString%28%29%3D%3D%3Dm.userChoice%29%7D%20catch%28e%29%20%7BusrChc%3Dfalse%7D%3B%0A%0A%20%20%20%20%20mItem.setAttribute%28%27user-choice%27%2CusrChc%29%3BusrChc%20%3F%20mItem.style.removeProperty%28%27color%27%29%20%3A%20mItem.style.setProperty%28%27color%27%2C%27orangered%27%2C%27important%27%29%3B%7D%7D%0A%20%20%20%20%20if%20%28subMenu%29%7Bfor%20%28var%20smitem%20of%20subMenu.getElementsByTagName%28%27menuitem%27%29%29%20%7Bvar%20smval%3Dsmitem.getAttribute%28%27tooltiptext%27%29%3Bsmitem.setAttribute%28%27checked%27%2C%28val%3D%3D%3Dsmval%29%20%3F%20true%20%3A%20false%29%3B%7D%7D%0A%20%20%20%20%20if%20%28m.nodeName%3D%3D%3D%22menu%22%29%20%7Bvar%20vname%3B%0A%20%20%20%20%20try%20%7Bvname%3DsubMenu.getElementsByAttribute%28%27checked%27%2C%27true%27%29%5B0%5D.getAttribute%28%27label%27%29%3B%7D%20catch%28e%29%20%7Bif%20%28%21Services.prefs.prefHasUserValue%28m.pref%29%29%20vname%3D%27Default%27%3Belse%20vname%3D%27Other%27%3B%7D%0A%0A%20%20%20%20%20mItem.setAttribute%28%27label%27%2C%28mItem.hasAttribute%28%27name%27%29%20%3F%20mItem.getAttribute%28%27name%27%29%20%3A%20m.pref%29+%27%20-%20%22%27+vname+%27%22%27%29%3B%0A%20%20%20%20%20mItem.setAttribute%28%27tooltiptext%27%2Cval%20%3D%3D%3D%20undefined%20%3F%20%27This%20preference%20does%20not%20exist.%27%20%3A%20val%29%3B%0A%0A%20%20%20%20%20if%20%28%22userChoice%22%20in%20m%29%20%7Bvar%20smUsrChc%3D%28val%3D%3D%3Dm.userChoice.toString%28%29%29%3BmItem.setAttribute%28%27user-choice%27%2CsmUsrChc%29%3B%0A%20%20%20%20%20smUsrChc%20%3F%20mItem.style.removeProperty%28%27color%27%29%20%3A%20mItem.style.setProperty%28%27color%27%2C%27orangered%27%2C%27important%27%29%3B%7D%7D%0A%0A%20%20%20%20%20if%20%28%22userChoice%22%20in%20m%29%20%7Bvar%20hasNotUserChoice%3DmenuPopup.getElementsByAttribute%28%27user-choice%27%2C%27false%27%29%5B0%5D%3Bcustombuttons.setPrefs%28s%2ChasNotUserChoice%20%3F%20true%20%3A%20false%29%3B%7D%7D%2C%200%29%7D%2Cfalse%2CmenuPopup%29%7D%7D%29%3B%0A%0A//%20%u041B%u0438%u0441%u0442%u0435%u043D%u0435%u0440%20%u043F%u043E%u0437%u0432%u043E%u043B%u044F%u044E%u0449%u0438%u0439%20%u0441%u0431%u0440%u043E%u0441%20%u043F%u0430%u0440%u0430%u043C%u0435%u0442%u0440%u043E%u0432%20%u0441%20%u0441%u0443%u0431%u043C%u0435%u043D%u044E%20%u043F%u043E%20Shift%20+%20Enter%7C%7C%u0417%u0430%20%u043A%u043E%u0434%20%u0441%u043F%u0430%u0441%u0438%u0431%u043E%20Dumby%0AaddEventListener%28%22popupshown%22%2C%7BhandleEvent%3A%20function%28e%29%7Bthis%5Be.type%5D%28e%29%3B%7D%2C%0Apopupshown%3A%20function%28e%29%20%7Bif%20%28e.target%21%3DmenuPopup%29%20return%3BmenuPopup.addEventListener%28%22popuphidden%22%2C%20this%2C%20false%29%3Bwindow.addEventListener%28%22keydown%22%2C%20this%2C%20true%29%3B%7D%2C%0Apopuphidden%3A%20function%28e%29%20%7Bif%20%28e.target%21%3DmenuPopup%29%20return%3BmenuPopup.removeEventListener%28%22popuphidden%22%2C%20this%2C%20false%29%3Bwindow.removeEventListener%28%22keydown%22%2C%20this%2C%20true%29%3B%7D%2C%0Apopupshowing%3A%20function%28e%29%20%7Be.target.parentNode.removeEventListener%28%22popupshowing%22%2C%20this%2C%20false%29%3Be.preventDefault%28%29%3B%7D%2Cget%20old%28%29%20%7Bdelete%20this.old%3B%0Athis.e%20%3D%20new%20MouseEvent%28%22contextmenu%22%2C%20%7B%7D%29%3Breturn%20this.old%3DparseInt%28Services.appinfo.platformVersion%29%20%3C%2025%3B%7D%2Cget%20prop%28%29%20%7Bdelete%20this.prop%3B%0Aif%20%28%22key%22%20in%20KeyboardEvent.prototype%29%20this.prop%20%3D%20%22key%22%2C%20this.val%3D%22Enter%22%3Belse%20this.prop%20%3D%20%22keyCode%22%2C%20this.val%3DKeyboardEvent.DOM_VK_RETURN%3Breturn%20this.prop%3B%7D%2C%0Akeydown%3A%20function%28e%29%20%7Bif%20%28%21e.shiftKey%20%7C%7C%20e.ctrlKey%20%7C%7C%20e.altKey%20%7C%7C%20e%5Bthis.prop%5D%20%21%3D%20this.val%29%20return%3Bvar%20target%3DmenuPopup.querySelector%28%22menu%5B_moz-menuactive%5D%3Anot%28%5Bopen%5D%29%22%29%3B%0Aif%20%28%21target%29%20return%3Bthis.old%20%3F%20target.addEventListener%28%22popupshowing%22%2C%20this%2C%20false%29%20%3A%20e.stopPropagation%28%29%3Btarget.dispatchEvent%28this.e%29%3BmenuPopup.dispatchEvent%28this.e%29%3B%7D%7D%2C%20false%2C%20menuPopup%29%3B%0A%0A//%20%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u043C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%20%u043F%u043E%20%u0441%u043E%u0447%u0435%u0442%u0430%u043D%u0438%u044E%20%u043A%u043B%u0430%u0432%u0438%u0448%20Alt%20+%20M%20%28%u043D%u0435%20%u0437%u0430%u0432%u0438%u0441%u0438%u0442%20%u043E%u0442%20%u0442%u0435%u043A%u0443%u0449%u0435%u0439%20%u0440%u0430%u0441%u043A%u043B%u0430%u0434%u043A%u0438%20%u043A%u043B%u0430%u0432%u0438%u0430%u0442%u0443%u0440%u044B%29%0A//%20%u041F%u043E%u0441%u043C%u043E%u0442%u0440%u0435%u0442%u044C%20%u043A%u043E%u0434%u044B%20%u043A%u043B%u0430%u0432%u0438%u0448%20%u043C%u043E%u0436%u043D%u043E%20%u0437%u0434%u0435%u0441%u044C%3A%20https%3A//developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode%23Constants_for_keyCode_value%0AaddEventListener%28%27keyup%27%2C%28e%29%3D%3E%7Bif%20%28e.altKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.ctrlKey%20%26%26%20e.keyCode%3D%3D77%29%7Be.preventDefault%28%29%3Be.stopPropagation%28%29%3B%0AmenuPopup.openPopup%28this%2C%20%22after_start%22%29%3B%7D%7D%2Cfalse%2Cwindow%29%3B%0A//%20%u041A%u043E%u043D%u0432%u0435%u0440%u0442%u0438%u0440%u043E%u0432%u0430%u0442%u044C%20%u0442%u0435%u043A%u0441%u0442%20%u0432%20%u044E%u043D%u0438%u043A%u043E%u0434%20.............%0Afunction%20convertFromUnicode%28charset%2Cstr%29%20%7Bvar%20converter%3DCc%5B%22@mozilla.org/intl/scriptableunicodeconverter%22%5D.createInstance%28Ci.nsIScriptableUnicodeConverter%29%3B%0Aconverter.charset%3Dcharset%3Bstr%3Dconverter.ConvertFromUnicode%28str%29%3Breturn%20str+converter.Finish%28%29%3B%7D%3B%0A%0A%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E

Dobrov пишет

если я добавляю в мою кнопку метод click, то перестаёт работать LongPress

Странно, у меня добавление click такого действия не оказывает.
Но сам LongPress, да, работает криво. Будем считать, что не получилось.


Garalf пишет

Посмотрите, пожалуйста эту кнопку.
Перестала работать в 87

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

Выделить код

Код:

//Дополнительные пункты контекстного меню на странице about:addons для аддонов, плагинов, тем, CB.....................................................................................
((id, g, iconizer) => addDestructor(r => r[5] == "e" && id in g && g[id].destroy()) + addEventListener("shown", {
	//------------------------------------------------------------------
	"Копировать имя_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
	"Копировать имя"(addon, hideOn) {
		if (hideOn) return false;

		gClipboard.write(addon.name);
	},
	//------------------------------------------------------------------
	"Копировать ID_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
	"Копировать ID"(addon, hideOn) {
		if (hideOn) return false;

		gClipboard.write(addon.id);
	},
	//------------------------------------------------------------------
	"Копировать версию_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
	"Копировать версию"(addon, hideOn) {
		if (hideOn) return ["custombuttons"];

		gClipboard.write(addon.version);
	},
	//------------------------------------------------------------------
	"Копировать имя и версию_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
	"Копировать имя и версию"(addon, hideOn) {
		if (hideOn) return ["custombuttons"];

		gClipboard.write(addon.name + " " + addon.version);
	},
	//------------------------------------------------------------------
	"Домашняя страница_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAC4jAAAuIwF4pT92AAAIIklEQVRYR61Xa1CU1xlGUNTpr/7rdNr+sCbt2DrRphPb0VZnWtsYhk5tNWnaaHHaVJsoWgWVNlRbMQoaE6poQATkLpdlWVAzLusqLgioi9xEdkGIIJdd9vLt5dvbd76n7/ncdaxigLbvzDNnYc6e5znP+55z3o2KeibmzZsXNX/+/KhYwvz/M/ja08VXCN8mvEx4KTz+r3gpjG8RvkqYGzVVzJkzJ5qGH+3Zs+diUVGxMTc393Zefr4xn6OgwFgQwfnzxvMRFBY+QWEERUXPfabv3S4vL29PTk7OI475xPW8gOjoaK5sTf3Fi8OgcHs88Pn98AcCCISCCIZCCEkSJMYUMFmGjJlFZN4VrbadOGKJ63kBpCqGhtVl5eV9gsvFHg4Ph0bHxtjY+Dgbn5hgExwWi4Jxi5VZrJPMOslhY1abnVlotNntzM7hcChwhDFpswVJPKuurm6Kms6BiooKs1cUwcktViuIBLSAAiKC2+VEUBTgdTng87rgF10I0N9ykBzzuuEUXHC53HC53XCH4RQECeSYuqbmJhcwpQNPBFRWmkWfD+O08wg57RJOp4OInTAPW1FmeIjTegu2fGpEwulOpNePotzwOR6M2UmIF16vlwR44PESKJUul0viaVCr1dMLqCQBPO/c8gi51+0EWY6shhEk5D7A91Nv4Y1jXViZ2oR1Gb1IrAghIWcMm7O6kasfgUC7Dvp9JECESG6SCxKvAXVt7fQCqqqqzIFgEBbKNbfcQ5YPjFjwx3MD2FLixHf3NmJlih7xaQZsy+7Gscs2nNCKyLwK7C624O3MXhxUj2PU5kIo6CcBPnLEowionakAXvGUf8Ztn7Tb8bdaO9K1AdR1BLEq1YC3jt/Ce9md2F/Sj8o7Iq71yShplXHsCrAzfxDb8kZx5JIAF6UiGAyAakoRoNFoZiCgutockriASRbwOlB0U1B2d80EpF+ZxC/T27DjbCfOUjpO1D9Ck0lEozmEXIOIQxoBf84fQWJeP94vFZGlHSHaEKXCqwioq6ubXkC1IkCC02FjD8YcSLssIbsxgB8evIlXknTYkN6KxNweHK8bwflGJ3pGQ3hoZ7jZ78fZay7sr/JgU5YJKSofXs/oocJ0QgoFZu7AYwEMotvGtD0iDtQz/PhQO6LerMJr+69h47E27Dz3WEChQUD/RAjEgfaHMloHgdIWCX/KNuEDtRcr03qQ2zBE1NIsHFCpzBKTSYCDFRh82K0KYFlKK6LfUmFZ0lWsP9qC93K6cLBiCFVtDrolZQxYGK7eZ8hrkpHZEMTRmkF8og3iB4f6sLvoPl0BjwXU19dPL0BVU2OmO4Oq38HO6EUkVYtIqZ7AkiQ9vrb1EtYdasbvM43kQi/OXHkEhxe4Nwpo7wF5zUBSuYCt2X1IuyhhyT4jtuaaZudADTnAb28uIEvnxbZiAUkVNuwoHsSXNqmxZJcW8YdbsDnzDv6Q1YF/XRrGZx0e5DSM4UONFbsKR/B+3hD+WQ/86vQj/J2OJFhw9g74vQL7VOckBwI4chnI0ss4XGfFig8asZyK8Q1yYsfZDqSW3sO+wm5syGjB6tRGbD7Vhb9SIXIB79K9UdDipRSEZi6ghgTwyZLfzWpvT2JrkYB/UCEe1IBOA+i8Syiho7k1pwO/PtaC19Oa8WqynpxpwJcT1PjFifuK4AN1DG/nWHG9L8CP4iwEqNWKAL/oZoNU3m9mDiG52otUjYQDGllZ/BS58c3EBkRtqMLCd9SUmloaCZvq8ErKHWXuPirefZUiHHQLhwI+SSZbwzUw9XMcEaAOC6BXjQEBfKQZovt+iFLhxF8qPUipkbCnwoVl+9uwaOcNfH37NXyD8PLuZryW2o6fHunDtiIndpT6ob4tkpWiLAjuEF+T1m6OmqkD9KSyQMAPwSPiNx934+cZJiSqRrBPY6FLRsDvzoxi/SdDiPvoAeIJG04+xJZzVtq1F9tLfDhU44DN7oBLcMo2m12iYOHXMPYL+4GIAx6Pm/GHhNG1PDLpwfqMdvzk4x7sqBhGRr0HJ3UBHP8sgLQ6Pz0+fqp2brkP72TbkVw6hs/paXYLDtlisWJ4eCRIAlBcXNxAHHO+OAW1tYoAasmYn1oyn8+viHC4fThM9bn+TB9WpfWR1YPYeHIMvz1jwcZTE4g7Pox4cildNQBT/yB6ujtlQ9NNNN64IZlMZrm1tdW6ePHiFZxrzlQWRATUPnHAQykIKO/5+PgE+vvN6Ll7CyWqS3j3wwtYlViOV7fXYMVODX62V41tR1UoU1/BndYbuFBeJtdqNDAYDKy3t5fdvXvXv3Tp0rgw+XPc/ykg7AB1NYoA7oIgCBgdHYXJ3I/7PV3oNrbgVvN13LiuQ1OjHrdbGpX/3evuQIPuqkxtHV+C8UZkYGAAa9asSQhzvIB9CgGecAqC1JyEqD9g1AlH4ulumNG7wdPEe0G73SHTrqHX66mXcEq0e8TFxe2aljw8QemKSYDpaQc4uIiIEA5eUFwQH7lI3njabDaZu3Tp8mWpq6tL5juPj49XyKfM+bNBc7gDq1UqVR+RSNRIBin/ks/nk4hEAYl5AhKkjCRU4ru1Wq2S2WwOGo1GdHZ2+teuXbuFrzvtziMRdmCNTqd7hP8iuCO8YNva2izLly9fF15zivP2ggj/NPvO3r178y9cuKCjM6stLS3VlZWVPQH9vHoONKeBn2/6qabNyclRLVq06Ht8vRiKaSinjNgw5s4CMU99VmJWO382YmNjoxcuXBizYMGCuYSYFyE859l588KpnHH8G9SEW7QrlTX7AAAAAElFTkSuQmCC",
	"Домашняя страница"(addon, hideOn) {
		if (hideOn) return !addon.homepageURL && !addon.reviewURL;
		
		openURL(addon.homepageURL || addon.reviewURL.replace(/\/reviews\/.*$/, "/"));
	},
	//------------------------------------------------------------------
	"Поиск на АМО_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJGSURBVDjLjdJLSNRBHMDx78yqLZaKS75DPdgDDaFDbdJmde5QlhCJGxgpRJfqEEKnIsJLB7skQYQKZaSmdLaopPCgEvSCShCMzR5a7oq7/3l12RVtjfzBMA/4fWZ+MyOccwBM3g8HEbIdfCEhfAFnLVapOa28Uevpjrqz/WOsERJgsu9Uq5CZQzgqrJfo9BajNd5irEYn4p3OUiFExtCLmw2tawFi4l5zUMjMIau9u7K+qxeoAcoAA0wDb2OPwmfA16LiiaOHLj1edRLpkO3WmIis7+oBDgJbgQ2AH6gC6jY19N62RkcctKeVIJAhp9QgUA3kJXdONZVcq9JxPSgQoXRAyIDRth8oAXQyKdWnoCKrTD9CBv4GMqx1WGNZkeRWJKbG2hiD1Cb9FbTnzWFdY/LCdLKlgNQ84gyNKqHm0gDjqVHnxDHgA/B9RQkpaB6YklkZl62np9KBhOqwjpKFgeY2YAz4BESBWHI8Hhs6PVVSvc3v98ye4fP7T676B845nt040ip98qpWJmI9PWiU6bfWgXGN2YHcKwU7tsuc4kpUPMbU0+f8+vKt+Pitl7PLAMDI9cNBoB0hQwICzjqUp6MZvsy8yvp95BRuQUjJ75mPvH4wYo1NlJ64Mza7DPwrhi8cCOeXl/aUB4P4c/NJxKLMvpngycCrzxVFG2v/CwAMnguF80oLe8p27cQh+fnpPV/fTc95S6piXQDAw7a9YbWkezZXFbAwMx/xPFXb1D3+Y90AQF/L7kAsri9mZ4lrTd0TcYA/Kakr+x2JSPUAAAAASUVORK5CYII=",
	"Поиск на АМО"(addon, hideOn) {
		if (hideOn) return ["custombuttons", "theme", "plugin"];

		openURL(addon.homepageURL || (
			"https://addons.mozilla.org/search/?q=" + encodeURIComponent(addon.name)
		));
	},
	//------------------------------------------------------------------
	"Папка установки_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABAklEQVR42mNkoBAwAjEXEAcCMTsW+U9AvB6I/+I0gJ2Noe3QJoZKASEgjwkq+h+C795lYPCKZMgC8mZg0fsfbICIIMOcF6cZkrGZ/v8fA0PndIa/7z8BXfAPqgVKv//A8GPeZoYERmE+hjmP1+AwAOgiTjOIP7HZLyjLMJNRmB/ogjMMyYzsUC8wIhQwsgCFWHAHoKAy0AARIYY5r69idwEhIKgBMgAYBq8vkGmALsyAU2QaYAwz4CiZBliADBAAGnCATANsYQbsJtMAJ5ABwGh8uZE8A4R9gAYwMzHkT8hl6Bfgxp5ecIH3Xxj+F05hyIdpUmXAnpnwge9AfJckW7EBAC/gSzisxsnmAAAAAElFTkSuQmCC",
	"Папка установки"(addon, hideOn) {
		if (hideOn) return ["custombuttons", "theme", "plugin"];

		this.getFile(addon).reveal();
	},
	//------------------------------------------------------------------
	"Файл установки_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA51AAAOdQG5Y1EyAAAAhklEQVQ4y6WT0QnAIAxE78Bt2v1cod3PznP9kVLTRKUGBD+Sd5eQUBJWggCWCAkAJPGXOqlUPyVKkrSPQIoCQJGE6AF4HFyGuBmrR3cGQX8Wmp2cL8Cqv5JPD5Zm1D0nFZjTjHpQ7DuI1L3iBjBS9/pvhtjr21OukVkXiX/ug6SWj4mr53wDMz1vldHlLJkAAAAASUVORK5CYII=",
	"Файл установки"(addon, hideOn) {
		if (hideOn) return ["custombuttons", "theme", "plugin"];

		this.getFile(addon).launch();
	},
	//------------------------------------------------------------------
	getFile(addon) {
		var file, uri = addon.getResourceURI();
		if (uri instanceof Ci.nsIJARURI) uri = uri.JARFile;
		if (uri instanceof Ci.nsIFileURL) file = uri.file;
		return file;
	},
	url: "about:addons",
	handleEvent(e) {
		if (e.target.baseURI != this.url) return;
		var item = this.getItem(e.target.ownerDocument);
		var addon = item.addon = e.target.closest("addon-card").addon;
		
		for(var child of item.children) {
			var res = this[child.textContent](addon, true);
			child.hidden = Array.isArray(res)
				? res.includes(addon.type) : res;
		}
		e.target.contains(item)
			|| requestAnimationFrame(() => e.target.prepend(item));
	},
	click(e) {
		e.stopPropagation();
		iconizer.item.parentNode.hide();
		this[e.target.textContent](iconizer.item.addon);
	},
	getItem(doc) {
		if (iconizer.item) {
			if (iconizer.item.ownerDocument == doc) return iconizer.item;
			iconizer.handleEvent();
		}
		var item = doc.createElement("div");
		item.id = id;
		for(var lab of this.labels)
			item.appendChild(doc.createElement("panel-item")).append(lab);
		
		item.onclick = this.click;
		doc.ownerGlobal.addEventListener("unload", iconizer);
		return iconizer.item = item;
	},
	get labels() {
		delete this.labels;
		this.click = this.click.bind(this);
		if (id in g) return this.labels = (iconizer = g[id]).labs;

		g[id] = iconizer;
		var css = "", ind = 0, arr = [];
		var push = (ind, icon) => {
			var chromeImg = `chrome://custombuttons/content/${id + ind}`;
			arr.push(["override", chromeImg, icon]);
			return chromeImg;
		}
		var labs = iconizer.labs = Object.keys(this).filter(key => {
			var res = String(this[key]).startsWith('"');
			if (!res) return false;
			ind++;
			var icon = this[key + "_i"];
			if (icon) css += `\n\t#${
				id
			} > panel-item:nth-child(${ind}) {\n\t\t--icon: url(${
				push(ind, icon)
			}) !important;\n\t}`;
			return true;
		});
		var ams = Cc["@mozilla.org/addons/addon-manager-startup;1"].getService(Ci.amIAddonManagerStartup);
		var mUri = Services.io.getProtocolHandler("resource").getSubstitution("custombuttons-modules");

		var md = `@-moz-document url(${this.url}) {`;
		var uri = Services.io.newURI(`chrome://custombuttons/content/${id}.css`);
		arr.push(["override", uri.spec, "data:text/css;charset=utf-8," + encodeURIComponent(md + css + "\n}")]);
		iconizer.iconHelper = ams.registerChrome(mUri, arr);

		var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
		sss.loadAndRegisterSheet(uri, sss.USER_SHEET);

		iconizer.handleEvent = function() {
			if (!this.item) return;
			this.item.ownerGlobal.removeEventListener("unload", this);
			this.item.remove();
			this.item = null;
		}
		iconizer.destroy = function() {
			delete g[id];
			this.handleEvent();
			sss.unregisterSheet(uri, sss.USER_SHEET);
			this.iconHelper.destruct();
		}
		return this.labels = labs;
	}
}, true, gBrowser.tabpanels || 1))("CBAddonsMenuExt", Cu.import("resource://gre/modules/AddonManager.jsm", {}), {});



//Дополнительные кнопки на странице about:addons для аддонов, плагинов, тем, CB.....................................................................................
((id, g, css) => {
	addDestructor(r => r[5] == "e" && g[id]?.destroy(true));
	if (g[id]) return;
	var btnActions = ["preferences", "toggle-disabled", "remove", "install-update"];

	var {Array, Set} = Cu.getGlobalForObject(g);
	var {obs, focus, wm} = Services, cn = "cb-cloned-buttons-container";
	var topics = ["chrome-document-loaded", "quit-application-granted"];
	(g[id] = {
		init() {
			for(var topic of topics) obs.addObserver(this, topic);
			this.wins();
		},
		destroy(wins) {
			delete g[id];
			for(var topic of topics) obs.removeObserver(this, topic);
			wins && this.wins("destroyDoc");
		},
		isTarget: doc => doc.documentURI == "about:addons",
		wins(method = "initDoc") {
			for(var {document: doc} of new Set(Array.from(
				g.AddonManagerInternal.addonListeners, Cu.getGlobalForObject
			))) doc && this.isTarget(doc) && this[method](doc);
		},
		initDoc(doc) {
			this.btnActions = btnActions.map(action => `panel-list > panel-item[action="${action}"]`);
			var url = "cb" + (this.url =
				"data:text/css;charset=utf-8," + encodeURIComponent(css.replace(/;/g, " !important;"))
			);
			this.type = doc.ownerGlobal.windowUtils.USER_SHEET;

			(this.initDoc = doc => {
				doc.addEventListener("unload", this);
				doc.addEventListener("update", this, true);
				doc.ownerGlobal.windowUtils.loadSheetUsingURIString(url, this.type);
				for(var card of doc.getElementsByTagName("addon-card")) this.onCard(card);
			})(doc);
		},
		destroyDoc(doc) {
			for(var span of Array.from(doc.getElementsByClassName(cn))) span.remove();
			doc.ownerGlobal.windowUtils.removeSheetUsingURIString(this.url, this.type);
			this.unload(doc);
		},
		observe(doc, topic) {
			topic[0] == "q" ? this.destroy() : this.isTarget(doc) && this.initDoc(doc);
		},
		handleEvent(e) {
			this[e.type](e.target);
		},
		unload(doc) {
			doc.removeEventListener("update", this, true);
			doc.removeEventListener("unload", this);
		},
		update(card) {
			card.nodeName == "ADDON-CARD" && this.onCard(card);
		},
		onCard(card, again) {
			var btnsParent = card.querySelector("addon-options");
			if (!btnsParent) return again || card.ownerGlobal
				.requestAnimationFrame(() => this.onCard(card, true));
			var doc = card.ownerDocument;
			var [span] = card.getElementsByClassName(cn);
			if (span) span.textContent = "";
			else {
				card.querySelector("button.more-options-button")
					.before(span = doc.createElement("span"));
				span.className = cn;
			}
			for(var item of this.btnActions.map(this.btns, btnsParent)) if (item)
				span.append(item),
				item.shadowRoot.querySelector("button")
					.classList.add("cb-cloned-button");
		},
		btns(sel) {
			var item, doc = this.ownerDocument, card = this.parentNode;
			if (
				sel.includes("toggle-disabled") &&
				card.querySelector('input[action="toggle-disabled"]')
			) {
				var item = doc.createElement("panel-item");
				item.setAttribute("action", "toggle-disabled");
				doc.l10n.setAttributes(item, `${
					card.getAttribute("active") == "true" ? "dis" : "en"
				}able-addon-button`);
			} else
				item = this.querySelector(sel);
			return item?.cloneNode(true);
		}
	}).init();
})("CBAboutAddonsHTMLButtonizer", Cu.import("resource://gre/modules/AddonManager.jsm", {}), `

	span.cb-cloned-buttons-container {
		display: flex;
	}
	button.cb-cloned-button {
		appearance: none;
		padding: 1px 6px 3px 6px;
		margin: 0 1px;
		background-image: none;

		border: 1px solid var(--in-content-box-border-color);
		border-radius: 0px;

		font-size: 13px;
		font-family: Segoe UI;
	}
	button.cb-cloned-button:hover {
		background-color: gold;
	}
	button.cb-cloned-button:after,
	input[action="toggle-disabled"] {
		display: none;
	}
`);

Отсутствует

 

№1536226-03-2021 11:56:42

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 298
UA: Firefox 87.0

Re: Custom Buttons

Dumby
Все OK! Благодарю.

Отсутствует

 

№1536326-03-2021 17:07:45

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

Re: Custom Buttons

Dumby, помоги сделать автоскрытие панели вкладок, если вкладка одна и показ панели вкладок, если открывается две и более:

Выделить код

Код:

// автоскрытие панели вкладок для одной вкладки. В старом Лисе работало:
function TabCollapsed(open) {
	try { window.clearTimeout(TabCollapsed.timeout) } catch(e) {};
	TabCollapsed.timeout = setTimeout(()=> {
		document.getElementById("TabsToolbar").collapsed = (gBrowser.tabs.length == 1);
	}, 50);
};
addEventListener("TabOpen", function() {TabCollapsed(true)}, false, gBrowser.tabContainer);
addEventListener("TabClose", function() {TabCollapsed(false)}, false, gBrowser.tabContainer);
setTimeout(function() TabCollapsed(false), 1000); // если одна панель вкладок при старте сессии браузера

Отсутствует

 

№1536426-03-2021 17:12:33

DenisRodman
Участник
 
Группа: Members
Зарегистрирован: 24-03-2021
Сообщений: 7
UA: Firefox 63.0

Re: Custom Buttons

Dumby
Не работает. При нажатии по кнопке ничего не происходит. Вы когда тестируете свой код у вас условия те что у меня?


Я говорил, чтобы Мозила [firefox] 69.0.3 а не другая, плюс я указал, что у меня только этот custom_buttons-0.0.7.0.0.6-fx-paxmod.xpi установлен второй и custom_buttons-0.0.7.0.0.6-fx-bootstrap.xpi не поставился. А также содержимое двух файлов config.js и config-prefs.js у вас такое, что у меня №15345? При тесте кода условия, должны быть одинаковы, а то у меня не работает, а вы говорите завелась.

Отсутствует

 

№1536526-03-2021 17:42:06

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

Re: Custom Buttons

Вопрос - как обращаться к иконке кнопки из user_chrome_files ?
Нужно изменить иконку в коде user_chrome_files. А данный код работает только для CustomButtons:
self.style.cssText = 'filter: grayscale(100%)';


Dumby - Доработал QuickToggle, по клику переключает боковую панель, по правому клику показывает меню настроек.
Вопрос - как добавить действие на клик колёсиком ? (средней кнопкой мыши)
Возникли глюки - 1) перестало закрываться меню после изменения настроек. «Закрывать меню этой кнопки»
2) если два раза кликнуть левой, затем правой, то иногда меню настроек не открывается.
Проверь, где я накосячил? Переделывал менюшку с 360 строки кода:

Выделить код

Код:

// Quick Toggle https://forum.mozilla-russia.org/viewtopic.php?pid=784139#p784139
// https://forum.mozilla-russia.org/viewtopic.php?pid=784165#p784165
// Быстрое переключение параметров about:config
// стиль иконки: #QuickToggleAboutConfigSettings .toolbarbutton-icon{ padding: 2px !important;}

(async (name, id, func) => {
	if (name == "Object") return CustomizableUI.createWidget(func());
	var win = name == "Window", g = Components.utils.import("resource://gre/modules/Services.jsm", {});
	if (g[id]) {if (win) return;} else g[id] = func();
	if (win) return CustomizableUI.createWidget(g[id]);
	addDestructor(r => r[5] == "e" && delete g[id]);
	g[id].onCreated(this);
})(this.constructor.name, "QuickToggleAboutConfigSettings", () => { // BEGIN (this.constructor… {код кнопки});

	var {prefs} = Services, db = prefs.getDefaultBranch("");
	var pv = parseInt(Services.appinfo.platformVersion);
	var xul_ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

//=====================================================================================

	// refresh:
	//	false - reload current tab
	//	true - reload current tab skip cache
	//
	// restart:
	//	false - restart browser
	//	true - restart browser with confirm

//=====================================================================================

	var secondary = [{

			pref: ["network.proxy.autoconfig_url", "Прокси (VPN) URL"],
			userChoice: 0, userAlt: 1, refresh: true,
			values: [
				["127.0.0.1", "отключен…", "0", "", "Services.prefs.setIntPref('network.proxy.type', 0);"],
				["https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "Надёжный доступ на заблокированные сайты\n\n«Режим прокси» меняется на 2", "Services.prefs.setIntPref('network.proxy.type', 2);"],
				[prefs.getStringPref("user.pacfile", "file:///etc/proxy.pac"), "user .pac файл", "2"],
				["https://git.io/ac-anticensority-pac", "ac-anticensority", "3"],
				["localhost", "Tor Browser", "4"]
	]},{
			pref: ["network.proxy.type", "Режим прокси"],
			userChoice: 0, userAlt: 2, refresh: true,
			values: [
				[0, "Без прокси", "0", "по-умолчанию"],
				[5, "Системные (из IE)", "5"],
				[2, "Автонастройка", "2", "about:config — user.pacfile"],
				[1, "Ручная настройка", "1", "вторая строка"],
				[4, "Автоопределение", "4"]
	]},{
			pref: ["network.proxy.share_proxy_settings", "Прокси для всех протоколов"],
			userChoice: true, refresh: true,
			values: [[true, "Да", "", "Прокси для всех протоколов при ручной настройке"], [false, "Нет"]]
	},{
			pref: ["network.trr.mode", "DNS через HTTPS"],
			userChoice: 2, userAlt: 0, refresh: true,
			values: [
				[0, "Выключен", "0"], [2, "TRR + мой", "2"], [3, "только TRR", "3"]
	]},null,{
			pref: ["permissions.default.image", "Загрузка изображений"],
			userChoice: 1, userAlt: 3, refresh: true,
			values: [[1, "Разрешена"], [3, "Только с сайта"], [2, "Отключить"]]
	},{
			pref: ["image.animation_mode", "Анимация изображений"],
			userChoice: "none", refresh: true,
			values: [["none", "Выключена"], ["normal", "По циклу"], ["once", "Единожды"]]
	},{
			pref: ["browser.display.document_color_use", "Использовать цвета сайтов"],
			userChoice: 0,
			values: [[0, "Авто", "0"], [1, "Всегда", "1"], [2, "Никогда", "2"]]
	},{
			pref: ["browser.display.use_document_fonts", "Загружать web-шрифты"],
			userChoice: 1, refresh: true,
			values: [[1, "Да"], [0, "Нет"]]
	},null,{
			pref: ["media.autoplay.default", "Авто-play аудио/видео"],
			userChoice: 5, refresh: true,
			values: [
				[0, "Разрешить", "0"],
				[1, "Запретить", "1"],
				[2, "Спрашивать", "2"],
				[5, "Блокировать", "5"]
	]},{
			pref: ["media.autoplay.blocking_policy", "Автозапуск (политика)"],
			userChoice: 1, userAlt: 2, refresh: true,
			values: [
				[1, "Временная", "1"],
				[2, "По действию", "2"],
				[0, "Постоянная", "0"]
	]},{
			pref: ["plugin.state.flash", "Flash-plugin"],
			userChoice: 2, refresh: true,
			values: [
				[2, "Всегда включать", "2"],
				[1, "Включать по запросу", "1"],
				[0, "Никогда не включать", "0"]
	]},{
			pref: ["gfx.webrender.all", "WebRender для всего"],
			userChoice: false, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	},null,{
			pref: ["javascript.enabled", "Выполнять скрипты Java"],
			userChoice: true, refresh: true,
			values: [[true, "Да"], [false, "Нет"]]
	},{
			pref: ["network.cookie.cookieBehavior", "Cookies"],
			userChoice: 1, userAlt: 3, refresh: false,
			values: [
				[1, "Не принимать сторонние"], [3, "Не принимать с не посещенных"], [4, "Не принимать от трекеров"],
				[2, "Не принимать со всех"], [0, "Принимать со всех"]
	]},{
			pref: ["dom.enable_performance", "Статус загрузки страницы"],
			userChoice: false
	},{
			pref: ["dom.storage.enabled", "Локальное хранилище"],
			userChoice: true
	},{
			pref: ["network.http.sendRefererHeader", "Referer - для чего"],
			userChoice: 1,
			values: [[0, "Ни для чего", "0"], [1, "Только ссылки", "1"], [2, "Ссылки и изобр.", "2"]]
	},{
			pref: ["media.peerconnection.enabled", "WebRTC утечка IP"],
			userChoice: false
	}
	];
	// 		pref: ["intl.accept_languages", "Язык web-страниц"],
	// 		userChoice: "ru-RU, ru, en-US, en",
	// 		values: [["chrome://global/locale/intl.properties", "По-умолчанию"], ["en-US, en, ru-RU, ru", "Английская локаль"], ["ru-RU, ru, en-US, en", "Русская локаль"]]

	return {
		label: "Quick Toggle Settings",
		id: "QuickToggleAboutConfigSettings",
		tooltiptext: "Quick Toggle Settings\n\nЛКМ Боковая панель: Журнал\nПКМ Быстрое изменение настроек",
		localized: false,
		image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAAGXcA1uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAdeSURBVHjaACcA2P8AbW1r2J6UnfEBAQEAAH9/feRepVj/4Zcn/wCCgX/k7+/v//+7KP8AAAD//wAnANj/AIuKifGIiIbxAAAAAACyv7f//////xUVFG8A7Ozs/+vIe/+vezrUAAAA//8ASwC0/wCQiI7kUp9P/2G5U//2/fb/s7S0/w8QEBIAgYB/5PHx8f/jzKn/6caJ///oev9NKiKFAIqIhuTu7e3/7+/v//WzPf/Dom7/ZzEJwAAAAP//JMk/CwFxAMfhL0mSRRbvglImsxfgFVjMFn9uMIkwyiqyobwBVpnuFoOyooT86uTOcOlj8KyPBv2euxjN3U637TYb9ZukkCSptbawLiWqqwqO4zCdTJAkAZTPeQD29gbgH0EQ8PY8vo85fIY4/RqZVFjyfR9jDNf7C7YF2OXIpqMJ+Z6HMU9OR5vlbAyHIvFYJPljO/5dEgjjAA5/Cxtu8aIcCm5yE6JZlMbm/oegpYZqiBbr9AjCOUIQG6q1tqAabGrVhhYhXOqt9N77lcLFGfZpcuvZHrHtAwXQem6TvhNW6wUmtKe5vDjHNM20TDSqDbXymKPqblDv7eO8rrPWytMddBn9jOi5GoBMZn5HRETK9qECCMOQWueUZvcBgGQMwUsNngp89kMsy9oWERGnYqs4jvF9nyAIcPUXnWYJkhJEJ/z2tyDZhMEeY3WMOJWyGg6HeJ6H1pooinh7/+D7qgg3Obhfhts82cU5J7tgpOQ/s4bMpKanjMnPdovXnaMlRET+yKKfkCbjOI7j37ooo0PQn0NUCFIUo2J2iKhD1govQZcg+uMKo6QiCG9BROlYNbTA/iAWiSnqwQwJZJsu8WKCWUSWmlmxoK1nz+Oe32/PmsHju4PkCA+fw+fw+lw+EgzWEqyrtVsan9odjZ32nfAtOxQK2vX1YXw+3+kla79zOQC8TaWU9Aufp2YAyGazOI5D+f59j/8DM6kvnO84Q/nL7TwwaqhqryQYvw5AV1cnA/E4gUCgZxFEpqNcThyi1bzJ3cQlqqcr8L9aOO/b9wQAkb4+FkE+lwfgaPdBjn/cy8jYKG7exZzN4r4+yfhQL7FYtAAcxwEXeid6aJp4SFb/ASAxOQ7uNcaeHOHN23cFoLUmk8mglCL5y2Lu6zPsT/ew3zcAj0jdLqP7fjMbRIov+teJaK0wDAPLslBKMzoYwTWvMK8bmDdugK4GfQHyIX60HZ4UpQrAsiycXJ7hgRfw4RTEvRDdymysghO+VWfrKktFlFKkUinS6TSmaZLROaYiYXi+GSLbYGgPsatliEjxzk0rRJLJn1imuRDLxLAUc4PnGGmtoqW5DYYPoNt3IyL+krVFRUueXyYiKz3LV//rW9Z7dtB/jF1rpMa70SN/+Sj/mKjrMI5/AQPa6MeSFj9a2SjMRckdd5QKlBA3bC63yg006pqxNpv2Q1tuAUdYY1iN0Y9lM1nM3TAdSrLiEA9CJAFjpQdywV0aHeD9kO9x3Pd+H6/+AG5erJ7t89dnn+f1ed7P834EjabKsjweAMFAkN7pXo6av6X52nf0T14g6Avy7zAajdRoqsmWZWsSEhJib+FFh0ZTZfF5vZGH3X39FGufomwyi303VFS07mRw+DIAYV8YAK/Xw+joCHa7nXAoTItWy5aSkq6kpKT0pbSxEUDToaOWc+ZzZHWnUWR4ALVpAwct5RyeOUCz9UM+nalg9+TTFBseJL/nca65ri8Nv4TodOK4OYvVZgNAr9eTmppaEVVBY32DZWJ6nErd++w/sYdXju1EfX4bH0y9wL4/t1Gme55d2l3sbXmT2k4NUkhalGjsd8aOqTEcKccyuQjt1HWQnLz6rRUS3dqDC8P9bGp+gvX9KazrTGNL07OMmyai9LdOzfDXyHFwvsOcLouR1moA+vr6SEm57+0oQE1NtUWSFn8lSRKBQCAqmdsygfniSa6eP45xQMdwTxej+haC9kbgEzC9hOnL9VjGBhg0GHkoI2O3IAhCfOIqobTo/sUl6XK58Hg8OBwORFFEFEWcc3OIznmuDukxDzQQ9jYCdeCrBV89eBrB9xW4G/Fd/hhrayVXvnmP3sqXp069puo6sjX75Beb0w9EAex2Ow6HI2I7URSZn3djv+niysDP/D1Yx4KtHmY/A8t+FkxlYChkYUgGv6yDXzPhDyW+IVXwh4ObzpQWpBVHAJLkwWaz4XA4IjZdhrjm3dywO/mt5wSzHTvgJzm0ZUL7o/DjY9CtZEGfR0ftczz58JqqxFWCcO/d8YJalb7UA7e0NN9e/H4/fr+fQDBIMBQiHA4TAqzTU1g73oVTa0EnY/r0dsa/fxVJXwiXcuGSCuOhbHKS47SCIMgS42OTczOTbhMK8vMalMqcswqFvE2pyFlxcuTyNoVCcfr17QVn6/bmD71YIu/Jzd14ZnNhUXvBM4VtSuXG9s/35Ju5uBV6i2nakXL9rjihVLn2TuHrNzL+w97/EzExK3fRHbfHCLI1q+9pUG/46HD5Iy3K9Li85ft/BgCgAJvUrkqRFQAAAABJRU5ErkJggg==",
		onCreated(btn) {
			btn.setAttribute("image", this.image);
			var doc = btn.ownerDocument;

			btn.btn = true;
			btn.domParent = null;
			btn.popups = new btn.ownerGlobal.Array();
			// this.createPopup(doc, btn, "primary", primary);
			this.createPopup(doc, btn, "secondary", secondary);
			this.createCloseMenusOption(doc, btn);

			btn.linkedObject = this;
			for(var type of ["command", "contextmenu", "mousedown"])
				btn.setAttribute("on" + type, `linkedObject.${type}(event)`);
		},
		createPopup(doc, btn, name, data) {
			var popup = doc.createElementNS(xul_ns, "menupopup");
			var prop = name + "Popup";
			btn.popups.push(btn[prop] = popup);
			popup.id = this.id + "-" + prop;
			for (var type of ["popupshowing", "click"])
				popup.setAttribute("on" + type, `parentNode.linkedObject.${type}(event)`);
			for(var obj of data) popup.append(this.createElement(doc, obj));
			btn.append(popup);
		},
		map: {b: "Bool", n: "Int", s: "String"},
		createElement(doc, obj) {
			if (!obj) return doc.createElementNS(xul_ns, "menuseparator");
			var pref = doc.ownerGlobal.Object.create(null), node, img, bool;
			for(var [key, val] of Object.entries(obj)) {
				if (key == "pref") {
					var [apref, lab, akey, ttt] = val;
					pref.pref = apref; pref.lab = lab || apref;
					if (ttt) pref.ttt = ttt;
				}
				else if (key == "image") img = val, pref.img = true;
				else if (key != "values") pref[key] = val;
				else pref.hasVals = true;
			}
			var type = prefs.getPrefType(pref.pref);
			var str = this.map[type == prefs.PREF_INVALID
				? obj.values ? (typeof obj.values[0][0])[0] : "b"
				: type == prefs.PREF_BOOL ? "b" : type == prefs.PREF_INT ? "n" : "s"
			];
			pref.get = prefs[`get${str}Pref`];
			var map, set = prefs[`set${str}Pref`];
			if (pref.hasVals) {
				for(var [val, , , , code] of obj.values)
					code && (map || (map = new Map())).set(val, code);
				if (map) pref.set = (key, val) => {
					set(key, val);
					map.has(val) && eval(map.get(val)); // выполнить код
				}
			}
			if (!map) pref.set = set;

			node = doc.createElementNS(xul_ns, "menu");
			node.className = "menu-iconic";
			node.setAttribute("closemenu", "none");
			img && node.setAttribute("image", img);
			akey && node.setAttribute("accesskey", akey);
			(node.pref = pref).vals = doc.ownerGlobal.Object.create(null);
			this.createRadios(doc,
				str.startsWith("B") && !pref.hasVals ? [[true, "true"], [false, "false"]] : obj.values,
				node.appendChild(doc.createElementNS(xul_ns, "menupopup"))
			);
			if ("userChoice" in obj) pref.noAlt = !("userAlt" in obj);
			return node;
		},
		createCloseMenusOption(doc, btn) {
			var pn = this.closePref = "QuickToggleAboutConfigSettings.closeMenus";
			var data = [null, {
				pref: [pn, "Закрывать меню этой кнопки"], values: [[true, "Да"], [false, "Нет"]]
			}];
			var setCloseMenus = e => {
				e.stopPropagation();
				var trg = e.target, {pref, val} = trg, updPopup = true, clear;
				switch(e.type) {
					case "command": pref = (trg = trg.closest("menu")).pref; updPopup = false; break;
					case "click": if (e.button) return; break;
					case "contextmenu": e.preventDefault(); clear = pref;
				}
				if (!pref) return;
				if (clear) prefs.clearUserPref(pn);
				else if (!updPopup && val === pref.val) return;
				else pref.set(pn, val !== undefined ? val : !pref.val);
				this.upd(trg);
				updPopup && this.popupshowing(null, trg.querySelector("menupopup"));
			}
			(this.createCloseMenusOption = (doc, btn) => {
				for(var obj of data)
					btn.secondaryPopup.append(this.createElement(doc, obj));
				var m = btn.secondaryPopup.lastChild;
				m.style.cssText = "fill: lightblue !important; list-style-image: url(chrome://browser/skin/menu.svg) !important;";
				m.setAttribute("oncommand", "setCloseMenus(event)");
				m.onclick = m.oncontextmenu = m.setCloseMenus = setCloseMenus;
			})(doc, btn);
		},
		UserChoiceImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRUlEQVR42qWTS2gTQRjH/zPJZo2BDfgkB62vYg5CjQdvRUE8WB8HKyahYotIQQOeFKGCF7EgvQlBqOCjWFKlevBRDyL4uHloLXhYqWJroaEqlETSptndGb+ZPDH0ojN8O8vA98vv+/Itw38u1nSRYRE6UhKyg4FF1R292/Q+xhhLi4TIrgjgIzwe4MbgmR2nrZMtxxEN63zYORuPZp7gzpehvCu9XjfuPmwCUHIiEtw4fK89zVvD2+FHAD56quXBpV3CVO4ret6nxHzxZxdBRuqADCKmz7RHD9y2tlmbYbBVfwE8DXBkEd/y39H5+mze8ZyoSIpsFXC9u/VE3/ldpyg5AAMEoJMTQi2hANKBgyKdy0h/eoChqcf9MimvVAHjd/fdiG0NRwgQpDAp1agBpDZwdHKJLKZzc+h5e3kCSexh5c5j8fmhW0HGpNZXFkqfsQpAKgcFKGmAlAxHXp5bkkmsrhosjh4cCIJ5pG5qfQXgtMslqO1qgEMWTPrR+eriEhoA4wN7L8TWh0KVXzfgY2RQAUjVBenWLH4UCrj04Wa9BNXEo5va+w63xCiJ6WRVP2MVgNQIgjgEA17MTODZ7Lt+AtSaGDG4377a1m2FAkKrc11/dUwIID1dSKHEcW3yft4RbpR6kK1PYgaJtaY1nNp5jIeMsjKNbs1AWRUcjvTnp2Kh9LtLJGTDINUhcTIZ3L+hzdq9ZgvWmSF9/Wu5gI8L03gzP5l3hddL/3/zKDdA9MdE0UERrdzaFGMUaap75Y/pX9Yfap76EQYaCeEAAAAASUVORK5CYII=",
		notUserChoiceImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACNUlEQVR42qXTT2jTUBwH8G9e0ta2ks5ND0Ww/qX1oGyevEwQnOBA6EHXwLwoUh3eRGRs501RPE6xgp6KrexQECZY8DBPXmbRS4Z/K0gRtmmDa2yb5PlLX7p2Gwpi4EfCy8sn3/dPwn9e0saGnCRF6XYFnA9DkhKtRs51ep6jmtEcp/JHIM9Yivl9mf0XNDV2Ngn1YLzVxdB1lJ8U8P5hzuCWnR6xrPwmIM8kLRjdkT326BaLHNgLKAFA9ouXdhOw6qi++4j589cd89vSaMqyc2sAPUXlgF8fyt9WI3t2Av4w4NsCMJ8AHAKav6hqqH76iuLINcNuNhOawyttYCp+7tRE/6XT9GFQAG4CpniATQkIaNQIMVG6/xSL2WfTGueTbWDh5L2rA9t29QGBrQQEPUDuAuoEmFSr+P5lGc8v33mtAUfaQO3M4/GgDOoYCIkUin8D0BDDoBQ2ZMxqN0wCQh0gMxaUnYb4uzt+dwIZ8wBHTGQbYAHMpu+uAxaGxpMDvSr3AHcFaAIlD+BtoN6ag5WqhOLNwrohTMWPH5roP7pdLIwb3wW6EziWGAZhpVdLWHzxdpqAyc4yKrJ+4uKg2oMV+lgRK9CdwAVsG1WpF8UH84Zt2QkCKmsbiRAtFAllB5OHWQ9fpr81OwlcgBL9kPrwsvDGMQ1zNMV5ZyN1ISlZYZl9/TE1tjuMSFgA1VWO8uef+FAqG47tpFMcm7dyFyIOEzBMlfCadao5qhk39l9P479evwFbiOcRSXKueAAAAABJRU5ErkJggg==",
		UserAltImg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIfSURBVDhPpVM9b9NQFD02cSKKFVGKIFFREFsmFiCA1AEQQrQjC0gssLCkC0jJj0iFWFoGdiT4Ay0SEmJBhPI5FBokikL4SCC0Te2UxInt13Mdu1CVrVc6713fe86x/T6w09DCeTNKJ7Q0pzyUmoCmZYOiUhXms8RMcd6vB7UwthhM5fTLWix2L3PmYjKdOwdz9DDFGtr1KuovnqD29JGlfO9Goew9DCV/DaZy2pXE8PD9Y/mbupk6xE6cVWPQhEujHo2+4fXdO76ztnq1UPYfSCcwKB1HWjeMyunCraSZOsDqbkBPsBOTNoMGvkOTLto/f+F56bble262OK/qesiYzIydTJojFLjrgEe4bcIOEdXWYe6LITN2KgmFSRFGBuPpo0eAngX0SexTJHD5LOgLpEZTcgKuUuMijAyy5l7+r0NSb21g5LQI5gGYSy2AjYBLjQyRAUniTnJXsBoayBzm3RBBndwwIoOK3fgNdIREQYCV/0DqLdiNZqCRITKYayx85RfQuUNiZ3k7IgO+vfGeXGpkiAyma++WLHtZhZ8o5H/FEVpos1V7u8TFwLQId8nw+Afa51Oq2vyycmlk9KCW0GXFZeu63IUO8z88Bx5s28SbuUXfddzrxVcobxpI0GTh7H734/dPzQt9d0/CGBpCPB7nbhmwbAPVxR4+PPtsuU7/WuElth/lKORUcsoTE8TgMg0WbJaY4Zu3XKYdBrABARUk+ls4DfQAAAAASUVORK5CYII=",
		upd(node) {
			var {pref} = node, def = false, user = false, val;
			if (prefs.getPrefType(pref.pref) != prefs.PREF_INVALID) {
				var pn = pref.pref;
				try {val = pref.defVal = db[pref.get.name](pn); def = true}
				catch(ex) {def = false;}
				var user = prefs.prefHasUserValue(pn);
				if (user) try {val = pref.get(pn, undefined);} catch(ex) {}
			}
			if (val == pref.val && def == pref.def && user == pref.user) return;
			pref.val = val; pref.def = def; pref.user = user;
			var exists = def || user;

			var ttt = exists ? val : "Этого префа не существует";
			if (ttt === "") ttt = "[ empty_string ]";
			ttt += "\n" + pref.pref;
			if (pref.ttt) ttt += "\n" + pref.ttt;
			node.tooltipText = ttt;

			var img, alt = "userAlt" in pref && val == pref.userAlt;
			if (alt) img = this.UserAltImg;
			if ("userChoice" in pref)
				if (val == pref.userChoice)
					//node.style.removeProperty("color"),
					img = this.UserChoiceImg;
				else {
					//node.style.setProperty("color", "maroon", "important");
					if (!alt) img = this.notUserChoiceImg;
				}
			if (!pref.img) img
				? node.setAttribute("image", img)
				: node.removeAttribute("image");
			user
				? node.style.setProperty("font-style", "italic", "important")
				: node.style.removeProperty("font-style");

			var {lab} = pref;
			if (exists && pref.hasVals) {
				if (val in pref.vals) var sfx = pref.vals[val] || val;
				else var sfx = user ? "Другое" : "По умолчанию";
				lab += ` — "${sfx}"`;
			}
			node.setAttribute("label", lab);
		},
		createRadios(doc, vals, popup) {
			for(var arr of vals) {
				if (!arr) {
					popup.append(doc.createElementNS(xul_ns, "menuseparator"));
					continue;
				}
				var [val, lab, key, ttt] = arr;
				var menuitem = doc.createElementNS(xul_ns, "menuitem");
				menuitem.setAttribute("type", "radio");
				menuitem.setAttribute("closemenu", "none");
				menuitem.style.setProperty("font-style", "italic", "important"),
				menuitem.setAttribute("label", popup.parentNode.pref.vals[val] = lab);
				key && menuitem.setAttribute("accesskey", key);
				var tip = menuitem.val = val;
				if (ttt) tip += "\n" + ttt;
				menuitem.tooltipText = tip;
				popup.append(menuitem);
			}
		},
		openPopup(popup) {
			var btn = popup.parentNode;
			if (btn.domParent != btn.parentNode) {
				btn.domParent = btn.parentNode;
				var pos;
				if (btn.matches(".widget-overflow-list > :scope"))
					pos = "after_start";
				else var win = btn.ownerGlobal, {width, height, top, bottom, left, right} =
					btn.closest("toolbar").getBoundingClientRect(), pos = width > height
						? `${win.innerHeight - bottom > top ? "after" : "before"}_start`
						: `${win.innerWidth - right > left ? "end" : "start"}_before`;
				for(var p of btn.popups) p.setAttribute("position", pos);
			}
			popup.openPopup(btn);
		},
		maybeRestart(node, conf) {
			var msgRest = "Перезапустить браузер?", msgAbort = "Запрос на выход отменен.";
			if (pv >= 77) {
				var title = node.closest("toolbarbutton").label;
				var pp = domWin => Services.prompt.wrappedJSObject.pickPrompter({
					domWin, modalType: Ci.nsIPrompt.MODAL_TYPE_WINDOW
				});
				var confirm = win => pp(win).confirm(title, msgRest);
				var alert = win => pp(win).alert(title, msgAbort);
			} else {
				var confirm = win => win.confirm(msgRest);
				var alert = win => win.alert(msgAbort);
			}
			return (this.mayBeRestart = (node, conf) => {
				var win = node.ownerGlobal;
				if (conf && !confirm(win)) return;
				if (win.BrowserUtils.restartApplication() === false) alert(win);
				else return true;
			})(node, conf);
		},
		regexpRefresh: /^(?:view-source:)?(?:https?|ftp)/,
		maybeRe(node, fe) {
			var {pref} = node;
			if ("restart" in pref) {
				if (this.maybeRestart(node, pref.restart)) return;
			}
			else this.popupshowing(fe, node.parentNode);
			if ("refresh" in pref) {
				var win = node.ownerGlobal;
				if (this.regexpRefresh.test(win.gBrowser.currentURI.spec)) pref.refresh
					? win.BrowserReloadSkipCache() : win.BrowserReload();
			}
		},
		maybeClosePopup(e, trg) {
			!e.ctrlKey && prefs.getBoolPref(this.closePref, undefined)
				&& trg.parentNode.hidePopup();
		},
		command(e) {
			var trg = e.target; 			// if (trg.btn) return this.openPopup(trg.primaryPopup);
			if (trg.btn) {
				var doc = e.target.ownerDocument; // Переключить боковую панель
				var win = doc.defaultView;
				var bar = doc.querySelector("#add-additional-vertical-bar");
				if (bar)
					win.setToolbarVisibility(bar, bar.collapsed);
				bar.collapsed ? win.SidebarUI.hide('viewHistorySidebar') : win.SidebarUI.show('viewHistorySidebar');
				return;
			}
			var menu = trg.closest("menu"), newVal = trg.val;
			// this.maybeClosePopup(e, menu);
			if (newVal != menu.pref.val)
				menu.pref.set(menu.pref.pref, newVal),
				this.maybeRe(menu, true);
		},
		popupshowing(e, trg = e.target) {
			if (trg.state == "closed") return;
			if (trg.id) {
				for(var node of trg.children) {
					if (node.nodeName.endsWith("r")) continue;
					this.upd(node);
					!e && node.open && this.popupshowing(null, node.querySelector("menupopup"));
				}
				return;
			}
			var {pref} = trg.closest("menu"), findChecked = true;

			var findDef = "defVal" in pref;
			var checked = trg.querySelector("[checked]");
			if (checked) {
				if (checked.val == pref.val) {
					if (findDef) findChecked = false;
					else return;
				}
				else checked.removeAttribute("checked");
			}
			if (findDef) {
				var def = trg.querySelector("menuitem:not([style*=font-style]");
				if (def)
					if (def.val == pref.defVal) {
						if (findChecked) findDef = false;
						else return;
					}
					else def.style.setProperty("font-style", "italic", "important");
			}
			for(var node of trg.children) if ("val" in node) {
				if (findChecked && node.val == pref.val) {
					node.setAttribute("checked", true);
					if (findDef) findChecked = false;
					else break;
				}
				if (findDef && node.val == pref.defVal) {
					node.style.removeProperty("font-style");
					if (findChecked) findDef = false;
					else break;
				}
			}
		},
		contextmenu(e) {
			var trg = e.target;
			if (trg.btn) {
				if (e.ctrlKey || e.shiftKey) return;
				if (e.detail == 2) return trg.secondaryPopup.hidePopup();
				this.openPopup(trg.secondaryPopup);
			}
			else if ("pref" in trg) {
				this.maybeClosePopup(e, trg);
				if (trg.pref.user)
					prefs.clearUserPref(trg.pref.pref),
					this.maybeRe(trg);
			}
			e.preventDefault();
		},
		click(e) {
			if (e.button) return;
			var trg = e.target, {pref} = trg;
			if (!pref) return;
		},
		mousedown(e) {
			var reset = e => e.target.linkedObject = this;
			var id, lo = {command: reset, mousedown: reset};

			var lin = /macos|linux/.test(e.view.AppConstants.platform);
			var stop = e => reset(e) && e.preventDefault();

			lo.contextmenu = lin
				? e => e.ctrlKey || e.shiftKey ? dsp(e) : stop(e) : stop;
			var context = lin
				? e => e.button == 2 && e.type.endsWith("p") && this.contextmenu(e) : () => {};

			var dsp = (e, timeout) => {
				var trg = e.target;
				trg.onmouseup = trg.onmouseleave = null;
				if (timeout) return this.londPress(e);
				e.view.clearTimeout(id);
				reset(e);
				context(e);
			}
			(this.mousedown = e => {
				var trg = e.target;
				if (!trg.btn) return;
				trg.linkedObject = lo;
				trg.onmouseup = trg.onmouseleave = dsp;
				id = e.view.setTimeout(dsp, 500, e, true);
			})(e);
		},
		londPress(e) { // удержание кнопки мыши, выбирать команды, отводящие мышь от кнопки
			var msg = "QuickSettings\nLONG PRESS: e.button = " + e.button;
			// Components.utils.reportError(msg);
			// StatusPanel._label = 'text'; setTimeout(()=> StatusPanel._label = '',3000);
			// e.view.alert(msg);
			// image.style.cssText = 'filter: grayscale(100%)';

			Components.classes['@mozilla.org/alerts-service;1'].getService(Components.interfaces.nsIAlertsService).showAlertNotification(null, 'Debug', 'ToolTip', false, '', null, 2000);
		}
	};
}); // END код кнопки

Отредактировано Dobrov (27-03-2021 01:51:16)

Отсутствует

 

№1536626-03-2021 21:41:57

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

Re: Custom Buttons

DenisRodman пишет

а то у меня не работает, а вы говорите завелась.

Да вроде работает:

скрин
f0587fa33c6d.png
правда проверял с этой версией CB


Win7

Отсутствует

 

№1536727-03-2021 09:21:51

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

Re: Custom Buttons

DenisRodman пишет

Вы когда тестируете свой код у вас условия те что у меня?

Да, те же конфигурационные файлы, та же версия CB и Firefox, будь уверен.
Хотя наиболее важна здесь только версия Firefox.


kokoss
Спасибо за подтверждение!


Dobrov пишет

setTimeout(function() TabCollapsed(false),

Это что ещё за синтаксис? Выпилен в Firefox 60.
А если это исправить, то код, вобщем-то, работает.
В том смысле, что атрибут "collapsed" появляется, если вкладка только одна
(можно проверить, заменив collapsed на hidden).
Но к скрытию панели вкладок это у меня не приводит,
нужен обеспечительный стиль с visibility: collapse !important;


Dobrov пишет

Вопрос - как обращаться к иконке кнопки из user_chrome_files ?
Нужно изменить иконку в коде user_chrome_files. А данный код работает только для CustomButtons:
self.style.cssText = 'filter: grayscale(100%)';

Ну, это надо по ситуации смотреть, без конкретного кода сказать нечего.


Dobrov пишет

Вопрос - как добавить действие на клик колёсиком ? (средней кнопкой мыши)

Например, добавить auxclick

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

Выделить код

Код:

...
		onCreated(btn) {
			...
			//for(var type of ["command", "contextmenu", "mousedown"])
			for(var type of ["command", "contextmenu", "mousedown", "auxclick"])
				btn.setAttribute("on" + type, `linkedObject.${type}(event)`);
		},
		auxclick(e) {
			if (e.button != 1 || !e.target.btn) return;
			e.view.alert("MMB");
		},

Dobrov пишет

1) перестало закрываться меню после изменения настроек. «Закрывать меню этой кнопки»

Так сам же закомментировал // this.maybeClosePopup(e, menu);


Dobrov пишет

2) если два раза кликнуть левой, затем правой, то иногда меню настроек не открывается.
Проверь, где я накосячил?

У меня не воспроизводится. Сколько ни кликаю левой, по правой меню настроек всегда открывается.
Но косяк есть. SidebarUI.hide() может принимать аргументом triggerNode, но никак не commandID.
И проверка if (bar) какая-то половинчатая, для вертикальной проверяем, а для сайдбара нет.

Отсутствует

 

№1536827-03-2021 09:57:32

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

Re: Custom Buttons

Dumby - Спасибо, исправлю указанный код!

Dumby пишет

Вопрос - как обращаться к иконке кнопки из user_chrome_files ?
    Нужно изменить иконку в коде user_chrome_files. А данный код работает только для CustomButtons:
    self.style.cssText = 'filter: grayscale(100%)';

Ну, это надо по ситуации смотреть, без конкретного кода сказать нечего.

Ну, я хотел при изменении прокси-сервера затенять иконку, а при дефолтном прокси возвращать цвет.
То есть, нужно в пятом элементе массива вызвать код или функцию, которая поменяет цвет иконки:

Выделить код

Код:

["https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "Надёжный доступ на заблокированные сайты\n\n«Режим прокси» меняется на 2", "Services.prefs.setIntPref('network.proxy.type', 2);"],

если это исправить, то код, вобщем-то, работает. В том смысле, что атрибут "collapsed" появляется, если вкладка только одна
(можно проверить, заменив collapsed на hidden).
Но к скрытию панели вкладок это у меня не приводит, нужен обеспечительный стиль с visibility: collapse !important;

Будет желание, покажи пример скрытия панели вкладок! А старый код на Basilisk работает…

Отредактировано Dobrov (27-03-2021 13:33:14)

Отсутствует

 

№1536927-03-2021 10:00:17

DenisRodman
Участник
 
Группа: Members
Зарегистрирован: 24-03-2021
Сообщений: 7
UA: Firefox 63.0

Re: Custom Buttons

Dumby
Записал видео там показаны две проблемы. Первая это, то что кнопка расширяет панель браузера т.е. куда бы я её не размещал она всё меняет и вторая главная то, что кнопка нерабочая. Сколько по ней не нажимай ничего не появляется.

Отсутствует

 

№1537027-03-2021 14:11:56

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

Re: Custom Buttons

DenisRodman пишет

Записал видео там показаны две проблемы.

Да, весьма наглядно. Но это проблемы старой, неправленной кнопки.
Вот скриншот с видео. Видишь createElement? А должен быть createXULElement.


Раз тулбары колбасит при добавлении кнопки, значит инициализация кнопок не отключена.
Тогда, ещё раз:


1. Копируем длинную custombutton-ссылку из этого поста в буфер обмена.


2. Кликаем правой клавишей мыши по кнопке из видео,
    в открывшемся контекстном меню жмём пункт «Обновить кнопку».


Dobrov пишет

Ну, я хотел при изменении прокси-сервера затенять иконку, а при дефолтном прокси возвращать цвет.
То есть, нужно в пятом элементе массива вызвать код или функцию, которая поменяет цвет иконки:

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

Нет, ни разу не «то есть». Вообще никак не связанные вещи.
Прокси может быть переключён как угодно, прямо в about:config,
через лисий UI, любым сторонним кодом, и даже из этой кнопки, но в другом пункте.


Если интересно чисто как доступ, то, в данных условиях, вот так кнопка станет серой

Выделить код

Код:

...
				[
					"https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "Надёжный доступ на заблокированные сайты\n\n«Режим прокси» меняется на 2",
					`Services.prefs.setIntPref('network.proxy.type', 2);
					node.parentNode.parentNode.style.filter = 'grayscale(100%)';`
				],

Это в её окне. А вот так кнопка станет серой во всех окнах браузера

Выделить код

Код:

...
				[
					"https://antizapret.prostovpn.org/proxy.pac", "АнтиЗапрет", "1", "Надёжный доступ на заблокированные сайты\n\n«Режим прокси» меняется на 2",
					`Services.prefs.setIntPref('network.proxy.type', 2);
					for(let win of Services.wm.getEnumerator('navigator:browser')) if (!win.closed)
						win.document.getElementById('QuickToggleAboutConfigSettings').style.filter = 'grayscale(100%)';`
				],

Теперь, чтобы кнопка меняла цвет, нужно разместить нечто подобное во всех затронутых местах,
как код посерения в одних, так и код возвращения цвета в других.
Ещё надо разместить какой-то код, который (если требуется) сделает её серой в момент создания.


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


Таким образом, задача «при изменении прокси-сервера затенять иконку, а при дефолтном прокси возвращать цвет»
не решается чем-либо «в пятом элементе массива». Здесь нужен обсёрвер, отслеживающий изменение настройки,
и визуализирующий кнопку (или кнопки во всех окнах браузера, если обсёрвер сделать один глобальный).

Отсутствует

 

№1537127-03-2021 15:08:07

DenisRodman
Участник
 
Группа: Members
Зарегистрирован: 24-03-2021
Сообщений: 7
UA: Firefox 69.0

Re: Custom Buttons

Dumby
Вот теперь старая кнопка работает в [firefox] 69.0.3 Благодарю за правку кода :)

Отсутствует

 

№1537227-03-2021 15:28:10

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

Re: Custom Buttons

Dumby пишет

Таким образом, задача «при изменении прокси-сервера затенять иконку, а при дефолтном прокси возвращать цвет» не решается чем-либо «в пятом элементе массива». Здесь нужен обсёрвер, отслеживающий изменение настройки, и визуализирующий кнопку (или кнопки во всех окнах браузера, если обсёрвер сделать один глобальный).

Моя кнопка Очки имеет несколько иконок в Basilisk profile, но они переключаются попроще.
Продвинутый способ я так представляю: после изменении опций ещё через setAttribute записать в тэг номер иконки.
Допустим, это network.proxy.type 0 1 2. А затем обсёрвер поменяет иконку в зависимости от тэга.
Если будет обсёрвер, то возможно комбинировать вид, как в моей кнопке Очки: Зелёный/Красный/Серый + фон или прозрачность, то есть 6 режимов при одной исходной иконке.


P.S. а как открыть Менеджер закладок в новых Firefox?
так не работает: PlacesCommandHook.showPlacesOrganizer('BookmarksToolbar');

Отредактировано Dobrov (27-03-2021 15:32:12)

Отсутствует

 

№1537329-03-2021 18:59:07

ВВП
Участник
 
Группа: Members
Зарегистрирован: 13-03-2021
Сообщений: 228
UA: Firefox 87.0

Re: Custom Buttons

Dumby
Часом не ваша кнопка? Аддоны и т.д. Сдохла в 87

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

Выделить код

Код:

//Дополнительные пункты контекстного меню на странице about:addons для аддонов, плагинов, тем, CB.....................................................................................
((id, g, iconizer) => addDestructor(r => r[5] == "e" && id in g && g[id].destroy()) + addEventListener("shown", {
    //------------------------------------------------------------------
    "Копировать имя_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать имя"(addon, hideOn) {
        if (hideOn) return false;

        gClipboard.write(addon.name);
    },
    //------------------------------------------------------------------
    "Копировать ID_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать ID"(addon, hideOn) {
        if (hideOn) return false;

        gClipboard.write(addon.id);
    },
    //------------------------------------------------------------------
    "Копировать версию_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать версию"(addon, hideOn) {
        if (hideOn) return ["custombuttons"];

        gClipboard.write(addon.version);
    },
    //------------------------------------------------------------------
    "Копировать имя и версию_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByUlEQVQ4jY2TTUhUURiGn5tD0Sp00iAwXM1iFu4kWkUZg/9MoZQhdoUCV7ooItq4atFORRGkuLMwoc0kNBGKDLSwFpEIQgspqGUUNsjI3HvPX4s7I3Nn7oW+1fn5vvd8z3vOsYiIgXuPneFMr21ZVmh9+m7GisoPxcTsM2d46on5c1gy9bHgvDVR+afqJzNzy870xIgNUJGGkqf4XVEAuJ4XeWCiNpibX3MGr/XYPd0pADxlOK0MQgf7Xw++sfJq0zRiJQAWcgWndHRkr28UWcrlAfCVwa8KrK4XOPxbYqz/MsnWcyfFi7lCIPD9x0/70YNRykKz+eELQkny74sIJbnQmqQ71UVhe+cES2hoP9uC63mBgO/7dF7s4NexZPRmBqlBaMPHnc+kL7UTh1VxqwKuGxjkaUP+zRZCSVqwKJeP2dvdj8SqGZuod9hXhr6hGwgNL5ZfEoc1PnaL2sFNAlvvthFKxmJJbfCUqXbghhHSyTOkJwcBmHr4vAnLVwKhJEPZbLgDXwh678yG7rfjfLIJS2qD0IEP9R6kiq8XrzS+sOz9p5+asKodXB0YCQkcNBbHYUXlxP6u67dnIj9PY8QJpIC2/6iX/wDxeTOAfNDrywAAAABJRU5ErkJggg==",
    "Копировать имя и версию"(addon, hideOn) {
        if (hideOn) return ["custombuttons"];

        gClipboard.write(addon.name + " " + addon.version);
    },
    //------------------------------------------------------------------
    "Домашняя страница_i": "data:image/png;base64,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",
    "Домашняя страница"(addon, hideOn) {
        if (hideOn) return !addon.homepageURL;

        var url = addon.homepageURL;
        if (!url) {
        if (addon.reviewURL) {
        url = addon.reviewURL.replace(/\/reviews\/.*$/, "/");
        }
        }
       openURL(url);
    },
    //------------------------------------------------------------------
    "Поиск на АМО_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJGSURBVDjLjdJLSNRBHMDx78yqLZaKS75DPdgDDaFDbdJmde5QlhCJGxgpRJfqEEKnIsJLB7skQYQKZaSmdLaopPCgEvSCShCMzR5a7oq7/3l12RVtjfzBMA/4fWZ+MyOccwBM3g8HEbIdfCEhfAFnLVapOa28Uevpjrqz/WOsERJgsu9Uq5CZQzgqrJfo9BajNd5irEYn4p3OUiFExtCLmw2tawFi4l5zUMjMIau9u7K+qxeoAcoAA0wDb2OPwmfA16LiiaOHLj1edRLpkO3WmIis7+oBDgJbgQ2AH6gC6jY19N62RkcctKeVIJAhp9QgUA3kJXdONZVcq9JxPSgQoXRAyIDRth8oAXQyKdWnoCKrTD9CBv4GMqx1WGNZkeRWJKbG2hiD1Cb9FbTnzWFdY/LCdLKlgNQ84gyNKqHm0gDjqVHnxDHgA/B9RQkpaB6YklkZl62np9KBhOqwjpKFgeY2YAz4BESBWHI8Hhs6PVVSvc3v98ye4fP7T676B845nt040ip98qpWJmI9PWiU6bfWgXGN2YHcKwU7tsuc4kpUPMbU0+f8+vKt+Pitl7PLAMDI9cNBoB0hQwICzjqUp6MZvsy8yvp95BRuQUjJ75mPvH4wYo1NlJ64Mza7DPwrhi8cCOeXl/aUB4P4c/NJxKLMvpngycCrzxVFG2v/CwAMnguF80oLe8p27cQh+fnpPV/fTc95S6piXQDAw7a9YbWkezZXFbAwMx/xPFXb1D3+Y90AQF/L7kAsri9mZ4lrTd0TcYA/Kakr+x2JSPUAAAAASUVORK5CYII=",
    "Поиск на АМО"(addon, hideOn) {
        if (hideOn) return ["custombuttons","theme","plugin"];

        var url = addon.homepageURL;
        if (!url) {
        url = "https://addons.mozilla.org/search/?q="
            + encodeURIComponent(addon.name);
        }
       openURL(url);
    },
    //------------------------------------------------------------------
    "Папка установки_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABAklEQVR42mNkoBAwAjEXEAcCMTsW+U9AvB6I/+I0gJ2Noe3QJoZKASEgjwkq+h+C795lYPCKZMgC8mZg0fsfbICIIMOcF6cZkrGZ/v8fA0PndIa/7z8BXfAPqgVKv//A8GPeZoYERmE+hjmP1+AwAOgiTjOIP7HZLyjLMJNRmB/ogjMMyYzsUC8wIhQwsgCFWHAHoKAy0AARIYY5r69idwEhIKgBMgAYBq8vkGmALsyAU2QaYAwz4CiZBliADBAAGnCATANsYQbsJtMAJ5ABwGh8uZE8A4R9gAYwMzHkT8hl6Bfgxp5ecIH3Xxj+F05hyIdpUmXAnpnwge9AfJckW7EBAC/gSzisxsnmAAAAAElFTkSuQmCC",
        "Папка установки"(addon, hideOn) {
        if (hideOn) return ["custombuttons","theme","plugin"];

                    switch (addon.type) {
                    case "plugin":
                    var pathes = addon.pluginFullpath;
                    for (var i = 0; i < pathes.length; i++) {
                        this.revealPath(pathes[i]);
                    }
                    return;
                case "userchromejs":
                    var file = addon._script.file;
                    if (file.exists())
                        file.reveal();
                    return;
            }

            var gecko = parseInt(Services.appinfo.platformVersion);
            var nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", (gecko >= 14) ? "nsIFile" : "nsILocalFile",
                "initWithPath");

            var dir = Services.dirsvc.get("ProfD", Ci.nsIFile);
            dir.append("extensions");
            dir.append(addon.id);
            var fileOrDir = dir.path + (dir.exists() ? "" : ".xpi");

            try {
                (new nsLocalFile(fileOrDir)).reveal();
            } catch (ex) {
                var addonDir = /.xpi$/.test(fileOrDir) ? dir.parent : dir;
                try {
                    if (addonDir.exists()) {
                        addonDir.launch();
                    }
                } catch (ex) {
                    var uri = Services.io.newFileURI(addonDir);
                    var protSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
                    getService(Ci.nsIExternalProtocolService);
                    protSvc.loadUrl(uri);
                }
            }
    },
    //------------------------------------------------------------------
    "Файл установки_i": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA51AAAOdQG5Y1EyAAAAhklEQVQ4y6WT0QnAIAxE78Bt2v1cod3PznP9kVLTRKUGBD+Sd5eQUBJWggCWCAkAJPGXOqlUPyVKkrSPQIoCQJGE6AF4HFyGuBmrR3cGQX8Wmp2cL8Cqv5JPD5Zm1D0nFZjTjHpQ7DuI1L3iBjBS9/pvhtjr21OukVkXiX/ug6SWj4mr53wDMz1vldHlLJkAAAAASUVORK5CYII=",
        "Файл установки"(addon, hideOn) {
        if (hideOn) return ["custombuttons","theme","plugin"];

            var gecko = parseInt(Services.appinfo.platformVersion);
            var nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", (gecko >= 14) ? "nsIFile" : "nsILocalFile",
                "initWithPath");
            var dir = Services.dirsvc.get("ProfD", Ci.nsIFile); 
                        dir.append('extensions');
                        dir.append(addon.id);
                            if ( dir.exists() ) dir.launch();
                            var file = Components.classes['@mozilla.org/file/directory_service;1']
                                      .getService(Components.interfaces.nsIProperties)
                                     .get('ProfD', Components.interfaces.nsIFile);
                            file.append('extensions');
                            file.append( addon.id + '.xpi' )
                            if ( file.exists() ) file.launch(); 
                            return;
    },
    //------------------------------------------------------------------
    url: "chrome://mozapps/content/extensions/aboutaddons.html",
    handleEvent(e) {
        if (e.target.baseURI != this.url) return;
        var item = this.getItem(e.target.ownerDocument);
        var addon = item.addon = e.target.closest("addon-card").addon;
        
        for(var child of item.children) {
            var res = this[child.textContent](addon, true);
            child.hidden = Array.isArray(res)
                ? res.includes(addon.type) : res;
        }
        e.target.contains(item) || requestAnimationFrame(
            () => e.target.prepend(item)
        );
    },
    click(e) {
        e.stopPropagation();
        iconizer.item.parentNode.hide();
        this[e.target.textContent](iconizer.item.addon);
    },
    getItem(doc) {
        if (iconizer.item) {
            if (iconizer.item.ownerDocument == doc) return iconizer.item;
            iconizer.handleEvent();
        }
        var item = doc.createElement("div");
        item.id = id;
        for(var lab of this.labels) item.appendChild(
            doc.createElement("panel-item")
        ).append(lab);
        
        item.onclick = this.click;
        doc.ownerGlobal.addEventListener("unload", iconizer);
        return iconizer.item = item;
    },
    get labels() {
        delete this.labels;
        this.click = this.click.bind(this);
        if (id in g) return this.labels = (iconizer = g[id]).labs;

        g[id] = iconizer;
        var css = "", ind = 0, arr = [];
        var push = (ind, icon) => {
            var chromeImg = `chrome://custombuttons/content/${id + ind}`;
            arr.push(["override", chromeImg, icon]);
            return chromeImg;
        }
        var labs = iconizer.labs = Object.keys(this).filter(key => {
            var res = String(this[key]).startsWith('"');
            if (!res) return false;
            ind++;
            var icon = this[key + "_i"];
            if (icon) css += `\n\t#${
                id
            } > panel-item:nth-child(${ind}) {\n\t\t--icon: url(${
                push(ind, icon)
            }) !important;\n\t}`;
            return true;
        });
        var ams = Cc["@mozilla.org/addons/addon-manager-startup;1"].getService(Ci.amIAddonManagerStartup);
        var mUri = Services.io.getProtocolHandler("resource").getSubstitution("custombuttons-modules");
        iconizer.iconHelper = ams.registerChrome(mUri, arr);

        var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
        var md = "@-moz-document url(chrome://mozapps/content/extensions/aboutaddons.html) {";
        var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent(md + css + "\n}"));
        var args = [uri, sss.USER_SHEET];
        sss.loadAndRegisterSheet(...args);

        iconizer.handleEvent = function() {
            if (!this.item) return;
            this.item.ownerGlobal.removeEventListener("unload", this);
            this.item.remove();
            this.item = null;
        }
        iconizer.destroy = function() {
            delete g[id];
            this.handleEvent();
            sss.unregisterSheet(...args);
            this.iconHelper.destruct();
        }
        return this.labels = labs;
    },
    revealPath: function(path){
            var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
            file.initWithPath(path);
            if(file.exists())
                file.reveal();
        }
}, true, gBrowser.tabpanels || 1))("CBAddonsMenuExt", Cu.import("resource://gre/modules/Services.jsm", {}), {});


//Дополнительные кнопки на странице about:addons для аддонов, плагинов, тем, CB.....................................................................................

((cn, flag, css) => addEventListener("update", ({
    btnActions: ["preferences", "toggle-disabled", "remove", "install-update"],
    every(reason) {
        reason || addDestructor(this.every, this);
        var g = this.g || (this.g = Cu.import(
            "resource://gre/modules/AddonManager.jsm", {}
        ));
        var has = flag in g;
        if (reason) {
            if (!has || reason[5] != "e") return;
        } else if (has) return this;

        var method, wins = Array.from(
            g.AddonManagerInternal.addonListeners, Cu.getGlobalForObject
        ).filter(
            w => w.docShell && w.docShell.name == "html-view-browser"
        );
        if (reason) method = "destroyDoc", delete g[flag];
        else method = "initDoc", g[flag] = true;
        for(var win of new Set(wins)) this[method](win.document);
        return this;
    },
    initDoc(doc, onlyStyle) {
        if (doc[flag]) return; doc[flag] = true;
        doc.ownerGlobal.windowUtils.loadSheetUsingURIString(this.url, this.type);
        if (onlyStyle) return;
        for(var card of doc.getElementsByTagName("addon-card")) this.onCard(card);
    },
    destroyDoc(doc) {
        if (!doc[flag]) return; delete doc[flag];
        for(var span of Array.from(doc.getElementsByClassName(cn))) span.remove();
        doc.ownerGlobal.windowUtils.removeSheetUsingURIString(this.url, this.type);
    },
    get url() {
        this.type = windowUtils.USER_SHEET;
        this.btnActions = this.btnActions.map(
            action => `panel-list > panel-item[action="${action}"]`
        );
        delete this.url;
        return this.url = "data:text/css;charset=utf-8," +
            encodeURIComponent(css.replace(/;/g, " !important;"));
    },
    handleEvent(e) {
        var card = e.target;
        card.nodeName == "ADDON-CARD" && this.onCard(card);
    },
    onCard(card, again) {
        var div = card.querySelector("div.more-options-menu");
        if (!div) return again || card.ownerGlobal.requestAnimationFrame(
            () => this.onCard(card, true)
        );
        var [span] = card.getElementsByClassName(cn);
        if (span) span.textContent = "";
        else {
            var doc = card.ownerDocument;
            doc[flag] || this.initDoc(doc, true);
            div.before(span = doc.createElement("span"));
            span.className = cn;
            span.onclick = this.onclick;
        }
        var btns = this.btnActions.map(sel => {
            var item = div.querySelector(sel);
            return item && item.cloneNode(true);
        });
        var {addon} = card, cbbtn = addon.type == "custombuttons";
        for(var item of btns) if (item) {
            span.append(item);
            item.shadowRoot.querySelector("button").classList.add("cb-cloned-button");
            if (cbbtn) item.closest = this.closest;
        }
        if (addon.id != "custombuttons@xsms.org") return;
        var item = span.querySelector("[action=preferences]");
        if (item) item.removeAttribute("hidden"), item.onclick = this.cbprefs;
    },
    onclick(e) {
        InspectorUtils.removeContentState(e.target, 4, true);
        Services.focus.clearFocus(e.target.ownerGlobal);
    },
    closest(sel) {
        return sel == ".more-options-menu" || this.ownerGlobal
            .Element.prototype.closest.call(this, sel);
    },
    cbprefs(e) {
        var url = "chrome://custombuttons/content/prefs.xul";
        for(var win of Services.wm.getEnumerator(null))
            if (!win.closed && win.document.documentURI == url)
                return win.focus();
        e.view.requestAnimationFrame(() => openDialog(
            url, "", "chrome,titlebar,toolbar,centerscreen,modal"
        ));
    }
}).every(), true))("cb-cloned-buttons-container", "AAcbButtonizedFlag", `

    addon-card:not([expanded]) .card-contents {
        width: 1px;
    }
    span.cb-cloned-buttons-container {
        display: flex;
    }
    button.cb-cloned-button {
        width: auto;
        padding: 1px 6px 3px 6px;
        margin: 0 1px;
        background-image: none;
//background: #CCFFFF ;
  border: 1px solid var(--in-content-box-border-color); 

//border-style: solid;  
//border-color: #99FFFF #99FFFF;
        border-radius: 0px;

        font-size: 13px;
        font-family: Segoe UI;
    }
button.cb-cloned-button:hover {
background: gold ;
}
    button.cb-cloned-button:after {
        display: none;
    }
`);

Отсутствует

 

№1537429-03-2021 20:37:05

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 298
UA: Firefox 55.0

Re: Custom Buttons

ВВП
https://forum.mozilla-russia.org/viewtopic.php?pid=789547#p789547

Отсутствует

 

№1537530-03-2021 00:05:13

ВВП
Участник
 
Группа: Members
Зарегистрирован: 13-03-2021
Сообщений: 228
UA: Firefox 87.0

Re: Custom Buttons

Garalf
Пришлось помучиться...Геммору много, где плюсы?

Отсутствует

 

Board footer

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