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

Хотите узнать больше о расширениях? Посмотрите ролики, рассказывающие о работе с расширениями Firefox.

№112622-09-2023 09:05:44

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

fuchsfan
Сделал

Выделить код

Код:

load: [ // По событию "load"
            // { path: "special_widgets.js", ucfobj: true, }, // <-- Special Widgets
			 { path: "WinFolders.js", ucfobj: true, },
			 { path: "favicon_in_urlbar.js", ucfobj: true, },
            // { path: "auto_hide_sidebar.js", ucfobj: true, }, // <-- Auto Hide Sidebar
        ],

Все равно кнопки нет, а вот иконка сайта в адресной строке появилась.
Может дадите папку chrome, попробую заменить.

Отсутствует

 

№112722-09-2023 09:21:18

fuchsfan
Участник
 
Группа: Members
Зарегистрирован: 07-08-2023
Сообщений: 130
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

В настройках панели инструментов смотрели? В гл. окне браузера мышкой медленно поводите там, где могла бы быть кнопка, может, кнопка есть, но без иконки, под мышкой это проявится. Я отошел от ucf, но смогу проверить ваш WinFolders.js на другом компе, если выложите код.

Отсутствует

 

№112822-09-2023 09:30:41

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

Re: UCF - ваши кнопки, скрипты…

rubel пишет

Как и куда подключать ?

Я добавляю в файл -> custom_script.js
2023-09-22_102030.png

rubel пишет

UCF для FF 115-116 с правками от Dumby

Я спрашивал про версию UCF, а не про сделанные правки, кстати про правку для [firefox] 116 я в курсе, а что за правка для [firefox] 115 ?

Отредактировано kokoss (22-09-2023 10:23:21)


Win7

Отсутствует

 

№112922-09-2023 09:52:10

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

fuchsfan
Да, нашлась кнопка, но без иконки её не видно совсем.
57ad6731ba2b9982587c75fcbdeed577.png
Первая директория работает открывается, а вот вторая не появляется совсем.
Вот мой WinFolders.js

Выделить код

Код:

// Скрипт создает подмножество кнопок для запуска приложений, открытия папок и файлов
// Кнопка 1 (Открыть F:\\Firefox Backup)
try {
    CustomizableUI.createWidget({
        id: "add-openfolder1-app",
        label: "Открыть папку 1",
        tooltiptext: "Открыть D:\\1",
        defaultArea: CustomizableUI.AREA_NAVBAR,
	onCreated: btn => btn.image = "file:///D:/Portable Files/Firefox Portable/Profiles/Chrome/icons/folder1.png",
        onCommand: function(event) {
            var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
            file.initWithPath("D:\\1");
            if (file.exists()) file.launch();
        }
    });
} catch(e) {}

// Кнопка 2 (повторяем код с другим путем)
try {
    CustomizableUI.createWidget({
        id: "add-openfolder1-app",
        label: "Открыть папку 2",
        tooltiptext: "Открыть D:\\Downloads",
        defaultArea: CustomizableUI.AREA_NAVBAR,
	onCreated: btn => btn.image = "file:///D:/Portable Files/Firefox Portable/Profiles/Chrome/icons/folder1.png",
        onCommand: function(event) {
            var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
            file.initWithPath("D:\\Downloads");
            if (file.exists()) file.launch();
        }
    });
} catch(e) {}
// Следующая кнопка...

Что не правильно ?

Отсутствует

 

№113022-09-2023 09:56:26

fuchsfan
Участник
 
Группа: Members
Зарегистрирован: 07-08-2023
Сообщений: 130
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

rubel
Просто к сведению, существует расширение Async Run Applications 2021.9.7 by VitaliyV аналогичного функционала, создает кнопку с выпадающим меню, в котором пользовательские кнопки. Давненько не использовал.

Добавлено 22-09-2023 09:56:48
Ага, увидел, проверю.

Добавлено 22-09-2023 10:01:00

Выделить код

Код:

onCreated: btn => btn.image = "file:///D:/Portable Files/Firefox Portable/Profiles/Chrome/icons/folder1.png",

Измените путь на свой, в папке Chrome создайте папку icons, в нее положите иконку 16х16, 24х24 пикселя png, jpg с любым именем, в коде исправьте имя на свое. И иконка появится.

Добавлено 22-09-2023 10:03:41
Кнопки не должны иметь одинаковый ID, во втором коде измените ID кнопки на другой произвольный, хотя бы цифру 2 вместо 1

Выделить код

Код:

id: "add-openfolder1-app",

Добавлено 22-09-2023 10:11:12

rubel пишет

tooltiptext: "Открыть D:\\Downloads",

В этой строке измените всплывающую подсказку на свою

Отредактировано fuchsfan (22-09-2023 10:11:12)

Отсутствует

 

№113122-09-2023 10:23:01

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

fuchsfan
Все понял, работает. Просто добавляется еще одна кнопка. Спасибо. Но создавать множество кнопок я не хочу.
В том коде от Dumby создается кнопка с выпадающим списком директорий. Вот его хочу и применить.

Добавлено 22-09-2023 10:40:40
kokoss
Спасибо за скриншот. :beer: Нашел я эту кнопку невзрачную в настройках панели инструментов.
2a82117721666a6600498da51b4051f8.png 
Всем спасибо за внимание.

Отредактировано rubel (22-09-2023 10:40:40)

Отсутствует

 

№113222-09-2023 11:35:18

fuchsfan
Участник
 
Группа: Members
Зарегистрирован: 07-08-2023
Сообщений: 130
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

rubel пишет

кнопку невзрачную

Так можете заменить на любую свою взрачную, тем более. что эта ассоциируется с "сохранить" (стрелка вовнутрь), а не с "открыть" (стрелка наружу).

Отредактировано fuchsfan (22-09-2023 11:41:32)

Отсутствует

 

№113322-09-2023 13:21:23

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

fuchsfan
Эта кнопка была невзрачная от автора и она затерялась  в настройках панели инструментов. А теперь конечно могу её сделать на свой вкус. :)

Отсутствует

 

№113426-09-2023 00:05:15

6e73epo
Участник
 
Группа: Members
Зарегистрирован: 06-05-2022
Сообщений: 207
UA: Firefox 117.0

Re: UCF - ваши кнопки, скрипты…

fuchsfan, а чтобы кнопка открывала папку chrome в профиле, какой путь указать? Без всяких проверок на существование папки

Отсутствует

 

№113526-09-2023 03:52:26

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

Dumby
Вроде на форуме нет темы по скриптам, подключаемых по методам
метод Aris-t2   метод xiaoxiaoflood   метод Endor8
Может нужно создать тему по этим методам.
Поэтому попрошу Вас здесь посмотреть скрипт ucf-mem-indicator.js
Он перестал работать в 115. Применяю метод Endor8 для загрузки скриптов.

скрытый текст
ucf-mem-indicator.js

Выделить код

Код:

(async id => ({

  delay: 2e3,

  val: "",
  init(topic, mm) {
    Services.obs.addObserver(mm = this, topic);
    Services.obs.addObserver(function quit(s, t) {
      this.timer?.cancel();
      Services.obs.removeObserver(mm, topic);
      Services.obs.removeObserver(quit, t);
    }, "quit-application-granted");
  },
  observe(win) {
    var df = win.MozXULElement.parseXULToFragment(
      `<hbox id="${id}" tooltiptext="${
        "ЛКМ: Минимизировать потребление памяти&#xA;ПКМ: about:performance&#xA;Ctrl+ПКМ: about:debugging#/runtime/this-firefox"
      }" onclick="event.button || ${
        "memoryMinimizationButton.doMinimize(event)"
      }"><label id="${id += "-label"}"/></hbox>`
    );
    this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
    (this.observe = async win => {
      this.timer.cancel();
      await new Promise(ChromeUtils.idleDispatch);
      var clone = win.document.importNode(df, true);
      clone.firstChild.oncontextmenu = this.about;
      win.document.getElementById("star-button-box").after(clone);
      this.notify();
    })(win);
  },
  about(e) {
    var gb = e.view.gBrowser;
    gb.selectedTab = gb.addTrustedTab(`about:${
      e.ctrlKey ? "debugging#/runtime/this-firefox" : "performance"
    }`);
  },
  async notify() {
    var info = await ChromeUtils.requestProcInfo();
    var bytes = info.memory;
    for(var child of info.children) bytes += child.memory;
    this.timer.initWithCallback(this, this.delay, this.timer.TYPE_ONE_SHOT);

    var prev = this.val;
    if ((this.val = this.mgb(bytes)) != prev)
      for(var win of CustomizableUI.windows) {
        var lab = win.document.getElementById(id);
        if (lab) lab.value = this.val;
      }
  },
  mgb: bytes => bytes < 1073741824
    ? Math.round(bytes / 1048576) + "MB"
    : (bytes / 1073741824).toFixed(2) + "GB"
}).init("browser-delayed-startup-finished"))("ucf-mem-indicator");

Отсутствует

 

№113626-09-2023 04:41:59

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

Re: UCF - ваши кнопки, скрипты…

rubel пишет

Вроде на форуме нет темы по скриптам, подключаемых по методам Aris-t2

Насколько я понимаю, метод Aris-t2 не позволяет подключать скрипты «В фоне [System Principal]», поэтому UCF удобней и полезней…
кроме того, в подключении скриптов методом Aris-t2 нет ничего сложного.

Отсутствует

 

№113726-09-2023 06:59:52

fuchsfan
Участник
 
Группа: Members
Зарегистрирован: 07-08-2023
Сообщений: 130
UA: Firefox 118.0

Re: UCF - ваши кнопки, скрипты…

6e73epo пишет

а чтобы кнопка открывала папку chrome в профиле, какой путь указать?

Указать реальный путь к папке Chrome.

Выделить код

Код:

file.initWithPath("D:\\Portable Files\\Firefox Portable\\Profiles\\Chrome");
6e73epo пишет

Без всяких проверок на существование папки

Если браузер перемещен в другую директорию, чтобы скрипт сам определял путь к папке Chrome, такого не знаю, но есть кнопка для папки Profiles, а там останется один клик. И есть скрипт сложнее и побольше, который путь ко всем папкам Firefox и файлам userChrome.css, user.js определяет сам.

Отредактировано fuchsfan (26-09-2023 07:00:26)

Отсутствует

 

№113826-09-2023 07:58:50

6e73epo
Участник
 
Группа: Members
Зарегистрирован: 06-05-2022
Сообщений: 207
UA: Firefox 117.0

Re: UCF - ваши кнопки, скрипты…

fuchsfan, с пробелами не тестировал, у меня путь без пробелов. Завелось так

Выделить код

Код:

onCommand: function(event) {
	Services.dirsvc.get("UChrm", Ci.nsIFile).launch();
}

Отсутствует

 

№113926-09-2023 08:32:58

fuchsfan
Участник
 
Группа: Members
Зарегистрирован: 07-08-2023
Сообщений: 130
UA: Firefox 118.0

Re: UCF - ваши кнопки, скрипты…

rubel пишет

метод Aris-t2   метод xiaoxiaoflood   метод Endor8
Может нужно создать тему по этим методам.

Зато есть тема под названием userChrome.js https://forum.mozilla-russia.org/viewtopic.php?id=77354 и вашему посту как раз в ней место, а не в теме по ucf.

Отсутствует

 

№114026-09-2023 10:50:12

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

Dobrov пишет

кроме того, в подключении скриптов методом Aris-t2 нет ничего сложного.

Да и методом UCF тоже ничего сложного, когда его освоишь.
Дело только в том, что не все скрипты, работающие в UCF, работают методом Aris-t2.
Вот и хотелось бы их подправить по возможности. :/
fuchsfan
Запостил в той теме свой вопрос.

Отсутствует

 

№114126-09-2023 16:22:59

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

Re: UCF - ваши кнопки, скрипты…

rubel пишет

UCF для FF 115-116 с правками от Dumby. Как и куда подключать ?

ответ Всем… По этой инструкции. или читаем Шапку.
исправил версию UCF, совместимую с Firefox от 78 до 117, всё в папках Firefox, chrome/user_chrome_files

Отсутствует

 

№114227-09-2023 00:13:04

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

Re: UCF - ваши кнопки, скрипты…

Может кому пригодится, спасибо dobrov. Кстати, тут есть и хоткей, и кнопки-папки, да много чего. Удобная штука, советую) По желанию, можно подвести под личные потребности. Не пропускает в тексте, скорее всего из-за каких-то символов... пришлось так. Вставить в адресную строку.
А да, настроен немного под себя. Если что поменяйте.

Выделить код

Код:

data:text/plain;charset=UTF-8;base64,KGFzeW5jKEZmLHRFeHApPT57IC8vIGhvb2sgTW91c2VLZXlzIMKpIER1bWJ5LCBtb2QgMi4wIERvYnJvdiDQutC90L7Qv9C60Lgg0LrQvtC80LDQvdC00Ysg0YHQutC40L3igKYKVGFnPXsKCiJkb3dubG9hZHMtYnV0dG9uIjoneycrIC8v0L3Rg9C20LXQvSBTaW5nbGVIVE1MLmpzbSwg0LfQsNCy0LjRgdC40LzRi9C5IHVjZl9RdWlja1RvZ2dsZQpg4peJ77yaICAgIOKsh++4jmZvbGRlciBbRG93bmxvYWRzXQril6jvvJogICAgICAgICAgIOKenFNhdmUgUGFnZQril4nvvJogICAgICAgICAgIG9uIFBob3RvIOKenFNhdmXvuLBgKyAvL9C00LXQudGB0YLQstC40Y8g0LrQu9Cw0LLQuNGIfNC80YvRiNC4LCDQv9C+0LTRgdC60LDQt9C60LgKYOKXpy1sb25n77yaIOKsh++4jmZvbGRlciBbRG93bmxvYWRzXVxuCuKXqO+8miAgICAgICAgICAgICAgIChBbHQrUykg4p6cU2F2ZQogICAgICAgICAgICAgICB0byBTaW5nbGVIVE1MIGFsbCAvaGlnaGxpZ2h0ZWQK4peJ77yaICAgICAgICAgICAgICAgJHtGZi5DdHIoIlN1cGVyIiwiQ3RybCtTaGlmdCIpfStTIOKenGFzIFRleHRcbgril6ctZG91Ymxl77yaIG9uIFBob3RvOiBmaW5kIFNpbWlsYXIK4penK1NoaWZ077yaICAgIEdyYXBoaWNzIG9uL29mZgril6crQWx077yaICAgICAgIFNlbGVjdGlvbiBkaWFsb2cgb24vb2ZmfWAsCgoiUGFuZWxVSS1tZW51LWJ1dHRvbiI6IC8v0YLQtdC60YHRgiDQn9GA0L7RgdGC0L7QuSDRgNC10LbQuNC877iw0K3QutGB0L/QtdGA0YIKYOKXp++8miAgICAgICAgICAgICAgICBtZW51IEZpcmVmb3ggJHtGZi52ZXJ9e1xu77iwCuKXpytTaGlmdO+8miAgICAg4p6/aGVscFxufQril6ctbG9uZ++8miAgICAgICDinJUgQ2xvc2UgYnJvd3NlclxuYCArYOKXpytBbHTvvJril4nvvJog4p2QTWF4aW1pemXilIJSZXN0b3JlCgril6jvvJogICAgICAgICAgICAgICAg4oeyTWluaW1pemUge++4sGAgLyrRjdC60YHQv9C10YDRgiovKyBgCuKXqCtBbHTvvJogICAgICAgICBhYm91dDpzdXBwb3J0fQrDmC1zY3JvbGzvvJog4oaRICDipL4gUmV0dXJuIHRhYmAsCgoiem9vbXBhZ2Utd2VfZHctZGV2LWJyb3dzZXItYWN0aW9uIjoKYFxuXG7il4krQWx077yaICAgIGNsb3NlIHRhYnMgb24gdGhlIHJpZ2h0CuKXiStTaGlmdO+8miBjbG9zZSBsZWZ0YCwKCiJ0YWJzLW5ld3RhYi1idXR0b24iOgpg4peo77yaICAgICDQstC10YDQvdGD0YLRjCDQstC60LvQsNC00LrRgwril6crQWx077yaINC+0YHRgtCw0LLQuNGC0YwgMSDRgtC10LrRg9GJ0YPRjmAsCgoiaWRlbnRpdHktYm94IjogLy9kZWJ1ZyDimJEg0LrQvtC80LDQvdC00Yt80LTQtdC50YHRgtCy0LjRjyDQsiDQutC+0L3RgdC+0LvRjApg4peo77yaICAgICAgICAgICAgICAgIENvcHkgYWRkcmVzcyB0byBjbGlwYm9hcmQK4penK0FsdO+8muKXie+8miBQcm94eSBzZXR0aW5ncwp777iwXG7il6crU2hpZnTvvJogICAgIG1lZGlhVGFifQrDmC1zY3JvbGzvvJogICAgIEJyaWdodG5lc3M6IGAsCgoiZmF2ZGlycy1idXR0b24iOiAvL9Cx0L7QutC+0LLQsNGPINC/0LDQvdC10LvRjCDQvtGC0LrRgNGL0YLQsDogZGVidWcg0JLQutC7CmDil6fvvJogICAgICAgICAgICAg4piFQm9va21hcmtzCuKXqO+8miAgICAgICAgICAgICDin7NIaXN0b3J5CuKXpytBbHTvvJogICAgICBGRgril6grQWx077yaICAgICAgSG9tZSBmb2xkZXJcbgril4nvvJogICAgICAgICAgICAg4qyH77iORG93bmxvYWRzCuKXiStBbHTvvJogICAgICBVc2VyQ2hyb21lRmlsZXNcbgrDmC1zY3JvbGzvvJogICDihpEgdXNlcl9jaHJvbWVfZmlsZXMK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uLnJlcGxhY2UoLy0uKi8sJycpLAoJQ3RyKG0gPSAi4oyYIiwgdyA9ICJDdHJsKyIpe3JldHVybiB0aGlzLm9zID09ICJtYWNvc3giID8gbSA6IHd9LAoJRXhwKCl7cmV0dXJuIE51bWJlcihTZXJ2aWNlcy5wcmVmcy5nZXRCb29sUHJlZih0aGlzLnAgKydleHBlcnQnLGZhbHNlKSl9Cn0sCihuYW1lLG0gPSBGZi5FeHAoKSwgdCx6KSA9PiB7IC8v4oCmIHvQntCx0YnQuNC577iw0K3QutGB0L/QtdGA0YIgKG0gPSAxKVvvuLDigKZdfQoJdCA9IFRhZ1tuYW1lXTsgeiA9IHQubWF0Y2goLyhceykoW1xzXFNdKj8pKFx9KS9nbSk7CglpZiAoeikgei5mb3JFYWNoKChrLGgpID0+eyAvL9GC0LXQutGB0YIg0LfQsNCy0LjRgdC40YIg0L7RgiDRgNC10LbQuNC80LAKCQloID0gay5zcGxpdCgn77iwJyk7IGlmIChoICYmIGgubGVuZ3RoID4gbSkKCQkJdCA9IHQucmVwbGFjZShrLGhbbV0ucmVwbGFjZSgvXHt8XH0vZywnJykpO30pCglyZXR1cm4gdDt9IC8v0YDQsNC30LTQtdC70LjRgtC10LvRjCDQuCDQvdGD0LbQvdCw0Y8g0YfQsNGB0YLRjCDihpEKKTs=

Отредактировано b0ttle (27-09-2023 00:17:44)

Отсутствует

 

№114327-09-2023 13:46:49

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

Re: UCF - ваши кнопки, скрипты…

для совместимости с Firefox 78-117 изменил UCF так (может, что-то можно сделать лучше…)

Выделить код

Код:

// фрагмент config.js для Firefox 78-117:
this.observe = (window, topic, data, icw) => {
	try {icw = (window instanceof Ci.nsIDOMChromeWindow);}
	catch {icw = (window .isChromeWindow)} //Ff116+
	if (!icw) return;
	var docElementInserted = e => {
		var win = e.target.defaultView;
		if (icw) user_chrome.initWindow(win);

// Services в jsm-скриптах для Firefox 78-117 подключается так:
if (typeof Services != "object")
	try{var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm")} catch{var {Services} = globalThis}

// Services в js-скриптах для Firefox 78-117:
if (typeof Services != "object")
	var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Отсутствует

 

№114427-09-2023 15:35:47

Farby
Участник
 
Группа: Members
Зарегистрирован: 21-11-2012
Сообщений: 306
UA: Google 2.1

Re: UCF - ваши кнопки, скрипты…

Dobrov
наверное можно так

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

icw должна быть определена заранее

Выделить код

Код:

icw = window.isChromeWindow ? window.isChromeWindow : Ci.nsIDOMChromeWindow;
Выделить код

Код:

var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;


Жизнь иногда такое выкидывает, что хочется подобрать...

Отсутствует

 

№114527-09-2023 17:13:54

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

Re: UCF - ваши кнопки, скрипты…

Farby - значит, эти две строки создают одинаковый объект Services?


var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
var Services = ChromeUtils.import("resource://gre/modules/Services.jsm").Services;

Отсутствует

 

№114627-09-2023 17:47:21

Farby
Участник
 
Группа: Members
Зарегистрирован: 21-11-2012
Сообщений: 306
UA: Google 2.1

Re: UCF - ваши кнопки, скрипты…

Dobrov пишет

эти две строки создают одинаковый объект Services?

Да.

Кажется такая конструкция должна работать...

для config.js

Выделить код

Код:

if ((window.isChromeWindow) ? false : (window instanceof Ci.nsIDOMChromeWindow) ? false : true) return;

Добавлено 27-09-2023 18:02:12
Хотя проверил в [firefox] 58 конструкция window.isChromeWindow уже была...

Отредактировано Farby (27-09-2023 18:02:12)


Жизнь иногда такое выкидывает, что хочется подобрать...

Отсутствует

 

№114728-09-2023 05:03:04

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

Dumby
В 115 перестала нормально работать кнопка Восстановить.
В ней не раскрывается меню Недавно закрытые вкладки. В 91 все Ок.

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

Выделить код

Код:

try {(() => {
    var id = "ucf-undo-tab",
    label = "Восстановить",
    tooltiptext = "ЛКМ: Восстановить вкладку\nПКМ: Восстановить окно",
    tooltiptextbtnmenu = "ЛКМ: Открыть меню\nПКМ: Показать весь журнал",
    img = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16,12 C 16,12 3,27 3,26.81 L 24.2,48 H 45 C 46.7,48 48,46.7 48,45 V 17.3 L 40,9.3 Z'/><path style='fill:white;' d='M 27.68,3.93 C 26.7,3.93 25.66,3.992 24.58,4.138 19.23,5.17 13.74,8.472 10.22,12.78 3.018,5.815 7.525,10.29 3.021,5.815 L 3,26.81 H 24.18 L 17.03,19.7 C 20.44,14.7 30.87,6.752 38.32,19.08 40.69,25.69 40.58,36.52 35.69,44 40.97,38.26 45.35,30.55 44.98,21.33 44.59,14.08 39.37,3.992 27.68,3.93' /></g></svg>",
    imgmenu = "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><circle cy='24' cx='24' style='fill:rgb(0, 120, 173);' r='20'/><path style='opacity:0.25;fill:black;' d='M 33,41.8 22.3,31.1 36.7,17.9 44,25.2 C 43.5,30.6 41,37.7 33,41.8 Z'/><path style='fill:white;stroke:white;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;' d='M 35,19 H 13 L 24,30 35,19' /></g></svg>";

    CustomizableUI.createWidget({
        id: id,
        type: "custom",
        label: label,
        tooltiptext: tooltiptext,
        localized: false,
        defaultArea: CustomizableUI.AREA_NAVBAR,
        onBuild: function(document) {
            var win = document.defaultView, toolbaritem = document.createXULElement("toolbaritem");
            toolbaritem.id = id;
            toolbaritem.className = "chromeclass-toolbar-additional";
            toolbaritem.setAttribute("label", label);
            toolbaritem.setAttribute("type", "custom");
            var toolbarbutton_0 = document.createXULElement("toolbarbutton");
            toolbarbutton_0.id = `${id}-button`;
            toolbarbutton_0.className = "toolbarbutton-1";
            toolbarbutton_0.setAttribute("label", label);
            toolbarbutton_0.setAttribute("tooltiptext", tooltiptext);
            toolbarbutton_0.setAttribute("context", "false");
            toolbarbutton_0.addEventListener("click", function(event) {
                if (event.button == 0)
                    win.undoCloseTab();
                else if (event.button == 2) {
                    event.preventDefault();
                    event.stopPropagation();
                    win.undoCloseWindow();
                }
            });
            toolbaritem.append(toolbarbutton_0);
            var toolbarbutton_1 = document.createXULElement("toolbarbutton");
            toolbarbutton_1.id = `${id}-button-menu`;
            toolbarbutton_1.className = "toolbarbutton-1";
            toolbarbutton_1.setAttribute("type", "menu");
            toolbarbutton_1.setAttribute("label", "");
            toolbarbutton_1.setAttribute("tooltiptext", tooltiptextbtnmenu);
            toolbarbutton_1.setAttribute("context", "false");
            toolbarbutton_1.addEventListener("click", function(event) {
                if (event.button == 2) {
                    event.preventDefault();
                    event.stopPropagation();
                    win.PlacesCommandHook.showPlacesOrganizer("History");
                }
            });
            var menupopup_0 = document.createXULElement("menupopup");
            menupopup_0.id = `${id}-popup`;
            menupopup_0.setAttribute("tooltip", "bhTooltip");
            menupopup_0.setAttribute("popupsinherittooltip", true);
            menupopup_0.addEventListener("click", function(event) {
                event.stopPropagation();
            });
            menupopup_0.addEventListener("command", function(event) {
                event.stopPropagation();
            });
            var menu_0 = document.createXULElement("menu");
            menu_0.setAttribute("disabled", true);
            menu_0.setAttribute("label", "Недавно закрытые вкладки");
            var menupopup_1 = document.createXULElement("menupopup");
            menupopup_1.addEventListener("popupshowing", function(event) {
                while (menupopup_1.hasChildNodes())
                    menupopup_1.firstChild.remove();
                if (win == Services.appShell.hiddenDOMWindow || win.SessionStore.getClosedTabCount(win) == 0) {
                    menu_0.setAttribute("disabled", true);
                    return;
                }
                var tabsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getTabsFragment(win, "menuitem");
                menupopup_1.append(tabsFragment);
                menu_0.removeAttribute("disabled");
            });
            menu_0.append(menupopup_1);
            menupopup_0.append(menu_0);
            var menu_1 = document.createXULElement("menu");
            menu_1.setAttribute("disabled", true);
            menu_1.setAttribute("label", "Недавно закрытые окна");
            var menupopup_2 = document.createXULElement("menupopup");
            menupopup_2.addEventListener("popupshowing", function(event) {
                while (menupopup_2.hasChildNodes())
                    menupopup_2.firstChild.remove();
                if (win.SessionStore.getClosedWindowCount() == 0) {
                    menu_1.setAttribute("disabled", true);
                    return;
                }
                var windowsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getWindowsFragment(win, "menuitem");
                menupopup_2.append(windowsFragment);
                menu_1.removeAttribute("disabled");
            });
            menu_1.append(menupopup_2);
            menupopup_0.append(menu_1);
            menupopup_0.addEventListener("popupshowing", function(event) {
                if (win == Services.appShell.hiddenDOMWindow || win.SessionStore.getClosedTabCount(win) == 0)
                    menu_0.setAttribute("disabled", true);
                else
                    menu_0.removeAttribute("disabled");
                if (win.SessionStore.getClosedWindowCount() == 0)
                    menu_1.setAttribute("disabled", true);
                else
                    menu_1.removeAttribute("disabled");
            });
            var menuitem_0 = document.createXULElement("menuitem");
            menuitem_0.id = `${id}-all-history`;
            menuitem_0.setAttribute("label", "Показать весь журнал");
            menuitem_0.addEventListener("command", function(event) {
                event.stopPropagation();
                win.PlacesCommandHook.showPlacesOrganizer("History");
            });
            menupopup_0.append(menuitem_0);
            var menuitem_1 = document.createXULElement("menuitem");
            menuitem_1.setAttribute("label", "Удалить недавнюю историю…");
            menuitem_1.addEventListener("command", function(event) {
                event.stopPropagation();
                win.Sanitizer.showUI(win);
            });
            menupopup_0.append(menuitem_1);
            toolbarbutton_1.append(menupopup_0);
            toolbaritem.append(toolbarbutton_1);
            var btnstyle = "data:text/css;charset=utf-8," + encodeURIComponent(`
                #${id}-button {
                    list-style-image: url("${img}") !important;
                    -moz-image-region: rect(0px, 16px, 16px, 0px) !important;
                    margin-inline-end: 0 !important;
                }
                #${id}-button-menu {
                    list-style-image: url("${imgmenu}") !important;
                    -moz-image-region: rect(0px, 16px, 16px, 0px) !important;
                    margin-inline-start: 0px !important;
                }
                toolbarpaletteitem[place="palette"] #${id}-button-menu,
                #${id}-button-menu dropmarker {
                    display: none !important;
                }
                toolbarpaletteitem[place="palette"] #${id} {
                    -moz-box-orient: vertical !important;
                }
                #${id}-button-menu > .toolbarbutton-icon {
                    min-width: 0 !important;
                    max-width: none !important;
                    width: auto !important;
                    padding-left: 0 !important;
                    padding-right: 0 !important;
                }
            `);
            try {
                win.windowUtils.loadSheetUsingURIString(btnstyle, win.windowUtils.USER_SHEET);
            } catch (e) {}
            return toolbaritem;
        }
    });
})();} catch(e) {}

Отсутствует

 

№114828-09-2023 09:16:43

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

Re: UCF - ваши кнопки, скрипты…

rubel
Замените в коде -> getClosedTabCount -> в двух местах на ->  getClosedTabCountForWindow


Win7

Отсутствует

 

№114928-09-2023 09:42:03

rubel
Участник
 
Группа: Members
Откуда: г.Самара
Зарегистрирован: 10-05-2005
Сообщений: 570
UA: Firefox 115.0

Re: UCF - ваши кнопки, скрипты…

kokoss
Заменил, все прекрасно заработало. :)

Отсутствует

 

№115028-09-2023 15:32:00

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

Re: UCF - ваши кнопки, скрипты…

rubel пишет

кнопка Восстановить – не раскрывается меню "Недавно закрытые вкладки"

У тебя старая версия. В новом коде строки Закрытых вкладок сразу в выпадающее меню кнопки добавляются.

Восстановить Закрытые вкладки/окна - модификация без dropmarker

Выделить код

Код:

try {(() => {
	var id = "ucf-undo-tab", label = "Закрытые вкладки/окна",
	tooltiptextbtnmenu = "ЛКМ: Открыть меню\nПКМ: Восстановить вкладку\nСКМ: Показать весь журнал";
	CustomizableUI.createWidget({
		id: id, label: label, type: "custom", localized: false,
		onBuild(doc) {
			var win = doc.defaultView, trim = doc.createXULElement("toolbaritem");
			trim.id = id;
			trim.className = "toolbaritem-combined-buttons ucf-toolbaritem-combined-buttons chromeclass-toolbar-additional";
			trim.setAttribute("label", label);
			trim.setAttribute("type", "custom");
			trim.style.setProperty("margin-inline","0");
			var trbn_1 = doc.createXULElement("toolbarbutton");
			trbn_1.id = `${id}-button-menu`;
			trbn_1.className = "toolbarbutton-1 ucf-toolbarbutton-combined-buttons-toolbarbutton";
			trbn_1.setAttribute("type", "menu");
			trbn_1.setAttribute("label", "");
			trbn_1.setAttribute("image", "data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 48 48'><g><rect x='0' y='0' width='48' height='48' rx='3' ry='3' style='fill:rgb(0, 120, 173);'/><path style='opacity:0.25;fill:black;' d='M 16,12 C 16,12 3,27 3,26.81 L 24.2,48 H 45 C 46.7,48 48,46.7 48,45 V 17.3 L 40,9.3 Z'/><path style='fill:white;' d='M 27.68,3.93 C 26.7,3.93 25.66,3.992 24.58,4.138 19.23,5.17 13.74,8.472 10.22,12.78 3.018,5.815 7.525,10.29 3.021,5.815 L 3,26.81 H 24.18 L 17.03,19.7 C 20.44,14.7 30.87,6.752 38.32,19.08 40.69,25.69 40.58,36.52 35.69,44 40.97,38.26 45.35,30.55 44.98,21.33 44.59,14.08 39.37,3.992 27.68,3.93' /></g></svg>");
			trbn_1.setAttribute("tooltiptext", tooltiptextbtnmenu);
			trbn_1.setAttribute("context", "");
			trbn_1.addEventListener("click", e => {
				if (e.button == 1)
					win.PlacesCommandHook.showPlacesOrganizer("History");
				else if (e.button == 2) {
					e.preventDefault(); e.stopPropagation();
					win.undoCloseTab();
				}
			});
			var mupp_0 = doc.createXULElement("menupopup");
			mupp_0.id = `${id}-popup`;
			mupp_0.setAttribute("tooltip", "bhTooltip");
			mupp_0.setAttribute("popupsinherittooltip", true);
			mupp_0.addEventListener("click", e => {
				e.stopPropagation();
			});
			mupp_0.addEventListener("command", e => {
				e.stopPropagation();
			});
			var muim_0 = doc.createXULElement("menuitem");
			muim_0.id = `${id}-all-history`;
			muim_0.className = "ucf-menuitem";
			muim_0.setAttribute("label", "Показать весь журнал");
			muim_0.addEventListener("command", e => {
				e.stopPropagation();
				win.PlacesCommandHook.showPlacesOrganizer("History");
			});
			mupp_0.append(muim_0);
			var muim_1 = doc.createXULElement("menuitem");
			muim_1.id = `${id}-sanitize`;
			muim_1.className = "ucf-menuitem";
			muim_1.setAttribute("label", "Удалить недавнюю историю…");
			muim_1.addEventListener("command", e => {
				e.stopPropagation();
				win.Sanitizer.showUI(win);
			});
			mupp_0.append(muim_1);
			var muim_2 = doc.createXULElement("menuitem");
			muim_2.id = `${id}-session`;
			muim_2.className = "ucf-menuitem";
			muim_2.setAttribute("hidden", "true");
			muim_2.setAttribute("label", "Восстановить последнюю сессию");
			muim_2.addEventListener("command", e => {
				e.stopPropagation();
				win.SessionStore.restoreLastSession();
			});
			mupp_0.append(muim_2);
			var menu_0 = doc.createXULElement("menu");
			menu_0.id = `${id}-menu-closed-win`;
			menu_0.setAttribute("hidden", "true");
			menu_0.setAttribute("label", "Недавно закрытые окна");
			var mupp_1 = doc.createXULElement("menupopup");
			var muim_3 = doc.createXULElement("menuitem");
			muim_3.id = `${id}-item-closed-win`;
			muim_3.className = "ucf-menuitem";
			muim_3.setAttribute("hidden", "true");
			muim_3.setAttribute("label", "Забыть закрытые окна");
			muim_3.addEventListener("command", e => {
				e.stopPropagation();
				var sessionStore = win.SessionStore;
				var count = sessionStore.getClosedWindowCount();
				while(count--)
					sessionStore.forgetClosedWindow(0);
			});
			mupp_1.append(muim_3);
			var musr_0 = doc.createXULElement("menuseparator");
			musr_0.id = `${id}-sep-closed-win`;
			musr_0.className = "ucf-menuseparator";
			musr_0.setAttribute("hidden", "true");
			mupp_1.append(musr_0);
			mupp_1.addEventListener("popupshowing", e => {
				e.stopPropagation();
				for (let item of mupp_1.querySelectorAll(":scope > :is(menuitem:not(.ucf-menuitem), menuseparator:not(.ucf-menuseparator))"))
					item.remove();
				if (win.SessionStore.getClosedWindowCount() == 0) {
					muim_3.setAttribute("hidden", "true");
					musr_0.setAttribute("hidden", "true");
					return;
				}
				if ("RecentlyClosedTabsAndWindowsMenuUtils" in win) {
					muim_3.removeAttribute("hidden");
					musr_0.removeAttribute("hidden");
					var windowsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getWindowsFragment(win, "menuitem");
					mupp_1.append(windowsFragment);
					menu_0.removeAttribute("hidden");
				}
			});
			menu_0.append(mupp_1);
			mupp_0.append(menu_0);
			var musr_1 = doc.createXULElement("menuseparator");
			musr_1.className = "ucf-menuseparator";
			musr_1.setAttribute("hidden", "true");
			mupp_0.append(musr_1);
			var muim_4 = doc.createXULElement("menuitem");
			muim_4.id = `${id}-item-closed-tabs`;
			muim_4.className = "ucf-menuitem";
			muim_4.setAttribute("hidden", "true");
			muim_4.setAttribute("label", "Забыть закрытые вкладки");
			muim_4.addEventListener("command", e => {
				e.stopPropagation();
				var sessionStore = win.SessionStore, count;
				try{count = sessionStore.getClosedTabCountForWindow(win);} catch(e){count = sessionStore.getClosedTabCount(win)}
				while(count--)
					sessionStore.forgetClosedTab(win, 0);
			});
			mupp_0.append(muim_4);
			var musr_2 = doc.createXULElement("menuseparator");
			musr_2.id = `${id}-sep-closed-tabs`;
			musr_2.className = "ucf-menuseparator";
			musr_2.setAttribute("hidden", "true");
			mupp_0.append(musr_2);
			mupp_0.addEventListener("popupshowing", e => {
				var sessionStore = win.SessionStore;
				if (sessionStore.getClosedWindowCount() == 0)
					menu_0.setAttribute("hidden", "true");
				else
					menu_0.removeAttribute("hidden");
				if (!sessionStore.canRestoreLastSession)
					muim_2.setAttribute("hidden", "true");
				else
					muim_2.removeAttribute("hidden");
				for (let item of mupp_0.querySelectorAll(":scope > :is(menuitem:not(.ucf-menuitem), menuseparator:not(.ucf-menuseparator))"))
					item.remove();
				try{var sSgCTC = sessionStore.getClosedTabCountForWindow(win);} catch(e){var sSgCTC = sessionStore.getClosedTabCount(win)}
				if (win == Services.appShell.hiddenDOMWindow || sSgCTC == 0) {
					musr_1.setAttribute("hidden", "true");
					muim_4.setAttribute("hidden", "true");
					musr_2.setAttribute("hidden", "true");
					return;
				}
				if ("RecentlyClosedTabsAndWindowsMenuUtils" in win) {
					musr_1.removeAttribute("hidden");
					muim_4.removeAttribute("hidden");
					musr_2.removeAttribute("hidden");
					var tabsFragment = win.RecentlyClosedTabsAndWindowsMenuUtils.getTabsFragment(win, "menuitem");
					mupp_0.append(tabsFragment);
				}
			});
			trbn_1.append(mupp_0);
			trim.append(trbn_1);
			return trim;
		}
	});
})()} catch(e){}

Ошибки исправлены, копка теперь пашет на версиях Firefox от 84 (может и меньше) до Firefox 118.
Напомню, что в Шапке есть  Ссылка на обновляемые скрипты

Отредактировано Dobrov (29-09-2023 03:49:02)

Отсутствует

 

Board footer

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