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

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

№1002608-04-2021 09:43:18

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

Re: Настройка внешнего вида Firefox в userChrome.css

xrun1

AtributesInspector - + Dom Inspector - запомнить или скопировать шнягу и  убрать через chrome\toolkit\content\mozapps\extensions\aboutaddons.css
pkwtg3wr.jpg

Отредактировано ВВП (08-04-2021 10:06:49)

Отсутствует

 

№1002709-04-2021 00:51:29

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

Re: Настройка внешнего вида Firefox в userChrome.css

Даже не знаю, почему у меня так, а у других всё работает... Чистый профиль, стили от Aris-t2 с включением в userContent.css, как советовал kokoss. Возвращение родного omni.ja, удаление config.js - ничего не помогало. А решился вопрос элементарно добавлением конкретно url("about:addons") :D

Выделить код

Код:

/* Убирает жёлтые прежупреждения в about:addons https://forum.mozilla-russia.org/viewtopic.php?pid=773791#p773791 */
@-moz-document url("about:addons"), url-prefix("chrome://mozapps/content/extensions/aboutaddons.html") {
  message-bar.addon-card-message[type="warning"] {
    display: none !important;
  }
}

Отсутствует

 

№1002809-04-2021 01:52:17

sandro79
Участник
 
Группа: Members
Зарегистрирован: 15-11-2017
Сообщений: 1750
UA: Firefox 78.0

Re: Настройка внешнего вида Firefox в userChrome.css

xrun1 пишет

стили от Aris-t2 с включением в userContent.css, как советовал kokoss

Ещё раз повторюсь, тот код (addonlists_hide_recommended_icon) убирает вот это
25f9fe1010eb.png
У Aris-t2 нет в комплекте кода убирающего жёлтые предупреждения.

Отсутствует

 

№1002909-04-2021 02:31:51

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

Re: Настройка внешнего вида Firefox в userChrome.css

sandro79
:offtopic: Немедленно сообщить! ;)

скрытый текст
Шутка. Лично я не смогу по причине отсутствия аккаунта на гитхабе, а просить ещё раз Acid Crash не вижу необходимости. Он и так один раз мне помог.
https://github.com/Aris-t2/CustomCSSforFx/issues/333

Отсутствует

 

№1003009-04-2021 06:11:36

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

Re: Настройка внешнего вида Firefox в userChrome.css

5yxupail.png
custom_style_agent.css или custom_style_author.css
*|a[is="support-link"] {display: none !important;}

Отредактировано ВВП (09-04-2021 06:16:08)

Отсутствует

 

№1003109-04-2021 08:32:38

voqabuhe
Участник
 
Группа: Members
Зарегистрирован: 06-12-2011
Сообщений: 3231
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

sandro79 пишет

Ещё раз повторюсь, тот код (addonlists_hide_recommended_icon) убирает вот это

А зачем "вот это" скрывать? Чего плохого, если будет сразу видно, что расширение из рекомендованных?

Отредактировано voqabuhe (09-04-2021 08:33:00)

Отсутствует

 

№1003209-04-2021 09:05:08

css
Участник
 
Группа: Members
Зарегистрирован: 07-04-2014
Сообщений: 186
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

Здравствуйте. Установила новую версию ФФ, переключилась на старый профиль, но нижняя панель не появилась. Как её вернуть? Подскажите, пожалуйста

Отсутствует

 

№1003310-04-2021 03:11:50

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

Re: Настройка внешнего вида Firefox в userChrome.css

Vitaliy V. - твой код: Открыть ссылку в… не работает, в консоли браузера при клике на пункт меню никаких сообщений нет.
window.exec(path, arg); // эта строка тоже ничего не запускает
при этом строка, следующая за кодом запуска плеера, показывает верный путь и аргументы:

Выделить код

Код:

var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
process.init(file);
event.view.alert("process: "+ path +'\n'+ arg);

вот мой скрипт custom_script_win.js

Выделить код

Код:

// Этот скрипт работает в главном окне браузера если включено в настройках

var ucf_custom_script_win = {
	initialized: false,
	get unloadlisteners() {
		delete this.unloadlisteners;
		window.addEventListener("unload", this, { once: true });
		return this.unloadlisteners = [];
	},
	load() {
		if (this.initialized)
			return;
		this.initialized = true;
		// this.specialwidgets.init(); // <-- Special Widgets
		// this.autohidesidebar.init(); // <-- Auto Hide Sidebar
		/* ************************************************ */

		// Здесь может быть ваш код который сработает по событию "load" не раньше
		this.contextmenuopenwith.constructor();

		/* ************************************************ */
	},
// https://forum.mozilla-russia.org/viewtopic.php?pid=782454#p782454
	contextmenuopenwith: {
		_eventlisteners: [],
		constructor: function() {
			var attrimage = true; // true или false Добавить иконки (атрибут "image") или нет
			var submenu = false; // true или false Добавить подменю для пунктов или нет
			// ['ID пункта', 'имя приложения', 'путь к приложению', 'аргументы через пробел (то что в двойных кавычках считается за один аргумент)', 'иконка (для ОС Windows необязательно)'],
			var arrayWindows = [ // для Windows
				['edge', 'Microsoft Edge', 'C:\\Windows\\explorer.exe', '"microsoft-edge:%OpenURI "', 'moz-icon://file://C:\\Windows\\SystemApps\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\\MicrosoftEdge.exe?size=16'],
				['potplayer', 'DAUM PotPlayer', 'C:\\Program Files\\DAUM\\PotPlayer\\PotPlayerMini64.exe', '%OpenURI'],
			];
			var arrayLinux = [ // для Linux
				['smplayer', 'SMPlayer', '/usr/bin/smplayer', '%OpenURI', 'moz-icon://stock/smplayer?size=menu'],
				['uget', 'uGet', '/usr/bin/uget-gtk', '%OpenURI', 'moz-icon://stock/uget-icon?size=menu'],
			];
			var arrayMacos = [ // для MacOS
				['mpv', 'плеере MPV', '/usr/local/bin/mpv', '%OpenURI', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABTUlEQVR4AWLAAzhQMLEA0DcVQlkIAsGLPxqNRKPRSDQajUSj0Wi8aCQajcYfjT8aiUSj0ba3o8LjeOeFefLYmWF2wTwpRJlWQyXqlXHcMNhD7d8TmaSYvDPoATs4fyZCISS3siPdjiewDmvgRrFldkelOlO0zB/a9/0XlmlBzZkc0ITRtXN34qHVZI0919u2nXizSZBCu1YS3rBX7N6diNiMlsbviay1MMA3bMdA6wwI0N3oDZqiJVU0VOeKlGxont4w4GSDTxEaHLGByi9xldVspGge58ug8QYHtFELne8XA4N46DUZYyDGN2zBegMeyOhiYVAw6Oqe1s8KoRcjheNB4wxe4pXJ8BphAlEsDq9RfAkZPqi0SGQXPyRcJYYWPyRwoYl/HMGF3iV5wAEOuP702ISjlTItJ+7RQgBgjT3UnsShSXKT8ggCtVj8A74ffTID9y0eAAAAAElFTkSuQmCC'],
			];

			var arrayOS, platform = AppConstants.platform, length;
			if (platform == "win")
				arrayOS = arrayWindows;
			else if (platform == "linux")
				arrayOS = arrayLinux;
			else if (platform == "macosx")
				arrayOS = arrayMacos;
			else
				return;
			if (!(length = arrayOS.length))
				return;
			var addEventListener = this.addEventListener.bind(this);
			ucf_custom_script_win.unloadlisteners.push("contextmenuopenwith");
			var popup = document.querySelector("#contentAreaContextMenu"), seppage = popup.querySelector("#context-sep-viewbgimage"), sepopen = popup.querySelector("#context-sep-copylink"),
			fragpage = document.createDocumentFragment(), fraglink = document.createDocumentFragment(), subpage = "", sublink = "";
			if (length == 1)
				submenu = false;
			if (!submenu) {
				subpage = "Открыть страницу в ";
				sublink = "Открыть ссылку в ";
			}
			arrayOS.forEach(item => {
				var id = item[0], name = item[1], path = item[2], arg = !item[3] ? "" : item[3], iconpath;
				if (!id || !name || !path)
					return;
				var menuitem_0 = document.createXULElement("menuitem");
				menuitem_0.id = `open-current-page-with-${id}`;
				menuitem_0.className = "menuitem-iconic open-current-page-with-application";
				menuitem_0.setAttribute("label", `${subpage}${name}`);
				menuitem_0.applicationpath = path;
				menuitem_0.applicationarg = arg;
				if (attrimage) {
					iconpath = !item[4] ? (`moz-icon://file://${path}?size=16`) : item[4];
					menuitem_0.setAttribute("image", iconpath);
				}
				fragpage.append(menuitem_0);
				addEventListener(menuitem_0, "command", function(event) {
					try {
						event.view.alert("Press OK");
						var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
						file.initWithPath(target.applicationpath);
						if (!file.exists() || !file.isExecutable()) return;
						arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => {
							if (/%OpenURI/g.test(sp)) {
								let uri = gBrowser.selectedBrowser.currentURI.displaySpec;
								try {
									let _uri;
									if (_uri = ReaderMode.getOriginalUrl(uri))
										uri = Services.io.newURI(_uri).displaySpec;
								} catch(e) {}
								try {
									uri = decodeURIComponent(uri);
								} catch(e) {}
								return sp.replace(/^"|"$/g, "").replace("%OpenURI", uri);
							}
							return sp.replace(/^"|"$/g, "");
						}) : [];
						var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
						process.init(file);
						process.runwAsync(arg, arg.length);
					} catch(e) {}
				});
				var menuitem_1 = document.createXULElement("menuitem");
				menuitem_1.id = `open-link-with-${id}`;
				menuitem_1.className = "menuitem-iconic open-link-with-application";
				menuitem_1.setAttribute("label", `${sublink}${name}`);
				menuitem_1.applicationpath = path;
				menuitem_1.applicationarg = arg;
				if (attrimage)
					menuitem_1.setAttribute("image", iconpath);
				fraglink.append(menuitem_1);
				addEventListener(menuitem_1, "command", function(event) {
					try {
						var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
						file.initWithPath(target.applicationpath);
						if (!file.exists() || !file.isExecutable() || !window?.gContextMenu?.linkURI?.displaySpec) return;
						arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => {
							if (/%OpenURI/g.test(sp)) {
								let uri = gContextMenu.linkURI.displaySpec;
								try {
									let _uri;
									if (_uri = ReaderMode.getOriginalUrl(uri))
										uri = Services.io.newURI(_uri).displaySpec;
								} catch(e) {}
								try {
									uri = decodeURIComponent(uri);
								} catch(e) {}
								return sp.replace(/^"|"$/g, "").replace("%OpenURI", uri);
							}
							return sp.replace(/^"|"$/g, "");
						}) : [];
						var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
						process.init(file);
						event.view.alert("process: "+ path +'\n'+ arg);
					} catch(e) {}
				});
			});
			if (!submenu) {
				seppage.before(fragpage);
				sepopen.before(fraglink);
			} else {
				let menu = document.createXULElement("menu");
				menu.id = "open-current-page-with-submenu";
				menu.className = "menu-iconic open-current-page-with-application";
				menu.setAttribute("label", "Открыть страницу в...");
				let menupopup = document.createXULElement("menupopup");
				menupopup.append(fragpage);
				menu.append(menupopup);
				seppage.before(menu);
				menu = document.createXULElement("menu");
				menu.id = "open-link-with-submenu";
				menu.className = "menu-iconic open-link-with-application";
				menu.setAttribute("label", "Открыть ссылку в...");
				menupopup = document.createXULElement("menupopup");
				menupopup.append(fraglink);
				menu.append(menupopup);
				sepopen.before(menu);
			}
			var style = "data:text/css;charset=utf-8," + encodeURIComponent(`
				#contentAreaContextMenu :-moz-any(#context-copylink,#context-copyemail):not([hidden="true"]) ~ .open-current-page-with-application,
				#contentAreaContextMenu #context-copyemail[hidden="true"] ~ #context-copylink[hidden="true"] ~ .open-link-with-application {
					display: none !important;
				}
			`);
			windowUtils.loadSheetUsingURIString(style, windowUtils.USER_SHEET);
		},
		addEventListener: function(...arr) {
			var elm = arr[0];
			if (!elm)
				return;
			elm.addEventListener(...arr.slice(1));
			this._eventlisteners.push(arr);
		},
		destructor: function() {
			for(var arr of this._eventlisteners)
				arr.shift().removeEventListener(...arr);
			delete this._eventlisteners;
		}
	}, // END contextmenuopenwith
	handleEvent(e) {
		this[e.type](e);
	},
	unload() {
		this.unloadlisteners.forEach(str => {
			try {
				this[str].destructor();
			} catch (e) {}
		});
	},
	specialwidgets: {
		_timer: null,
		get Customizable() {
			delete this.Customizable;
			if ("createSpecialWidget" in CustomizableUI)
				return this.Customizable = CustomizableUI;
			var scope = null;
			try {
				scope = Cu.import("resource:///modules/CustomizableUI.jsm", {}).CustomizableUIInternal;
			} catch (e) { }
			return this.Customizable = scope;
		},
		init() {
			if (!("CustomizableUI" in window) || !("gCustomizeMode" in window))
				return;
			ucf_custom_script_win.unloadlisteners.push("specialwidgets");
			window.addEventListener("customizationready", this);
		},
		destructor() {
			window.removeEventListener("customizationready", this);
		},
		handleEvent(e) {
			this[e.type](e);
		},
		customizationchange() {
			clearTimeout(this._timer);
			this._timer = setTimeout(() => {
				this.createSpecialWidgets();
			}, 1000);
		},
		customizationready() {
			if (!this.Customizable)
				return;
			this.createSpecialWidgets();
			window.addEventListener("customizationchange", this);
			window.addEventListener("customizationending", this);
		},
		customizationending() {
			window.removeEventListener("customizationchange", this);
			window.removeEventListener("customizationending", this);
		},
		createSpecialWidgets() {
			try {
				let fragment = document.createDocumentFragment();
				if (this.findSpecialWidgets("spring")) {
					let spring = this.Customizable.createSpecialWidget("spring", document);
					spring.setAttribute("label", "Растягивающийся интервал");
					fragment.append(gCustomizeMode.wrapToolbarItem(spring, "palette"));
				}
				if (this.findSpecialWidgets("spacer")) {
					let spacer = this.Customizable.createSpecialWidget("spacer", document);
					spacer.setAttribute("label", "Интервал");
					fragment.append(gCustomizeMode.wrapToolbarItem(spacer, "palette"));
				}
				if (this.findSpecialWidgets("separator")) {
					let separator = this.Customizable.createSpecialWidget("separator", document);
					separator.setAttribute("label", "Разделитель");
					fragment.append(gCustomizeMode.wrapToolbarItem(separator, "palette"));
				}
				gCustomizeMode.visiblePalette.append(fragment);
			} catch (e) {}
		},
		findSpecialWidgets(string) {
			try {
				if (!gCustomizeMode.visiblePalette.querySelector(`toolbar${string}[id^="customizableui-special-${string}"]`))
					return true;
			} catch (e) {}
			return false;
		}
	},
	autohidesidebar: {
		events: ["dragenter", "drop", "dragexit", "MozLayerTreeReady"],
		init() {
			var sidebar = this.sidebar = document.querySelector("#sidebar-box");
			if (!sidebar) return;
			for (let type of this.events)
				sidebar.addEventListener(type, this);
			ucf_custom_script_win.unloadlisteners.push("autohidesidebar");
			var popup = this.popup = document.querySelector("#sidebarMenu-popup");
			if (!popup) return;
			popup.addEventListener("popupshowing", this);
		},
		destructor() {
			var sidebar = this.sidebar;
			for (let type of this.events)
				sidebar.removeEventListener(type, this);
			if (!this.popup) return;
			this.popup.removeEventListener("popupshowing", this);
		},
		handleEvent(e) {
			this[e.type](e);
		},
		MozLayerTreeReady(e) {
			if (e.originalTarget?.id == "webext-panels-browser" && !this.sidebar.hasAttribute("sidebardrag")) {
				window.addEventListener("mousedown", () => {
					this.drop();
				}, { once: true });
				this.dragenter();
			}
		},
		popupshowing() {
			this.popup.addEventListener("popuphidden", () => {
				this.drop();
			}, { once: true });
			this.dragenter();
		},
		dragenter() {
			if (!this.sidebar.hasAttribute("sidebardrag"))
				this.sidebar.setAttribute("sidebardrag", "true");
		},
		drop() {
			if (this.sidebar.hasAttribute("sidebardrag"))
				this.sidebar.removeAttribute("sidebardrag");
		},
		dragexit(e) {
			var sidebar = this.sidebar;
			var boxObj = sidebar.getBoundingClientRect(), boxScrn = !sidebar.boxObject ? sidebar : sidebar.boxObject;
			if ((!e.relatedTarget || e.screenY <= (boxScrn.screenY + 5) || e.screenY  >= (boxScrn.screenY + boxObj.height - 5)
				|| e.screenX <= (boxScrn.screenX + 5) || e.screenX >= (boxScrn.screenX + boxObj.width - 5))
				&& sidebar.hasAttribute("sidebardrag"))
				sidebar.removeAttribute("sidebardrag");
		}
	},
};

if (window.document.readyState != "complete") {
	window.addEventListener("load", function load() {
		ucf_custom_script_win.load();
	}, { once: true });
} else
	ucf_custom_script_win.load();

Вторая просьба - убрать абсолютные пути запуска приложений и подставлять путь к исполняемому файлу так:
$(which mpv) – такой подход будет работать практически на всех дистрибутивах и можно объединить код МакОС и Линукса в один.

Отредактировано Dobrov (10-04-2021 12:43:08)

Отсутствует

 

№1003410-04-2021 10:42:52

Алексей У.
Участник
 
Группа: Members
Зарегистрирован: 10-04-2021
Сообщений: 159
UA: Firefox 68.0

Re: Настройка внешнего вида Firefox в userChrome.css

С недавнего времени на сайте YouTube изменился дизайн скроллбара, который теперь подменяет собой системый. Системный появляется при загрузке страницы на долю секунды, а затем исчезает, вместо него появляется скроллбар сайта. Возможно ли (если возможно, то как) с помощью css вернуть системное оформление (Windows 7, Firefox 68)?
01.jpg

Отсутствует

 

№1003510-04-2021 13:19:58

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

Re: Настройка внешнего вида Firefox в userChrome.css

Dobrov
Исходный код Vitaliy V. "Открыть ссылку в..." у меня прекрасно работает на Win10x64 в [firefox] 87.0. И раньше работал без нареканий.

кусочек custom_script_win.js

Выделить код

Код:

contextmenuopenwith: {
        _eventlisteners: [],
        constructor: function() {
            var attrimage = true; // true или false Добавить иконки (атрибут "image") или нет
            var submenu = true; // true или false Добавить подменю для пунктов или нет
            // ['ID пункта', 'имя приложения', 'путь к приложению', 'аргументы через пробел (то что в двойных кавычках считается за один аргумент)', 'иконка (для ОС Windows необязательно)'],
            var arrayWindows = [ // для Windows
                ['iexplore', 'IE', 'C:\\Program Files\\Internet Explorer\\iexplore.exe', '%OpenURI'],
                ['edge', 'Microsoft Edge', 'C:\\Windows\\explorer.exe', '"microsoft-edge:%OpenURI "', 'moz-icon://file://C:\\Windows\\SystemApps\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\\MicrosoftEdge.exe?size=16'],
                ['opera', 'Opera', 'c:\\XXX\\Opera\\74.0.3911.203\\opera.exe', '--ran-launcher --enable-smooth-scrolling %OpenURI'],
                ['cent', 'Cent', 'C:\\XXX\\Cent\\chrome.exe', '%OpenURI'],
                ['potplayer', 'DAUM PotPlayer', 'C:\\Program Files\\PotPlayer\\PotPlayerMini64.exe', '%OpenURI'],
                ['vlc', 'VLC', 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe', '%OpenURI'],
            ];
            var arrayLinux = [ // для Linux
                ['smplayer', 'SMPlayer', '/usr/bin/smplayer', '%OpenURI', 'moz-icon://stock/smplayer?size=menu'],
                ['vlc', 'VLC', '/usr/bin/vlc', '%OpenURI', 'moz-icon://stock/vlc?size=menu'],
                ['uget', 'uGet', '/usr/bin/uget-gtk', '%OpenURI', 'moz-icon://stock/uget-icon?size=menu'],
            ];
            var arrayMacos = [ // для MacOS
                [],
            ];

            var arrayOS, platform = AppConstants.platform, length;
            if (platform == "win")
                arrayOS = arrayWindows;
            else if (platform == "linux")
                arrayOS = arrayLinux;
            else if (platform == "macosx")
                arrayOS = arrayMacos;
            else
                return;
            if (!(length = arrayOS.length))
                return;
            var addEventListener = this.addEventListener.bind(this);
            ucf_custom_script_win.unloadlisteners.push("contextmenuopenwith");
            var popup = document.querySelector("#contentAreaContextMenu"), seppage = popup.querySelector("#context-sep-viewbgimage"), sepopen = popup.querySelector("#context-sep-open"),
            fragpage = document.createDocumentFragment(), fraglink = document.createDocumentFragment(), subpage = "", sublink = "";
            if (length == 1)
                submenu = false;
            if (!submenu) {
                subpage = "Открыть страницу в ";
                sublink = "Открыть ссылку в ";
            }
            arrayOS.forEach(item => {
                var id = item[0], name = item[1], path = item[2], arg = !item[3] ? "" : item[3], iconpath;
                if (!id || !name || !path)
                    return;
                var menuitem_0 = document.createXULElement("menuitem");
                menuitem_0.id = `open-current-page-with-${id}`;
                menuitem_0.className = "menuitem-iconic open-current-page-with-application";
                menuitem_0.setAttribute("label", `${subpage}${name}`);
                menuitem_0.applicationpath = path;
                menuitem_0.applicationarg = arg;
                if (attrimage) {
                    iconpath = !item[4] ? (`moz-icon://file://${path}?size=16`) : item[4];
                    menuitem_0.setAttribute("image", iconpath);
                }
                fragpage.append(menuitem_0);
                addEventListener(menuitem_0, "command", function(event) {
                    try {
                        var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
                        file.initWithPath(target.applicationpath);
                        if (!file.exists() || !file.isExecutable()) return;
                        arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => {
                            if (/%OpenURI/g.test(sp)) {
                                let uri = gBrowser.selectedBrowser.currentURI.displaySpec;
                                try {
                                    let _uri;
                                    if (_uri = ReaderMode.getOriginalUrl(uri))
                                        uri = Services.io.newURI(_uri).displaySpec;
                                } catch(e) {}
                                try {
                                    uri = decodeURIComponent(uri);
                                } catch(e) {}
                                return sp.replace(/^"|"$/g, "").replace("%OpenURI", uri);
                            }
                            return sp.replace(/^"|"$/g, "");
                        }) : [];
                        var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
                        process.init(file);
                        process.runwAsync(arg, arg.length);
                    } catch(e) {}
                });
                var menuitem_1 = document.createXULElement("menuitem");
                menuitem_1.id = `open-link-with-${id}`;
                menuitem_1.className = "menuitem-iconic open-link-with-application";
                menuitem_1.setAttribute("label", `${sublink}${name}`);
                menuitem_1.applicationpath = path;
                menuitem_1.applicationarg = arg;
                if (attrimage)
                    menuitem_1.setAttribute("image", iconpath);
                fraglink.append(menuitem_1);
                addEventListener(menuitem_1, "command", function(event) {
                    try {
                        var target = event.currentTarget, arg = target.applicationarg, file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
                        file.initWithPath(target.applicationpath);
                        if (!file.exists() || !file.isExecutable() || !window?.gContextMenu?.linkURI?.displaySpec) return;
                        arg = (arg !== "") ? arg.split(/\s+(?=(?:[^"]*"[^"]*")*[^"]*$)/g).map(sp => {
                            if (/%OpenURI/g.test(sp)) {
                                let uri = gContextMenu.linkURI.displaySpec;
                                try {
                                    let _uri;
                                    if (_uri = ReaderMode.getOriginalUrl(uri))
                                        uri = Services.io.newURI(_uri).displaySpec;
                                } catch(e) {}
                                try {
                                    uri = decodeURIComponent(uri);
                                } catch(e) {}
                                return sp.replace(/^"|"$/g, "").replace("%OpenURI", uri);
                            }
                            return sp.replace(/^"|"$/g, "");
                        }) : [];
                        var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
                        process.init(file);
                        process.runwAsync(arg, arg.length);
                    } catch(e) {}
                });
            });
            if (!submenu) {
                seppage.before(fragpage);
                sepopen.before(fraglink);
            } else {
                let menu = document.createXULElement("menu");
                menu.id = "open-current-page-with-submenu";
                menu.className = "menu-iconic open-current-page-with-application";
                menu.setAttribute("label", "Открыть страницу в...");
                let menupopup = document.createXULElement("menupopup");
                menupopup.append(fragpage);
                menu.append(menupopup);
                seppage.before(menu);
                menu = document.createXULElement("menu");
                menu.id = "open-link-with-submenu";
                menu.className = "menu-iconic open-link-with-application";
                menu.setAttribute("label", "Открыть ссылку в...");
                menupopup = document.createXULElement("menupopup");
                menupopup.append(fraglink);
                menu.append(menupopup);
                sepopen.before(menu);
            }
            var style = "data:text/css;charset=utf-8," + encodeURIComponent(`
                #contentAreaContextMenu #context-openlink:not([hidden="true"]) ~ .open-current-page-with-application,
                #contentAreaContextMenu #context-openlink[hidden="true"] ~ .open-link-with-application {
                    display: none !important;
                }
            `);
            windowUtils.loadSheetUsingURIString(style, windowUtils.USER_SHEET);
        },


В load есть this.contextmenuopenwith.constructor();, это и так понятно.

Отсутствует

 

№1003610-04-2021 13:53:03

bezuma
Участник
 
Группа: Members
Откуда: Москва
Зарегистрирован: 26-01-2014
Сообщений: 256
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

Dobrov

Vitaliy V. - твой код: Открыть ссылку в… не работает

У меня тоже все норм

Отсутствует

 

№1003710-04-2021 13:53:55

sandro79
Участник
 
Группа: Members
Зарегистрирован: 15-11-2017
Сообщений: 1750
UA: Firefox 78.0

Re: Настройка внешнего вида Firefox в userChrome.css

Алексей У. пишет

Возможно ли (если возможно, то как) с помощью css вернуть системное оформление (Windows 7, Firefox 68)?

Код для userContent.css

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

Выделить код

Код:

@-moz-document domain("youtube.com") {
html:not(.style-scope)[standardized-themed-scrollbar] {
	scrollbar-color: var(--yt-spec-icon-inactive) none !important;
}
ytd-app[scrollbar-color] {
	scrollbar-color: var(--yt-spec-icon-disabled) none !important;
}
}

d62174e606d8.png


del

Отредактировано sandro79 (10-04-2021 14:58:39)

Отсутствует

 

№1003810-04-2021 14:23:35

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

Re: Настройка внешнего вида Firefox в userChrome.css

xrun1 пишет

Исходный код Vitaliy V. "Открыть ссылку в..." у меня прекрасно работает на Win10x64 в [firefox] 87.0

Скрипт подключен, в контекстное меню добавляется.
По части моего кода видно, что команда запуска приложения отрабатывает, но ничего не запускает.

Отсутствует

 

№1003910-04-2021 14:24:30

Алексей У.
Участник
 
Группа: Members
Зарегистрирован: 10-04-2021
Сообщений: 159
UA: Firefox 68.0

Re: Настройка внешнего вида Firefox в userChrome.css

Спасибо большое, все работает.

Отсутствует

 

№1004010-04-2021 15:48:57

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

Re: Настройка внешнего вида Firefox в userChrome.css

Dobrov
У тебя ведь MacOS, или я путаю? Тогда всё может быть, но Vitaliy V. здесь уже говорил, что не будет ставить виртуалку для маков. Может так, что подскажет. А на линухе в виртуалке мне проверять, если честно, лень, хотя и стоит Ubuntu. На винде всё честно работает.

Отсутствует

 

№1004110-04-2021 17:41:48

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

Re: Настройка внешнего вида Firefox в userChrome.css

Кнопка видео и перехват видео ! Для OS виндоус

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

Выделить код

Код:

(func => {
	var sysPlayerName = "Pot Player";
	var path = "D:\\PotPlayer\\PotPlayerMini64.exe";
	var videoMoved = "Видео перенесено в " + sysPlayerName;
	var noFound = "Не найдено видео на странице, доступное для переноса в " + sysPlayerName;

	this.image = "moz-icon://file://" + path;
	this.label = "Открыть видео в " + sysPlayerName;
	this.tooltipText = "Л: Видео в плеер\nП: Видео из Clipboard";

	this._handleClick = () => {
		var msgName = _id + ":Player";
		var listener = ({data}) => data ? run([data]) : notify();
		messageManager.addMessageListener(msgName, listener);
		addDestructor(() => messageManager.removeMessageListener(msgName, listener));

		var url = "data:charset=utf-8," + encodeURIComponent(
			`(${func})()`.replace("MSG_NAME", msgName)
				.replace("VIDEO_MOVED", encodeURIComponent(videoMoved))
				.replace("CONFIRM", encodeURIComponent("Открыть ссылку в плеере ?"))
		);
		(this._handleClick = () => gBrowser.selectedBrowser.messageManager.loadFrameScript(url, false))();
	}
	this.onauxclick = e => e.button != 1 || gShowPopup(this);
	this.oncontextmenu = e => {
		if (e.ctrlKey || e.shiftKey || e.altKey) return;
		e.preventDefault();
		custombuttons.confirmBox(null, "Запустить плеер из буфера обмена ?", "Да", "Нет")
			&& run([gClipboard.read(), "/play"]);
	}
	var popup = document.getElementById("contentAreaContextMenu");
	addEventListener("popupshowing", {
		get hidden() {
			return !(gContextMenu.onLink || gContextMenu.onVideo || gContextMenu.onPlainTextLink);
		},
		handleEvent() {
			if (this.hidden) return;
			var menuitem = document.createXULElement("menuitem");
			for(var args of Object.entries({
				image: self.image,
				oncommand: "play()",
				class: "menuitem-iconic",
				label: "Открыть в " + sysPlayerName
			}))
				menuitem.setAttribute(...args);
			menuitem.play = () => play(gContextMenu.linkURL || gContextMenu.mediaURL);
			document.getElementById("context-savelink").before(menuitem);
			addDestructor(() => menuitem.remove());
			this.handleEvent = e => {
				if (e.target == popup) menuitem.hidden = this.hidden;
			}
		}
	}, false, popup || 1);

	var play = link => custombuttons.confirmBox(null, "Открыть ссылку в плеере ?", "Да", "Отмена") && run([link]);
	var run = args => {
		var file = FileUtils.File(path);
		(run = args => {
			if (!file.exists()) return custombuttons.alertBox("File not exists!", path);
			var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
			process.init(file);
			process.runwAsync(args, args.length);
		})(args);
	}
	var notify = () => {
		var name = _id + "-noFound";
		var as = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
		(notify = () => setTimeout(as.closeAlert, 1150, name, as.showAlertNotification(
			"chrome://global/skin/icons/question-48.png", "", noFound, false, "", null, name
		)))();
	}

})(() => {

	var found, videoMoved, SEND = msg => {
		found = true;
		if (!msg || Cc["@mozilla.org/embedcomp/prompt-service;1"]
			.getService(Ci.nsIPromptService)
			.confirm(content, null, decodeURIComponent("CONFIRM"))
		) {
			if (msg) videoMoved = decodeURIComponent("VIDEO_MOVED");
			sendAsyncMessage("MSG_NAME", msg);
		}
		else return true;
	}

	var YoutubeID = /(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})(?:\W|$)/;

	var tmp = '',
	tmpp = '',
	innerA = '<div style="display:block!important;color:#00ff00!important;width:250px!important;font:bold 16px serif!important;z-index:999!important;opacity:1!important;visibility: visible!important;',
	innerB = 'left:5px!important;position:absolute!important;height:auto!important;box-sizing:border-box!important;padding:5px!important;margin:5px!important;',
	//stopPl = "javascript:(function(){v=document.getElementById('movie_player');if(v){v.stopVideo()}else{v=document.getElementsByTagName('video');if(v){v[0].src='';try{v[0].load()}catch(e){}};}})();",
	ytIMGouter = function (ytID) {
		return '<div width="100%"><br /><a target="_blank" href="https://www.youtube.com/watch?v=' + ytID + '"><img src="https://i.ytimg.com/vi/' + ytID + '/hqdefault.jpg"></a><br />' + innerA + 'background-color:black!important;position:relative!important;bottom:20px!important;">&nbsp;&nbsp;' + videoMoved + '</div><br /></div><br />'
	},
	handlWin = function (currentWin) {
		tmp = '';
		var elem = currentWin.document.getElementsByTagName('video'),
		currLoc = currentWin.location;
		if (elem.length > 0) {
			if (currLoc.hostname.indexOf('youtu') != -1 && (tmp = currLoc.toString().match(YoutubeID)) && tmp[1].length == 11) {

				if (SEND('https://www.youtube.com/watch?v=' + tmp[1])) return;

				videoMovedbox = currentWin.document.createElement('videoMoved');
				videoMovedbox.innerHTML = innerA + innerB + 'top:-15px!important;"><b>' + videoMoved + '</b></div>';

				//loadURI(stopPl);
				(function(d){var v=d.getElementById('movie_player');if(v){try{v.stopVideo()}catch{}}
					else{v=d.getElementsByTagName('video');if(v[0]){v[0].src='';try{v[0].load()}catch{}};}})(currentWin.document);

				currentWin.document.getElementById('eow-title').appendChild(videoMovedbox);
				return true;
			};
			for (i = 0; i < elem.length; i++) {
				if (((tmp = getSrc(elem[i].parentNode, currLoc)) && tmp.length > 2) || (i == 0 && currentWin.document.body.innerHTML.substring(0, 7) == '<video ' && (tmp = currLoc.toString()))) {

					if (SEND(tmp)) return;

					videoMovedbox = currentWin.document.createElement('videoMoved');
					videoMovedbox.innerHTML = innerA + innerB + 'top:20px!important;background-color:black!important;">' + videoMoved + '</div>';

					if (currLoc.hostname == 'www.youtube.com') {
						elem[i].parentNode.parentNode.appendChild(videoMovedbox);
					} else {
						elem[i].parentNode.appendChild(videoMovedbox);
					};
					elem[i].src = '';
					try {
						elem[i].load()
					} catch (e) {};
					return true;
				}
			}
		};

		currentWin._elems = currentWin.document.getElementsByTagName('iframe');
		if (currentWin._elems.length > 0) {
			for (currentWin._iCounter = 0; currentWin._iCounter < currentWin._elems.length; currentWin._iCounter++) {
				if ((currentWin._elems[currentWin._iCounter].src.indexOf('youtube.com') > -1) && (tmp = currentWin._elems[currentWin._iCounter].src.match(YoutubeID)) && (tmp[1].length == 11)) {

				if (SEND('https://www.youtube.com/watch?v=' + tmp[1])) return;

				currentWin._elems[currentWin._iCounter].outerHTML = ytIMGouter(tmp[1]);
					return true;
				};
				if (currentWin._elems[currentWin._iCounter].clientWidth > 80 && currentWin._elems[currentWin._iCounter].clientHeight > 40 && handlWin(currentWin._elems[currentWin._iCounter].contentWindow))
					return true;
			}
		};

		elem = currentWin.document.getElementsByTagName('object');
		currLoc = currentWin.location;
		if (elem.length == 0) {
			elem = currentWin.document.getElementsByTagName('embed')
		};
		if (elem.length > 0) {
			for (i = 0; i < elem.length; i++) {
				if (elem[i].innerHTML.indexOf('youtu') != -1 && (tmp = elem[i].innerHTML.match(YoutubeID)) && tmp[1].length == 11) {

					if (SEND('https://www.youtube.com/watch?v=' + tmp[1])) return;

					elem[i].outerHTML = ytIMGouter(tmp[1]);
					return true;
				} else {
					if (elem[i].clientWidth > 80 && elem[i].clientHeight > 40) {
						if (((tmp = getSrc(elem[i].parentNode, currLoc)) || (tmp = getLink(elem[i], currLoc))) && tmp.length > 2) {

							if (SEND(tmp)) return;

							elem[i].outerHTML = innerA + 'background-color:black!important;bottom:20px!important;">&nbsp;&nbsp;' + videoMoved + '</div>';
							return true;
						};
					};
				}
			};
		};
		return false;
	};

	function restProtHost(lnkR, curLoc) {
		if (lnkR.length == 0)
			return '';
		let tr = lnkR.replace(/^:\/\//, curLoc.protocol + "//");
		if (!tr.match(/^https?:\/\//i)) {
			lnkR = tr.replace(/^\/+/, '');
			if (lnkR.split('/')[0].split('?')[0].split('#')[0].toLowerCase().match(/^(?:[-a-z\d]+\.)+[a-z\d]{2,6}$/)) {
				tr = curLoc.protocol + '//' + lnkR;
			} else {
				tr = curLoc.protocol + '//' + curLoc.host + "/" + lnkR;
			}
		};
		return tr;
	};

	function getSrc(vobj, currentLoc) {
		var t = '',
		tt = '';
		if ((((t = vobj.innerHTML.match(/<video.*?\ssrc=(?:(?:'([^']*)')|(?:"([^"]*)")|([^\s]*))/i)) && (t) && (tt = t[1] || t[2] || t[3]) && tt.indexOf('blob:') == -1) || ((t = vobj.innerHTML.match(/<source.*?\ssrc=(?:(?:'([^']*)')|(?:"([^"]*)")|([^\s]*)).*?\stype=['"]?video\//i)) && (t) && (tt = t[1] || t[2] || t[3]))) && tt.length > 2 && tt.indexOf('blob:') == -1) {
			if (tt.indexOf(".mp4/?") == -1) {
				tt = tt.replace(/&amp;/g, "&")
			};
			t = restProtHost(tt, currentLoc);
			return t;
		};
		return '';
	};

	function getLink(obj, curLocation) {

		if (!obj || !obj.tagName)
			return '';
		q = obj.tagName.toLowerCase();

		var getParam = function (e, n) {
			var v = '',
			r = new RegExp('^(' + n + ')$', 'i'),
			param = e.getElementsByTagName('param');
			for (var igp = 0, p; p = param[igp]; igp++) {
				if (p.hasAttribute('name') && p.getAttribute('name').match(r)) {
					v = p.getAttribute('value');
					break
				};
			};
			return v;
		};

		var restPath = function (f, s) {
			return (f.substring(0, 4) == 'http') ? f : s.replace(/[#?].*$/, '').replace(/[^\/]*$/, f)
		};

		function videoLinkExtract(fl) {
			alert(fl);
			var linkArr = [],
			outLinks = [],
			jj = 0,
			lba = '',
			lbb = '',
			decodeURL = gBrowser.currentURI.spec; {
				try {
					return decodeURIComponent(s)
				} catch (e) {
					return unescape(s)
				}
			};

			for (var ij = 0; ij < 3; ij++) {
				lba = lba + String.fromCharCode(parseInt((Math.random() * 15 + 1) + '', 10));
				lbb = lbb + String.fromCharCode(parseInt((Math.random() * 15 + 16) + '', 10));
			};

			function pushWithMerit(lnk) {

				var merit = -11;
				if (lnk.match(/^https?:\/\//i))
					merit = merit + 40;
				if (outLinks.length == 0)
					merit = merit + 1;
				if (lnk.match(/^\//))
					merit = merit + 7;
				if (lnk.match(/^\/\//))
					merit = merit + 30;
				if (lnk.match(/240p([^a-z]|$)/i))
					merit = merit + 1;
				if (lnk.match(/[^a-z]240([^a-z0-9]|$)/i))
					merit = merit + 1;
				if (lnk.match(/360p([^a-z]|$)/i))
					merit = merit + 3;
				if (lnk.match(/[^a-z]360([^a-z0-9]|$)/i))
					merit = merit + 3;
				if (lnk.match(/480p([^a-z]|$)/i))
					merit = merit + 5;
				if (lnk.match(/[^a-z]480([^a-z0-9]|$)/i))
					merit = merit + 5;
				if (lnk.match(/720p([^a-z]|$)/i))
					merit = merit + 7;
				if (lnk.match(/[^a-z]720([^a-z0-9]|$)/i))
					merit = merit + 7;
				if (lnk.match(/\.mp4([^a-z]|$)/i))
					merit = merit + 8;
				if (lnk.match(/_hd([^a-z]|$)/i))
					merit = merit + 6;
				if (lnk.match(/\.(jpg|xml)([^a-z]|$)/i))
					merit = merit - 40;
				if (merit > 0)
					outLinks.push(merit + lba + lnk);
				Services.console.logStringMessage('merit:' + merit + ' lnk->' + lnk);
			};

			linkArr.push(fl);
			while (linkArr.length > jj && jj < 30) {

				var testPaths = [];
				testPaths = linkArr[jj].split(/(\.(?:flv|mp4|m3u8))/i);
				if (testPaths[testPaths.length - 1] == '')
					testPaths.pop();

				for (k = 1; k < testPaths.length; k = k + 2) {

					if (testPaths[k - 1].indexOf(lba) > -1) {
						pref = testPaths[k - 1];
					} else {
						var testAboutDom = testPaths[k - 1].toLowerCase().split(/(https?:\/\/)/);
						if (testAboutDom[testAboutDom.length - 1] == '')
							testAboutDom.pop();
						var pTest = testAboutDom[testAboutDom.length - 1].split(/(\?[^\?]*?&)/);
						if (pTest.length > 2) {
							pTest.pop();
							pTest.pop();
						};
						testAboutDom[testAboutDom.length - 1] = pTest.join('');
						pref = testPaths[k - 1].substring(testAboutDom.join('').lastIndexOf("&") + 1);
					};

					t2 = pref.lastIndexOf(lbb);
					if (t2 > -1) {
						pref = pref.substring(t2 + 3);
					} else {

						t2 = pref.lastIndexOf('{"');
						if (t2 > -1)
							pref = pref.substring(t2 + 2);
						t2 = pref.lastIndexOf('["');
						if (t2 > -1)
							pref = pref.substring(t2 + 2);
						t2 = pref.lastIndexOf(',"');
						if (t2 > -1)
							pref = pref.substring(t2 + 2);
						t2 = pref.toLowerCase().lastIndexOf('"http://');
						if (t2 > -1)
							pref = pref.substring(t2 + 1);
						t2 = pref.toLowerCase().lastIndexOf('"https://');
						if (t2 > -1)
							pref = pref.substring(t2 + 1);
						t2 = pref.toLowerCase().lastIndexOf(',http://');
						if (t2 > -1)
							pref = pref.substring(t2 + 1);
						t2 = pref.toLowerCase().lastIndexOf(',https://');
						if (t2 > -1)
							pref = pref.substring(t2 + 1);
						t2 = pref.toLowerCase().lastIndexOf(';http');
						if (t2 > -1)
							pref = pref.substring(t2 + 1);
						t2 = pref.toLowerCase().lastIndexOf('*https://');
						if (t2 > -1)
							pref = pref.substring(t2 + 1);
						t2 = pref.toLowerCase().lastIndexOf(' or ');
						if (t2 > -1)
							pref = pref.substring(t2 + 4);

						pref = pref.substring(pref.split('/')[0].toLowerCase().split('%2f')[0].lastIndexOf('=') + 1);

					}

					if (pref.length > 0) {

						if (pref.split('?')[0].toLowerCase().match(/%[2-3][0-9a-f]/)) {

							t2 = pref.indexOf('"')
								if (t2 > -1)
									pref = pref.substring(t2 + 1);
								suff = testPaths[k + 1] ? testPaths[k + 1].split('&')[0].split('"')[0].split(';')[0].split(/,http/i)[0] : '';
							if ((suff != testPaths[k + 1]) || (testPaths.length < k + 3)) {
								if (testPaths.length > k + 1) {
									testPaths[k + 1] = ((pref == testPaths[k - 1]) ? '' : '&') + testPaths[k + 1].substr(suff.length)
								};
								t2 = pref.lastIndexOf(lba);
								if (t2 > -1)
									pref = pref.substring(t2 + 3)
										linkArr.push(decodeURL(pref + testPaths[k] + suff));

							} else {
								testPaths[k + 1] = (pref == testPaths[k - 1] ? '' : lbb) + pref + testPaths[k] + suff
							}
						} else {
							suff = testPaths[k + 1] ? testPaths[k + 1].split(';')[0].split('"]')[0].split('"}')[0].split('",')[0].split(/,https?:\/\//i)[0].split('*https://')[0].split(' or ')[0] : '';
							t2 = suff.indexOf('&');
							if ((t2 > -1) && (pref != testPaths[k - 1])) {
								if (t2 == 0)
									suff = '';
								if (suff.charAt(0) != '?')
									suff = suff.split(/(&[^&]+=https?:\/\/)/i)[0];
							};
							if ((suff != testPaths[k + 1]) || (testPaths.length < k + 3)) {
								if (testPaths.length > k + 1) {
									testPaths[k + 1] = ((pref == testPaths[k - 1]) ? '' : '&') + testPaths[k + 1].substr(suff.length)
								};
								t2 = pref.lastIndexOf(lba);
								if (t2 > -1)
									pref = pref.substring(t2 + 3);
								pushWithMerit(pref + testPaths[k] + suff);

							} else {
								testPaths[k + 1] = lba + (pref == testPaths[k - 1] ? '' : lbb) + pref + testPaths[k] + suff
							}
						}
					}
				};
				jj = jj + 1;
			};

			if (outLinks.length == 0)
				return '';
			function srt(a, b) {
				a = parseInt(a.substr(0, a.indexOf(lba)), 10);
				b = parseInt(b.substr(0, b.indexOf(lba)), 10);
				if (a < b)
					return 1;
				if (a > b)
					return -1;
				return 0
			};
			outLinks.sort(srt);
			outLinks[0] = outLinks[0].substr(outLinks[0].indexOf(lba) + 3)
				if (outLinks[0].indexOf('_hq.mp4/?time=') > 0)
					outLinks[0] = outLinks[0].replace(/&/g, '&amp;');
				return outLinks[0];
		};

		if (!ol)
			return '';
		//ol = ol.replace(/^:?\/\//, curLocation.protocol + "//");
		//return restPath(ol, src);
		return restProtHost(ol, curLocation);
	};

	try {handlWin(content);} finally {found || SEND();}
});

Это все (pot, kmp, mpc, Gom)
var sysPlayerName = "Pot Player";
    var path = "D:\\PotPlayer\\PotPlayerMini64.exe";

Отредактировано ВВП (10-04-2021 17:44:02)

Отсутствует

 

№1004210-04-2021 19:02:03

css
Участник
 
Группа: Members
Зарегистрирован: 07-04-2014
Сообщений: 186
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

Заметила одну вещь. Есть такое расширение ColorFish, я его ставила, когда скрипты от Vitaliy V. уже были установлены, поэтому заметила только после чистой установки браузера, когда попыталась воспользоваться дополнением. Так вот, кажется, без скриптов Vitaliy V. это дополнение просит установленные библиотеки на ПК, иначе отказывается работать. Похоже, что скрипты Vitaliy V., позволяют этому дополнению работать без каких-либо дополнительных установок. Я могу ошибаться.

Отредактировано css (10-04-2021 20:26:29)

Отсутствует

 

№1004310-04-2021 20:30:53

oleg.sgh
Участник
 
Группа: Members
Зарегистрирован: 19-04-2014
Сообщений: 3141
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

Отсутствует

 

№1004410-04-2021 23:00:22

css
Участник
 
Группа: Members
Зарегистрирован: 07-04-2014
Сообщений: 186
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

oleg.sgh, спасибо!

Отсутствует

 

№1004511-04-2021 03:26:09

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

Re: Настройка внешнего вида Firefox в userChrome.css

Vitaliy V. уточню свой вопрос по Открыть ссылку в…
Насколько я знаю, у тебя основная система Линукс. Проверил - на Arch-Linux плеер mpv открывает ссылку.
Может для МакОС нужен другой способ вызова приложений?
Помоги наладить открытие ссылки на МакОС (Mojave). В настройках «Защита и безопасность» всё настроил правильно, например, Double Commander внешние приложения запускает…

Отсутствует

 

№1004612-04-2021 11:30:10

tagnupip
Участник
 
Группа: Members
Зарегистрирован: 05-12-2018
Сообщений: 54
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

снова сломали

Отсутствует

 

№1004712-04-2021 19:18:02

Vitaliy V.
Участник
 
Группа: Members
Зарегистрирован: 19-09-2014
Сообщений: 2074
UA: Firefox 88.0

Re: Настройка внешнего вида Firefox в userChrome.css

Dobrov пишет

уточню свой вопрос по Открыть ссылку в…
['mpv', 'плеере MPV', '/usr/local/bin/mpv'

C чего взял что он там находится, сам туда поместил? Обычно в [macos] приложения находятся в /Applications/
И лучше наверное использовать утилиту open
Но плеера могут по разным причинам не открыть адрес, пробуй с другим браузером, например

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

Выделить код

Код:

var arrayMacos = [ // для MacOS
				['fde', 'Firefox Developer Edition', '/usr/bin/open', '-n -a "Firefox Developer Edition" --args %OpenURI', 'moz-icon://file:///Applications/Firefox\ Developer\ Edition.app?size=16'],
			];

Отредактировано Vitaliy V. (12-04-2021 19:54:44)

Отсутствует

 

№1004812-04-2021 20:27:25

Пострел
Участник
 
Группа: Members
Зарегистрирован: 08-04-2021
Сообщений: 51
UA: Firefox 87.0

Re: Настройка внешнего вида Firefox в userChrome.css

Можно ли сделать всплывающей нижнюю панель при наведении курсора,
и укоротить длинну до 30 px?

Отсутствует

 

№1004913-04-2021 01:11:53

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

Re: Настройка внешнего вида Firefox в userChrome.css

Vitaliy V. - спасибо, способ запуска через /usr/bin/open работает!


Vitaliy V. пишет

C чего взял что он там находится, сам туда поместил?

mpv установлен штатным способом сразу в /Application и в /usr: и запускается и ярлыком, и из терминала: mpv

iMac:~ dobrov$ which mpv
/usr/local/bin/mpv

Именно поэтому я просил добавить возможность запуска через $(which …mpv…) в кнопке Открыть ссылку в…
просто для информации: в МакОС консольный менеджер пакетов brew ставит что угодно, хоть Фотошоп и FineReader…

Отсутствует

 

№1005013-04-2021 01:29:18

Vitaliy V.
Участник
 
Группа: Members
Зарегистрирован: 19-09-2014
Сообщений: 2074
UA: Firefox 88.0

Re: Настройка внешнего вида Firefox в userChrome.css

Dobrov пишет

возможность запуска через $(which …mpv…)

Это возможно из консоли или из bash скрипта.
Ну так напишите скрипт и вызывайте его вместо приложения, в качестве аргументов для скрипта передать в том числе в каком приложении открыть

Отредактировано Vitaliy V. (13-04-2021 01:29:34)

Отсутствует

 

Board footer

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