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

Список ответов на каверзные вопросы можно получить в FAQ-разделе форума.

№1580128-08-2021 18:00:28

Stkvsky
Участник
 
Группа: Members
Зарегистрирован: 26-06-2012
Сообщений: 1700
UA: Firefox 78.0

Re: Custom Buttons

Dumby
Вы бы не могли пожалуйста еще добавить, чтобы при открытии закладки в контейнере, если контейнер с таким именем уже существует, то открывать в нем же, а не создавать новый?


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

Выделить код

Код:

(async (sel, self) => ({

	icon: "circle",
	colors: [
		"#FF9800",
		"#03A9F4",
		"#FFC107",
		"#00BCD4",
		"#FFEB3B",
		"#009688",
		"#CDDC39",
		"#4CAF50",
		"#8BC34A",
		"#D32F2F",
		"#4949ff",
		"#C2185B",
		"#607D8B",
		"#7B1FA2",
		"#9E9E9E",
		"#673AB7",
		"#795548",
		"#3F51B5",
		"#FF5722",
		"#2196F3",
	],

	initColors() {
		var colorName = "ucf-gen";
		var css = "@-moz-document url(about:preferences#containers),"
			+ " url-prefix(chrome://browser/content/browser.x) {\n";
		this.colors.forEach((color, ind) => {
			var [ic, tc] = color.split(/\s*\|\s*/);
			css += `\t.identity-color-${colorName}${ind} {\n`
				+ `\t\t--identity-tab-color: ${tc || ic};\n`
				+ `\t\t--identity-icon-color: ${ic};\n\t}\n`
		});
		var url = "data:text/css;charset=utf-8," + encodeURIComponent(css + "}");
		var sss = Cc["@mozilla.org/content/style-sheet-service;1"]
			.getService(Ci.nsIStyleSheetService);
		sss.loadAndRegisterSheet(Services.io.newURI(url), sss.USER_SHEET);

		var len = this.colors.length;
		var pref = "ucf.openInGeneratedContainer.lastColor";
		var ind = Math.min(Services.prefs.getIntPref(pref, -1), len - 1);
		this.nextColor = () => {
			var next = ind + 1;
			Services.prefs.setIntPref(pref, ind = next == len ? 0 : next);
			return colorName + ind;
		}
	},
	quit: false,
	init(topic) {
		Services.obs.addObserver(self = this, topic);

		var lt = "browser-lastwindow-close-granted";
		var lw = () => this.quit = true;
		Services.obs.addObserver(lw, lt);

		Services.obs.addObserver(function quit(s, t) {
			self.quit = true;
			Services.obs.removeObserver(self, topic);
			Services.obs.removeObserver(lw, lt);
			Services.obs.removeObserver(quit, t);
		}, "quit-application-granted");
		this.initColors();
		this.newUsercontext = name => {
			var id = this.cis.create(
				name || `[ ${this.cis._lastUserContextId + 1} ]`, this.icon, this.nextColor()
			).userContextId;
			this.saveGens(this.gens.add(id));
			return id;
		}
		var cpref = "ucf.openInGeneratedContainer.containers";
		var arr = Services.prefs.getStringPref(cpref, "").split(",").map(Number).filter(Boolean);
		if (arr.length) {
			var ids = this.cis.getPublicIdentities().map(i => i.userContextId);
			arr = arr.filter(id => ids.includes(id));
		}
		this.gens = new Set(arr);
		(this.saveGens = () => Services.prefs.setStringPref(cpref, Array.from(this.gens).join(",")))();
		

		var {PlacesUtils} = ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
		var {PrivateBrowsingUtils} = ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
		ChromeUtils.import(
			"resource:///modules/PlacesUIUtils.jsm"
		).PlacesUIUtils._openNodeIn = function PUIU__openNodeIn(node, where, win, priv) {
			if (node && PlacesUtils.nodeIsURI(node) && this.checkURLSecurity(node, win)) {
				var {uri} = node;
				var isBookmark = PlacesUtils.nodeIsBookmark(node);
				if (!PrivateBrowsingUtils.isWindowPrivate(win)) isBookmark
					? this.markPageAsFollowedBookmark(uri)
					: this.markPageAsTyped(uri);
				var params = {private: priv, inBackground: this.loadBookmarksInBackground};
				if (uri.startsWith("javascript:"))
					params.allowPopups = params.allowInheritPrincipal = true;
				else if (isBookmark) {
					var e = win.event;
					if (
						e && !e.button && e.detail <= 1 &&
						!e.ctrlKey && !e.shiftKey && !e.altKey &&
						(e.type == "command" || e.type == "click") &&
						e.target.matches(".bookmark-item, treechildren")
					) {
						if (where == "current") where = "tab";
						var title, {parent} = node, {type} = parent;
						var folder = type == node.RESULT_TYPE_FOLDER
							|| type == node.RESULT_TYPE_FOLDER_SHORTCUT;
						if (folder) title = PlacesUtils.bookmarks.getLocalizedTitle({
							guid: parent.bookmarkGuid, title: parent.title
						});
						var id = params.userContextId = self.newUsercontext(title);
						folder || updateTitle(id, node.bookmarkGuid);
					}
				}
				win.openTrustedLinkIn(uri, where, params);
			}
		}
		var updateTitle = async (id, guid) => {
			var {parentGuid} = await PlacesUtils.bookmarks.fetch(guid);
			var title = PlacesUtils.bookmarks.getLocalizedTitle(
				await PlacesUtils.bookmarks.fetch(parentGuid)
			);
			var {icon, color} = this.cis.getPublicIdentityFromId(id);
			this.cis.update(id, title, icon, color);
		}
	},
	observe(doc) {
		var list = doc.querySelectorAll(sel);
		if (!list.length) return;

		var menuitem = doc.createXULElement("menuitem");
		for(var args of Object.entries({
			selectiontype: "single",
			oncommand: "cmd(window)",
			nodetype: "folder|query",
			selection: "folder|query",
			label: "Открыть всё в контейнере",
			id: "placesContext_openContainer:tabs:newUsercontext"
		}))
			menuitem.setAttribute(...args);
		menuitem.cmd = this.cmd;
		menuitem.rnd = menuitem.constructor.prototype.render;
		menuitem.render = this.render;
		var [m1, m2] = menuitem.list = Array.from(list);
		(m2 || m1).after(menuitem);

		if (doc.documentElement.getAttribute("windowtype") != "navigator:browser") return;

		for(var btn of [
			doc.getElementById("tabs-newtab-button"),
			doc.getElementById("new-tab-button") ||
				doc.ownerGlobal.gNavToolbox.palette.querySelector("#new-tab-button")
		])
			if (btn) btn.checkForMiddleClick = this.click;

		var win = doc.ownerGlobal;
		this.redefDoSearch(win, win.customElements.get("searchbar").prototype);

		win.gBrowser.tabContainer.addEventListener("TabClose", this.tabClose);
		win.addEventListener("unload", this.winUnload, {once: true});
		this.quit = false;

		var tuc = "gBrowser.selectedTab.userContextId";
		win.BrowserOpenTab = win.eval(`(${win.BrowserOpenTab})`.replace(
			"resolve,", `$&\n          userContextId: ${tuc},`
		));
		var bdw = win.browserDOMWindow.wrappedJSObject;
		win.Object.assign(bdw, win.eval(
			`({${bdw.getContentWindowOrOpenURI}})`
				.replace("userContextId,", `isExternal ? ${tuc} : $&`)
				.replace(
					/null,\s+null,\s+null,\s+aTriggeringPrincipal/,
					`isExternal ? ${tuc} : $&`
				)
		));
	},
	winUnload(e) {
		var win = e.target.ownerGlobal;
		win.removeEventListener("TabClose", self.tabClose);
		if (self.quit) return;
		var gb = win.gBrowser;
		if (gb) for(var tab of gb.tabs) self.tabClose(null, tab);
	},
	closed: new Set(),
	cis: ChromeUtils.import("resource://gre/modules/ContextualIdentityService.jsm")
		.ContextualIdentityService,
	tabClose(e, tab = e.target) {
		var id = +tab.getAttribute("usercontextid");
		id && self.gens.has(id) && self.closed.add(id);
		self.closed.size == 1 && ChromeUtils.idleDispatch(self.maybeRemove);
	},
	maybeRemove() {
		var ids = Array.from(self.closed);
		self.closed.clear();
		for(var id of ids) self.maybeRemoveById(id);
	},
	maybeRemoveById(id) {
		for(var win of CustomizableUI.windows)
			if (win.document.querySelector(`tab.tabbrowser-tab[usercontextid="${id}"]`))
				return;
		this.saveGens(this.gens.delete(id));
		this.cis.remove(id);
	},
	redefDoSearch(win, proto) {
		var code = `(openTrustedLinkIn => [
			{${proto.doSearch}}, openTrustedLinkIn
		])(
			function otl(url, where, params) {
				if (where != "current")
					params.resolveOnNewTabCreated = br => {
						var tab = gBrowser.getTabForBrowser(br);
						gBrowser.moveTabTo(tab, Infinity);
						gBrowser.addTrustedTab("about:blank", {
							index: tab._tPos,
							userContextId: tab.userContextId
						});
					},
					params.userContextId = otl.newUsercontext(
						document.getElementById("searchbar").value
					);
				openTrustedLinkIn(url, where, params);
			}
		);`;
		(this.redefDoSearch = (win, proto) => {
			var [obj, func] = win.eval(code);
			Object.assign(proto, obj);
			func.newUsercontext = this.newUsercontext;
		})(win, proto);
	},
	click(btn, e) {
		if (!(e.button != 2 || e.ctrlKey || e.shiftKey)) {
			var txt = e.view.readFromClipboard();
			if (txt) {
				var urls = txt.split("\n").map(self.map).filter(Boolean);
				if (urls.length) return e.preventDefault(),
					self.openFromClipboard(e.view, urls);
			}
		}
		e.view.checkForMiddleClick(btn, e);
	},
	eo: Object.create(null),
	map(str) {
		str = str.trim();
		try {
			var scheme = Services.io.extractScheme(str);
			var ph = Services.io.getProtocolHandler(scheme);
			if (ph.scheme == scheme)
				return Services.io.newURI(str) && {uri: str};
		} catch {}
	},
	openFromClipboard(win, urls) {
		if (win.OpenInTabsUtils.confirmOpenInTabs(urls.length, win))
			urls.load = true,
			this.open(win, this.eo, urls);
	},
	async render() {
		this.rnd();
		await new Promise(this.ownerGlobal.requestAnimationFrame);
		this.hidden || (this.hidden = this.list.every(self.every));
	},
	every: node => node.disabled || node.hidden,
	cmd(win) {
		var {_view, triggerNode} = this.parentNode;
		var node = triggerNode._placesView && triggerNode._placesView.result.root;
		self.open(win, node || _view.selectedNode || _view.result.root);
	},
	open(win, node, list) {
		var gbw = Cu.import("resource:///modules/PlacesUIUtils.jsm", {}).getBrowserWindow;
		var w = gbw(win);
		this.pu = w.PlacesUIUtils;
		this.fs = w.PlacesUtils.favicons;
		this.sysp = w.E10SUtils.SERIALIZED_SYSTEMPRINCIPAL;

		(this.open = (win, node, list) => {
			var {bookmarkGuid: guid, title} = node;
			if (guid && title) title = win.PlacesUtils.bookmarks.getLocalizedTitle({guid, title});
			this.openURLs(gbw(win), list || win.PlacesUtils.getURLsForContainerNode(node), title);
			guid && this.pu.doCommand(win, "placesCmd_delete");
		})(win, node, list);
	},
	async openURLs(win, urls, title) {
		var userContextId = this.newUsercontext(title);
		var mark = !win.PrivateBrowsingUtils.isWindowPrivate(win);
		var {load} = urls, gb = win.gBrowser, pos = gb.selectedTab._tPos;

		for(var {uri, title, isBookmark} of urls) try {
			if (mark) isBookmark
				? this.pu.markPageAsFollowedBookmark(uri)
				: this.pu.markPageAsTyped(uri);

			if (load) {
				gb.addTrustedTab(uri, {index: ++pos, userContextId});
				continue;
			}
			var state = {userContextId, entries: [{
				url: uri,
				title: title || uri,
				triggeringPrincipal_base64: this.sysp
			}]};
			var [,, data, mime] = await new Promise(
				resolve => this.fs.getFaviconDataForPage(
					Services.io.newURI(uri), (...args) => resolve(args), 16
				)
			);
			if (data.length) state.image = `data:${
				mime || "image/x-icon"
			};base64,${
				btoa(String.fromCharCode(...data))
			}`;
			var tab = gb.addTrustedTab(null, {index: ++pos, userContextId});
			win.SessionStore.setTabState(tab, state);
		} catch {};
	}
}).init("chrome-document-loaded"))(
	"#placesContext_openBookmarkContainer\\:tabs,#placesContext_openContainer\\:tabs"
	
);

Отредактировано Stkvsky (28-08-2021 18:03:52)

Отсутствует

 

№1580228-08-2021 20:41:03

dezhnev
Участник
 
Группа: Members
Зарегистрирован: 21-04-2016
Сообщений: 72
UA: Firefox 78.0

Re: Custom Buttons

Dumby пишет

dezhnev

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

Выделить код

Код:

.......
	//var url = this.parentNode.dataset.currentUri;
	var url = this.closest("tab-item").dataset.currentUri;

Cпасибо!
А можно еще куда-нибудь поставить, наподобие .replace(/^www\./, "")  , чтобы для доменов убирать -  www|forum|mail ?

Отсутствует

 

№1580328-08-2021 21:23:24

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

Re: Custom Buttons

Dumby
Вопрос . эта фишка TmpDataPath= ...В портаблах не всегда работает?  С tmemutil.dll , к примеру, вроде никак. Dll - последняя.

Отсутствует

 

№1580429-08-2021 21:29:02

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

Re: Custom Buttons

Stkvsky пишет

при открытии закладки в контейнере, если контейнер с таким именем уже существует, то открывать в нем же, а не создавать новый

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

Выделить код

Код:

/*
						var folder = type == node.RESULT_TYPE_FOLDER
							|| type == node.RESULT_TYPE_FOLDER_SHORTCUT;
						if (folder) title = PlacesUtils.bookmarks.getLocalizedTitle({
							guid: parent.bookmarkGuid, title: parent.title
						});
						var id = params.userContextId = self.newUsercontext(title);
						folder || updateTitle(id, node.bookmarkGuid);
					}
				}
				win.openTrustedLinkIn(uri, where, params);
			}
		}
		var updateTitle = async (id, guid) => {
			var {parentGuid} = await PlacesUtils.bookmarks.fetch(guid);
			var title = PlacesUtils.bookmarks.getLocalizedTitle(
				await PlacesUtils.bookmarks.fetch(parentGuid)
			);
			var {icon, color} = this.cis.getPublicIdentityFromId(id);
			this.cis.update(id, title, icon, color);
		}
*/
						if (
							type == node.RESULT_TYPE_FOLDER ||
							type == node.RESULT_TYPE_FOLDER_SHORTCUT
						)
							title = PlacesUtils.bookmarks.getLocalizedTitle({
								guid: parent.bookmarkGuid, title: parent.title
							});
						else {
							var quit = false;
							var until = () => quit;
							var stop = () => quit = true;
							var guid, info;
							PlacesUtils.bookmarks.fetch(node.bookmarkGuid)
								.then(info => guid = info.parentGuid)
								.finally(stop);
							spin(until);
							quit = false;
							PlacesUtils.bookmarks.fetch(guid)
								.then(res => info = res)
								.finally(stop);
							spin(until);
							if (info) title = PlacesUtils.bookmarks.getLocalizedTitle(info);
						}
						title = title || "\u200b"; // ZWSP
						var id = self.cis.getPublicIdentities()
								.find(find, title)?.userContextId;

						params.userContextId = id || self.newUsercontext(title);
					}
				}
				win.openTrustedLinkIn(uri, where, params);
			}
		}
		var spin = arg => {
			var {tm} = Services;
			spin = tm.spinEventLoopUntilOrShutdown || tm.spinEventLoopUntilOrQuit;
			var bargs = [tm];
			spin.length == 2 && bargs.push("Fetch bookmark folder title sync");
			(spin = spin.bind(...bargs))(arg);
		}
		var find = function(uc) {
			return uc.name == this;
		}

dezhnev пишет

куда-нибудь поставить, наподобие .replace(/^www\./, "")

Да там же, неподалёку. Тут hostname и реплейсить: `${hostname} | ${val}`


ВВП пишет

фишка TmpDataPath= ...В портаблах не всегда работает?

У меня всегда работает. Но это ничего не значит,
поскольку моё использование разнообразием не блещет.
portable32.dll, не последняя, TmpDataPath совпадает с PortableDataPath,
то есть папка LocalAppData в профиле.

Отредактировано Dumby (29-08-2021 21:29:48)

Отсутствует

 

№1580530-08-2021 08:23:14

Stkvsky
Участник
 
Группа: Members
Зарегистрирован: 26-06-2012
Сообщений: 1700
UA: Firefox 78.0

Re: Custom Buttons

Dumby
Класс, спасибо большое

Отсутствует

 

№1580630-08-2021 13:44:04

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

Re: Custom Buttons

_zt

_zt пишет

Эпатаж!? Это просто риторический вопрос.

. С tmemutil.dll -  PortableDataPath= не катит.


амечание п. 3.3
Sergeys

Отредактировано ВВП (30-08-2021 18:20:51)

Отсутствует

 

№1580730-08-2021 21:44:36

_zt
Участник
 
Группа: Members
Зарегистрирован: 10-11-2014
Сообщений: 1647
UA: Firefox 78.0

Re: Custom Buttons

ВВП
:) Да не напрягайся. Зачем tmemutil?

Отсутствует

 

№1580801-09-2021 11:00:33

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 29
UA: Chrome 92.0

Re: Custom Buttons

Подскажите пожалуйста. Как программно узнать, закреплённая ли активная вкладка? Если закреплена true, иначе false.

Отредактировано Senflex (01-09-2021 11:05:42)

Отсутствует

 

№1580901-09-2021 13:24:46

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

Re: Custom Buttons

Senflex пишет

Подскажите пожалуйста. Как программно узнать, закреплённая ли активная вкладка? Если закреплена true, иначе false.

Может как-то так :/

Выделить код

Код:

addEventListener("TabSelect", (e, tab = e.target)=> {
  if ( tab.pinned == true ) {
    alert('pinned');
  }
  else {
    alert('not pinned');
  }
}, true, gBrowser.tabContainer);

«The Truth Is Out There»

Отсутствует

 

№1581001-09-2021 22:48:05

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 29
UA: Chrome 92.0

Re: Custom Buttons

unter_officer пишет
Senflex пишет

Подскажите пожалуйста. Как программно узнать, закреплённая ли активная вкладка? Если закреплена true, иначе false.

Может как-то так :/

Выделить код

Код:

addEventListener("TabSelect", (e, tab = e.target)=> {
  if ( tab.pinned == true ) {
    alert('pinned');
  }
  else {
    alert('not pinned');
  }
}, true, gBrowser.tabContainer);

Благодарю!

Отсутствует

 

№1581102-09-2021 20:38:00

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 29
UA: Chrome 93.0

Re: Custom Buttons

unter_officer пишет
Senflex пишет

Подскажите пожалуйста. Как программно узнать, закреплённая ли активная вкладка? Если закреплена true, иначе false.

Может как-то так :/

Выделить код

Код:

addEventListener("TabSelect", (e, tab = e.target)=> {
  if ( tab.pinned == true ) {
    alert('pinned');
  }
  else {
    alert('not pinned');
  }
}, true, gBrowser.tabContainer);

Сегодня попробовал, что-то не работает, можно ли без addEventListener?

Отсутствует

 

№1581203-09-2021 21:02:32

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

Re: Custom Buttons

Dumby
Не посмотрите, где тут лажа? Это миниплеер прибить на ютуб. Может другое есть средство?
Вроде заделал скрипт. Как бы в свои вставить , а не в обезьяну ?

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

Выделить код

Код:

function fuckthatshit(a) 
{
  a.classList.remove('yt-simple-endpoint');            
}      
new MutationObserver(function(_,self) {
 for (let link of document.links) {
            if (!link.classList.contains('')) {
                fuckthatshit(link);
 }                         
}      
}).observe(document, {childList:true, subtree:true})

Отредактировано ВВП (04-09-2021 20:39:10)

Отсутствует

 

№1581304-09-2021 10:29:36

kaktusok
Участник
 
Группа: Members
Зарегистрирован: 22-02-2021
Сообщений: 2
UA: Firefox 91.0

Re: Custom Buttons

dumby может это поможет

кнопка

Выделить код

Код:

data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ2cASEhIAKs+PgC9Pz8AvEFBALxCQgC8REQAvEREALxDQwC8QUEAvD8/ALw/PwC9RkYAsV9fAFoAAAAAbm4AQjMzAP8TEwD/FRUA/xkZAP8eHgD/IiIA/yMjAP8jIwD/IiIA/x8fAP8aGgD/FxcA/xMTAP8vLwD/X18AX0xMAKgbGwD/GxsA/yQkAP8rKwD/JiYA/xsbAP8XFwD/FxcA/x0dAP8oKAD/LS0A/yQkAP8fHwD/FxcA/0VFAMhLSwCyKCgA/ywsAP82NgD/IyMA/w8PAP8NDQD/Dw8A/w8PAP8NDQD/EBAA/yYmAP84OAD/Ly8A/yYmAP9GRgDPVVUArzk5AP9AQAD/KysA/w4OAP8TEwD/EBAA/xAQAP8VFQD/FhYA/xQUAP8PDwD/Li4A/0REAP83NwD/UFAAzV9fAK9NTQD/REQA/xUVAP8WFgD/HBwA/1BQAP86OgD/FRUA/xUVAP8aGgD/GBgA/xcXAP9JSQD/S0sA/1tbAM1paQCvYWEA/zk5AP8VFQD/GxsA/ycnAP+CggD/jY0A/2trAP8zMwD/FRUA/xwcAP8VFQD/Pz8A/2FhAP9nZwDNdHQAr3R0AP81NQD/GxsA/yAgAP8tLQD/kpIA/6CgAP+kpAD/nJwA/21tAP8qKgD/GRkA/zs7AP91dQD/c3MAzYCAAK+IiAD/PDwA/yAgAP8lJQD/MzMA/6ioAP+2tgD/trYA/8DAAP+kpAD/NzcA/xoaAP9DQwD/iYkA/4CAAM2JiQCvnp4A/1hYAP8gIAD/KSkA/z09AP/GxgD/4+MA/9bWAP+NjQD/QEAA/y8vAP8eHgD/XFwA/5ycAP+KigDNk5MAr6urAP+SkgD/LCwA/zc3AP9QUAD/5OQA/9DQAP97ewD/X18A/21tAP9tbQD/YmIA/7a2AP+wsAD/k5MAzZubAK+zswD/yMgA/4ODAP86OgD/VlYA/3h4AP9tbQD/dHQA/4SEAP+GhgD/fX0A/87OAP///wn/8PAA/7CwAM2iogCywsIA/9LSAP/x8QD/qKgA/2RkAP9lZQD/e3sA/4iIAP+NjQD/nZ0A/+rqAP///y3///8f////If/KygDPqqoAqdXVAP/e3gD//v4A////If///wv/3NwA/8zMAP/Y2AD//PwA////N////1H///9J////kv///5b/wsIAyZiYAEbV1QD///8D////Hf///zv///9e////cf///3n///+A////hf///4L///90////cf///4j///89/5qaAGMAAAAAnp4ATdvbALHp6QC/9/cAvv//B77//xS+//8fvv//I77//x6+//8Xvv//D77//wW/7u4AtpiYAGAAAAAAgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAA==

Добавлено 04-09-2021 10:31:18
инициализация

Выделить код

Код:

var path = "C:\\Program Files\\DAUM\\PotPlayer\\PotPlayerMini.exe";


this.onclick =e=> {
   if ( e.button == 0 )
        play(gBrowser.currentURI.spec, "");

   if ( e.button == 1 ) gShowPopup(self); 
    
   if ( e.button == 2 && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey ) { 
        e.preventDefault();  
        play(gBrowser.currentURI.spec, "/add");           
        }
};
this.oncontextmenu =e=> { e.button && !e.ctrlKey && e.preventDefault() };




    
function play(link, param) {
   var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
   var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
   file.initWithPath(path);
   process.init(file);
   process.run(false, [link, param], 2);
};


self.tooltipText = "Л: Открыть видео в " + playerName + "\nС: CB Меню \nП: Добавить видео в плейлист " + playerName;

Добавлено 04-09-2021 10:32:24
и поставь potplayer

Добавлено 04-09-2021 10:35:05
или поставь аддон potplayer youtube shortcut

Отредактировано kaktusok (04-09-2021 10:35:05)

Отсутствует

 

№1581405-09-2021 11:58:31

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

Re: Custom Buttons

kaktusok
Вот кнопка на все времена. И все плееры (Mpc,KMP и т.д) Путь к плееру -см. внимательно , свой !Перехват всего MP4  и прямых . Кроме, HLS/TS , ссылку дучше из IDM иди аддона Video DownloadHelper и из буфера обмена в плеер(ПКМ)

Выделить код

Код:

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%u0412%u0438%u0434%u0435%u043E%20%u0432%20Potplayer%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEhIAAAEAIACABQAAFgAAACgAAAASAAAAJAAAAAEAIAAAAAAAWAUAAAAAAAAAAAAAAAAAAAAAAACFEg4A/1QOAf9bFy/qSQ1i7UQEYuxHBmHtSAhi7EcLY+1IDGLtSAxj7EgLYu1ICmPsSAhi7kQEYelDCmL5aBU4/8kkAls/EQBxCwAA70YHcaYjAPx1DwD/fBIA/3wTAP99EwD/fhMA/30SAP9+EwD/fhMA/30TAP99EwD/fRMA/3UPAP+aHgD/5UYGjxkIAAD/jAYYxS4A6lEAAP1YAAD1WgEA+VkCAPlZAAD5WQEA+lkCAPpZAAD6WAIA+lkAAPpZAAD4WQMA+V0BAPdJAAD4riIA//9pDizwVBhKmR0A/1gAAPlpBgD8ZQkA/GQFAP1lBwD+ZgkA/mcGAP5mCAD+ZgcA/mUFAP5jCQD8ZQYA/WkGAPxYAQD3iRcA/elQEmzrSw9XgBMA/lgAAPpgBQD9XAYA/WICAP1iCQD+YQYA/mEDAP5fCgD+YgQA/mMFAP5hCwD+XgAA/WEHAP5XAgD5eA8A/u9LDXbyVBZSkBgA/lMAAPpkBQD9bgoA/m0MAP5kBQD+YwUA/2IIAP9iBQD/YQUA/2MGAP9xCwD+cAsA/mYGAP5XAAD5hhQA//JVGHP6WxZUpyQA/2MEAPqGFwD9fBMA/mAGAP5hBgD+YAYA/mUJAP5jBgD+YQUA/mAGAP5iBQD+gRMA/ooXAP5sCQD6nyIA//ZbGHX+WhFVxTMA/5UbAPqbIAD+YgYA/14DAP1hBgD/YgUA/1QAAP9dBAD/ZAgA/2QIAP9dAwD/ZQgA/aMiAP+eIAD5vjIA//pgFXb/Ww5U7EIA/70vAPqHFQD9WgIA/loCAP59EQD+6kwL/70xAf9lBAD/UwAA/18HAP9lCAD+VAAA/o4ZAP7LNQD65kIA//1mGXX+Xw1V/1cQ/9UyAPpoCQD+YgUA/1QAAP6QGAD/+20d//94Jf/5Xw7/oikD/2EAAP9dAgD/WwIA/nENAP/lOwH6/1kR//tzLHb6ZQ1U/mog/90/CfpeBAD+ZQgA/1MAAf6ZHgD/+oc5//6USv/+k03//5JG//NsIP+RIwj/WAEA/mgIAP/fSBT6/nEt//p/OnX7bxxV/3kr/91PFvpfBAD+ZQkA/1IBAf6qIwD//55W//+jZf/9o2P//LBn//ukUP+sPRv/TQAA/moNAf/iVxn6/3or//uBOnb8dipU/os//+9oHvp/DAD9YgYA/2AAAf65MAD//q9R//7Iaf/9xWH/+oQu/8gqAP96CAD+WQIA/owNAP7zbST6/o1B//yDOXX+fS5S/JpW//+WR/q5NhH+ZwgC/o0UA/7fRwD+/+Vd//3QVP//dhr/+EAB/91GFf/sVRb/xzML/eNfHf//p1X6/bte//6KPHP/gTRX/Z5e/fyrZ/rvkDz9sB8A/6wgAv3rSQD//YEk/v5hG/7+Sw/+/2Ug/v92Kf7/ZB/+/3kq/v/eXv7+61r5/+Jj/f+VO3j+lERC/6he//2nYfj/yWH9+ak0/eNAAP70NgL9/k0U/v5gHf7+dyn+/nwy/v14Jv78iTb+/NiR/vz/lv7+/Ib7//GU//6HMmH/o08L/ptBuv+3Zf/90178//ln///cef/+mVX//341//6ANf//kEr//6Ra///Kkf/+8uT//v/d//75nv/7/6///cZr0/5dCBb/hCgA/2USE/6tSIT/3Wap/ux+pP/6oqb+86Wm/vCpp/7ytaf+9bun//Wwp//4rab/+Lym/uyzpf/mnqj+uFaQ/okNH/+OHACAAEAAgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAQAA%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B%28func%20%3D%3E%20%7B%0A%09var%20sysPlayerName%20%3D%20%22Pot%20Player%22%3B%0A%09var%20path%20%3D%20%22D%3A%5C%5CPotPlayer%5C%5CPotPlayerMini64.exe%22%3B%0A%09var%20videoMoved%20%3D%20%22%u0412%u0438%u0434%u0435%u043E%20%u043F%u0435%u0440%u0435%u043D%u0435%u0441%u0435%u043D%u043E%20%u0432%20%22%20+%20sysPlayerName%3B%0A%09var%20noFound%20%3D%20%22%u041D%u0435%20%u043D%u0430%u0439%u0434%u0435%u043D%u043E%20%u0432%u0438%u0434%u0435%u043E%20%u043D%u0430%20%u0441%u0442%u0440%u0430%u043D%u0438%u0446%u0435%2C%20%u0434%u043E%u0441%u0442%u0443%u043F%u043D%u043E%u0435%20%u0434%u043B%u044F%20%u043F%u0435%u0440%u0435%u043D%u043E%u0441%u0430%20%u0432%20%22%20+%20sysPlayerName%3B%0A%0A%09%0A%09this.label%20%3D%20%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0432%u0438%u0434%u0435%u043E%20%u0432%20%22%20+%20sysPlayerName%3B%0A%09this.tooltipText%20%3D%20%22%u041B%3A%20%u0412%u0438%u0434%u0435%u043E%20%u0432%20%u043F%u043B%u0435%u0435%u0440%5Cn%u041F%3A%20%u0412%u0438%u0434%u0435%u043E%20%u0438%u0437%20Clipboard%22%3B%0A%0A%09this._handleClick%20%3D%20%28%29%20%3D%3E%20%7B%0A%09%09var%20msgName%20%3D%20_id%20+%20%22%3APlayer%22%3B%0A%09%09var%20listener%20%3D%20%28%7Bdata%7D%29%20%3D%3E%20data%20%3F%20run%28%5Bdata%5D%29%20%3A%20notify%28%29%3B%0A%09%09messageManager.addMessageListener%28msgName%2C%20listener%29%3B%0A%09%09addDestructor%28%28%29%20%3D%3E%20messageManager.removeMessageListener%28msgName%2C%20listener%29%29%3B%0A%0A%09%09var%20url%20%3D%20%22data%3Acharset%3Dutf-8%2C%22%20+%20encodeURIComponent%28%0A%09%09%09%60%28%24%7Bfunc%7D%29%28%29%60.replace%28%22MSG_NAME%22%2C%20msgName%29%0A%09%09%09%09.replace%28%22VIDEO_MOVED%22%2C%20encodeURIComponent%28videoMoved%29%29%0A%09%09%09%09.replace%28%22CONFIRM%22%2C%20encodeURIComponent%28%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0441%u0441%u044B%u043B%u043A%u0443%20%u0432%20%u043F%u043B%u0435%u0435%u0440%u0435%20%3F%22%29%29%0A%09%09%29%3B%0A%09%09%28this._handleClick%20%3D%20%28%29%20%3D%3E%20gBrowser.selectedBrowser.messageManager.loadFrameScript%28url%2C%20false%29%29%28%29%3B%0A%09%7D%0A%09this.onauxclick%20%3D%20e%20%3D%3E%20e.button%20%21%3D%201%20%7C%7C%20gShowPopup%28this%29%3B%0A%09this.oncontextmenu%20%3D%20e%20%3D%3E%20%7B%0A%09%09if%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%29%20return%3B%0A%09%09e.preventDefault%28%29%3B%0A%09%09custombuttons.confirmBox%28null%2C%20%22%u0417%u0430%u043F%u0443%u0441%u0442%u0438%u0442%u044C%20%u043F%u043B%u0435%u0435%u0440%20%u0438%u0437%20%u0431%u0443%u0444%u0435%u0440%u0430%20%u043E%u0431%u043C%u0435%u043D%u0430%20%3F%22%2C%20%22%u0414%u0430%22%2C%20%22%u041D%u0435%u0442%22%29%0A%09%09%09%26%26%20run%28%5BgClipboard.read%28%29%2C%20%22/play%22%5D%29%3B%0A%09%7D%0A%09var%20popup%20%3D%20document.getElementById%28%22contentAreaContextMenu%22%29%3B%0A%09addEventListener%28%22popupshowing%22%2C%20%7B%0A%09%09get%20hidden%28%29%20%7B%0A%09%09%09return%20%21%28gContextMenu.onLink%20%7C%7C%20gContextMenu.onVideo%20%7C%7C%20gContextMenu.onPlainTextLink%29%3B%0A%09%09%7D%2C%0A%09%09handleEvent%28%29%20%7B%0A%09%09%09if%20%28this.hidden%29%20return%3B%0A%09%09%09var%20menuitem%20%3D%20document.createXULElement%28%22menuitem%22%29%3B%0A%09%09%09for%28var%20args%20of%20Object.entries%28%7B%0A%09%09%09%09image%3A%20self.image%2C%0A%09%09%09%09oncommand%3A%20%22play%28%29%22%2C%0A%09%09%09%09class%3A%20%22menuitem-iconic%22%2C%0A%09%09%09%09label%3A%20%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0432%20%22%20+%20sysPlayerName%0A%09%09%09%7D%29%29%0A%09%09%09%09menuitem.setAttribute%28...args%29%3B%0A%09%09%09menuitem.play%20%3D%20%28%29%20%3D%3E%20play%28gContextMenu.linkURL%20%7C%7C%20gContextMenu.mediaURL%29%3B%0A%09%09%09document.getElementById%28%22context-savelink%22%29.before%28menuitem%29%3B%0A%09%09%09addDestructor%28%28%29%20%3D%3E%20menuitem.remove%28%29%29%3B%0A%09%09%09this.handleEvent%20%3D%20e%20%3D%3E%20%7B%0A%09%09%09%09if%20%28e.target%20%3D%3D%20popup%29%20menuitem.hidden%20%3D%20this.hidden%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%2C%20false%2C%20popup%20%7C%7C%201%29%3B%0A%0A%09var%20play%20%3D%20link%20%3D%3E%20custombuttons.confirmBox%28null%2C%20%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0441%u0441%u044B%u043B%u043A%u0443%20%u0432%20%u043F%u043B%u0435%u0435%u0440%u0435%20%3F%22%2C%20%22%u0414%u0430%22%2C%20%22%u041E%u0442%u043C%u0435%u043D%u0430%22%29%20%26%26%20run%28%5Blink%5D%29%3B%0A%09var%20run%20%3D%20args%20%3D%3E%20%7B%0A%09%09var%20file%20%3D%20FileUtils.File%28path%29%3B%0A%09%09%28run%20%3D%20args%20%3D%3E%20%7B%0A%09%09%09if%20%28%21file.exists%28%29%29%20return%20custombuttons.alertBox%28%22File%20not%20exists%21%22%2C%20path%29%3B%0A%09%09%09var%20process%20%3D%20Cc%5B%22@mozilla.org/process/util%3B1%22%5D.createInstance%28Ci.nsIProcess%29%3B%0A%09%09%09process.init%28file%29%3B%0A%09%09%09process.runwAsync%28args%2C%20args.length%29%3B%0A%09%09%7D%29%28args%29%3B%0A%09%7D%0A%09var%20notify%20%3D%20%28%29%20%3D%3E%20%7B%0A%09%09var%20name%20%3D%20_id%20+%20%22-noFound%22%3B%0A%09%09var%20as%20%3D%20Cc%5B%22@mozilla.org/alerts-service%3B1%22%5D.getService%28Ci.nsIAlertsService%29%3B%0A%09%09%28notify%20%3D%20%28%29%20%3D%3E%20setTimeout%28as.closeAlert%2C%201150%2C%20name%2C%20as.showAlertNotification%28%0A%09%09%09%22chrome%3A//global/skin/icons/question-48.png%22%2C%20%22%22%2C%20noFound%2C%20false%2C%20%22%22%2C%20null%2C%20name%0A%09%09%29%29%29%28%29%3B%0A%09%7D%0A%0A%7D%29%28%28%29%20%3D%3E%20%7B%0A%0A%09var%20found%2C%20videoMoved%2C%20SEND%20%3D%20msg%20%3D%3E%20%7B%0A%09%09found%20%3D%20true%3B%0A%09%09if%20%28%21msg%20%7C%7C%20Cc%5B%22@mozilla.org/embedcomp/prompt-service%3B1%22%5D%0A%09%09%09.getService%28Ci.nsIPromptService%29%0A%09%09%09.confirm%28content%2C%20null%2C%20decodeURIComponent%28%22CONFIRM%22%29%29%0A%09%09%29%20%7B%0A%09%09%09if%20%28msg%29%20videoMoved%20%3D%20decodeURIComponent%28%22VIDEO_MOVED%22%29%3B%0A%09%09%09sendAsyncMessage%28%22MSG_NAME%22%2C%20msg%29%3B%0A%09%09%7D%0A%09%09else%20return%20true%3B%0A%09%7D%0A%0A%09var%20YoutubeID%20%3D%20/%28%3F%3Ayoutube%28%3F%3A-nocookie%29%3F%5C.com%5C/%28%3F%3A%5B%5E%5C/%5Cn%5Cs%5D+%5C/%5CS+%5C/%7C%28%3F%3Av%7Ce%28%3F%3Ambed%29%3F%29%5C/%7C%5CS*%3F%5B%3F%26%5Dv%3D%29%7Cyoutu%5C.be%5C/%29%28%5Ba-zA-Z0-9_-%5D%7B11%7D%29%28%3F%3A%5CW%7C%24%29/%3B%0A%0A%09var%20tmp%20%3D%20%27%27%2C%0A%09tmpp%20%3D%20%27%27%2C%0A%09innerA%20%3D%20%27%3Cdiv%20style%3D%22display%3Ablock%21important%3Bcolor%3A%2300ff00%21important%3Bwidth%3A250px%21important%3Bfont%3Abold%2016px%20serif%21important%3Bz-index%3A999%21important%3Bopacity%3A1%21important%3Bvisibility%3A%20visible%21important%3B%27%2C%0A%09innerB%20%3D%20%27left%3A5px%21important%3Bposition%3Aabsolute%21important%3Bheight%3Aauto%21important%3Bbox-sizing%3Aborder-box%21important%3Bpadding%3A5px%21important%3Bmargin%3A5px%21important%3B%27%2C%0A%09//stopPl%20%3D%20%22javascript%3A%28function%28%29%7Bv%3Ddocument.getElementById%28%27movie_player%27%29%3Bif%28v%29%7Bv.stopVideo%28%29%7Delse%7Bv%3Ddocument.getElementsByTagName%28%27video%27%29%3Bif%28v%29%7Bv%5B0%5D.src%3D%27%27%3Btry%7Bv%5B0%5D.load%28%29%7Dcatch%28e%29%7B%7D%7D%3B%7D%7D%29%28%29%3B%22%2C%0A%09ytIMGouter%20%3D%20function%20%28ytID%29%20%7B%0A%09%09return%20%27%3Cdiv%20width%3D%22100%25%22%3E%3Cbr%20/%3E%3Ca%20target%3D%22_blank%22%20href%3D%22https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20ytID%20+%20%27%22%3E%3Cimg%20src%3D%22https%3A//i.ytimg.com/vi/%27%20+%20ytID%20+%20%27/hqdefault.jpg%22%3E%3C/a%3E%3Cbr%20/%3E%27%20+%20innerA%20+%20%27background-color%3Ablack%21important%3Bposition%3Arelative%21important%3Bbottom%3A20px%21important%3B%22%3E%26nbsp%3B%26nbsp%3B%27%20+%20videoMoved%20+%20%27%3C/div%3E%3Cbr%20/%3E%3C/div%3E%3Cbr%20/%3E%27%0A%09%7D%2C%0A%09handlWin%20%3D%20function%20%28currentWin%29%20%7B%0A%09%09tmp%20%3D%20%27%27%3B%0A%09%09var%20elem%20%3D%20currentWin.document.getElementsByTagName%28%27video%27%29%2C%0A%09%09currLoc%20%3D%20currentWin.location%3B%0A%09%09if%20%28elem.length%20%3E%200%29%20%7B%0A%09%09%09if%20%28currLoc.hostname.indexOf%28%27youtu%27%29%20%21%3D%20-1%20%26%26%20%28tmp%20%3D%20currLoc.toString%28%29.match%28YoutubeID%29%29%20%26%26%20tmp%5B1%5D.length%20%3D%3D%2011%29%20%7B%0A%0A%09%09%09%09if%20%28SEND%28%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%29%20return%3B%0A%0A%09%09%09%09videoMovedbox%20%3D%20currentWin.document.createElement%28%27videoMoved%27%29%3B%0A%09%09%09%09videoMovedbox.innerHTML%20%3D%20innerA%20+%20innerB%20+%20%27top%3A-15px%21important%3B%22%3E%3Cb%3E%27%20+%20videoMoved%20+%20%27%3C/b%3E%3C/div%3E%27%3B%0A%0A%09%09%09%09//loadURI%28stopPl%29%3B%0A%09%09%09%09%28function%28d%29%7Bvar%20v%3Dd.getElementById%28%27movie_player%27%29%3Bif%28v%29%7Btry%7Bv.stopVideo%28%29%7Dcatch%7B%7D%7D%0A%09%09%09%09%09else%7Bv%3Dd.getElementsByTagName%28%27video%27%29%3Bif%28v%5B0%5D%29%7Bv%5B0%5D.src%3D%27%27%3Btry%7Bv%5B0%5D.load%28%29%7Dcatch%7B%7D%7D%3B%7D%7D%29%28currentWin.document%29%3B%0A%0A%09%09%09%09currentWin.document.getElementById%28%27eow-title%27%29.appendChild%28videoMovedbox%29%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%3B%0A%09%09%09for%20%28i%20%3D%200%3B%20i%20%3C%20elem.length%3B%20i++%29%20%7B%0A%09%09%09%09if%20%28%28%28tmp%20%3D%20getSrc%28elem%5Bi%5D.parentNode%2C%20currLoc%29%29%20%26%26%20tmp.length%20%3E%202%29%20%7C%7C%20%28i%20%3D%3D%200%20%26%26%20currentWin.document.body.innerHTML.substring%280%2C%207%29%20%3D%3D%20%27%3Cvideo%20%27%20%26%26%20%28tmp%20%3D%20currLoc.toString%28%29%29%29%29%20%7B%0A%0A%09%09%09%09%09if%20%28SEND%28tmp%29%29%20return%3B%0A%0A%09%09%09%09%09videoMovedbox%20%3D%20currentWin.document.createElement%28%27videoMoved%27%29%3B%0A%09%09%09%09%09videoMovedbox.innerHTML%20%3D%20innerA%20+%20innerB%20+%20%27top%3A20px%21important%3Bbackground-color%3Ablack%21important%3B%22%3E%27%20+%20videoMoved%20+%20%27%3C/div%3E%27%3B%0A%0A%09%09%09%09%09if%20%28currLoc.hostname%20%3D%3D%20%27www.youtube.com%27%29%20%7B%0A%09%09%09%09%09%09elem%5Bi%5D.parentNode.parentNode.appendChild%28videoMovedbox%29%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09elem%5Bi%5D.parentNode.appendChild%28videoMovedbox%29%3B%0A%09%09%09%09%09%7D%3B%0A%09%09%09%09%09elem%5Bi%5D.src%20%3D%20%27%27%3B%0A%09%09%09%09%09try%20%7B%0A%09%09%09%09%09%09elem%5Bi%5D.load%28%29%0A%09%09%09%09%09%7D%20catch%20%28e%29%20%7B%7D%3B%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0A%09%09currentWin._elems%20%3D%20currentWin.document.getElementsByTagName%28%27iframe%27%29%3B%0A%09%09if%20%28currentWin._elems.length%20%3E%200%29%20%7B%0A%09%09%09for%20%28currentWin._iCounter%20%3D%200%3B%20currentWin._iCounter%20%3C%20currentWin._elems.length%3B%20currentWin._iCounter++%29%20%7B%0A%09%09%09%09if%20%28%28currentWin._elems%5BcurrentWin._iCounter%5D.src.indexOf%28%27youtube.com%27%29%20%3E%20-1%29%20%26%26%20%28tmp%20%3D%20currentWin._elems%5BcurrentWin._iCounter%5D.src.match%28YoutubeID%29%29%20%26%26%20%28tmp%5B1%5D.length%20%3D%3D%2011%29%29%20%7B%0A%0A%09%09%09%09if%20%28SEND%28%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%29%20return%3B%0A%0A%09%09%09%09currentWin._elems%5BcurrentWin._iCounter%5D.outerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%09%7D%3B%0A%09%09%09%09if%20%28currentWin._elems%5BcurrentWin._iCounter%5D.clientWidth%20%3E%2080%20%26%26%20currentWin._elems%5BcurrentWin._iCounter%5D.clientHeight%20%3E%2040%20%26%26%20handlWin%28currentWin._elems%5BcurrentWin._iCounter%5D.contentWindow%29%29%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0A%09%09elem%20%3D%20currentWin.document.getElementsByTagName%28%27object%27%29%3B%0A%09%09currLoc%20%3D%20currentWin.location%3B%0A%09%09if%20%28elem.length%20%3D%3D%200%29%20%7B%0A%09%09%09elem%20%3D%20currentWin.document.getElementsByTagName%28%27embed%27%29%0A%09%09%7D%3B%0A%09%09if%20%28elem.length%20%3E%200%29%20%7B%0A%09%09%09for%20%28i%20%3D%200%3B%20i%20%3C%20elem.length%3B%20i++%29%20%7B%0A%09%09%09%09if%20%28elem%5Bi%5D.innerHTML.indexOf%28%27youtu%27%29%20%21%3D%20-1%20%26%26%20%28tmp%20%3D%20elem%5Bi%5D.innerHTML.match%28YoutubeID%29%29%20%26%26%20tmp%5B1%5D.length%20%3D%3D%2011%29%20%7B%0A%0A%09%09%09%09%09if%20%28SEND%28%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%29%20return%3B%0A%0A%09%09%09%09%09elem%5Bi%5D.outerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09if%20%28elem%5Bi%5D.clientWidth%20%3E%2080%20%26%26%20elem%5Bi%5D.clientHeight%20%3E%2040%29%20%7B%0A%09%09%09%09%09%09if%20%28%28%28tmp%20%3D%20getSrc%28elem%5Bi%5D.parentNode%2C%20currLoc%29%29%20%7C%7C%20%28tmp%20%3D%20getLink%28elem%5Bi%5D%2C%20currLoc%29%29%29%20%26%26%20tmp.length%20%3E%202%29%20%7B%0A%0A%09%09%09%09%09%09%09if%20%28SEND%28tmp%29%29%20return%3B%0A%0A%09%09%09%09%09%09%09elem%5Bi%5D.outerHTML%20%3D%20innerA%20+%20%27background-color%3Ablack%21important%3Bbottom%3A20px%21important%3B%22%3E%26nbsp%3B%26nbsp%3B%27%20+%20videoMoved%20+%20%27%3C/div%3E%27%3B%0A%09%09%09%09%09%09%09return%20true%3B%0A%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%7D%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%3B%0A%09%09%7D%3B%0A%09%09return%20false%3B%0A%09%7D%3B%0A%0A%09function%20restProtHost%28lnkR%2C%20curLoc%29%20%7B%0A%09%09if%20%28lnkR.length%20%3D%3D%200%29%0A%09%09%09return%20%27%27%3B%0A%09%09let%20tr%20%3D%20lnkR.replace%28/%5E%3A%5C/%5C//%2C%20curLoc.protocol%20+%20%22//%22%29%3B%0A%09%09if%20%28%21tr.match%28/%5Ehttps%3F%3A%5C/%5C//i%29%29%20%7B%0A%09%09%09lnkR%20%3D%20tr.replace%28/%5E%5C/+/%2C%20%27%27%29%3B%0A%09%09%09if%20%28lnkR.split%28%27/%27%29%5B0%5D.split%28%27%3F%27%29%5B0%5D.split%28%27%23%27%29%5B0%5D.toLowerCase%28%29.match%28/%5E%28%3F%3A%5B-a-z%5Cd%5D+%5C.%29+%5Ba-z%5Cd%5D%7B2%2C6%7D%24/%29%29%20%7B%0A%09%09%09%09tr%20%3D%20curLoc.protocol%20+%20%27//%27%20+%20lnkR%3B%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09tr%20%3D%20curLoc.protocol%20+%20%27//%27%20+%20curLoc.host%20+%20%22/%22%20+%20lnkR%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09return%20tr%3B%0A%09%7D%3B%0A%0A%09function%20getSrc%28vobj%2C%20currentLoc%29%20%7B%0A%09%09var%20t%20%3D%20%27%27%2C%0A%09%09tt%20%3D%20%27%27%3B%0A%09%09if%20%28%28%28%28t%20%3D%20vobj.innerHTML.match%28/%3Cvideo.*%3F%5Cssrc%3D%28%3F%3A%28%3F%3A%27%28%5B%5E%27%5D*%29%27%29%7C%28%3F%3A%22%28%5B%5E%22%5D*%29%22%29%7C%28%5B%5E%5Cs%5D*%29%29/i%29%29%20%26%26%20%28t%29%20%26%26%20%28tt%20%3D%20t%5B1%5D%20%7C%7C%20t%5B2%5D%20%7C%7C%20t%5B3%5D%29%20%26%26%20tt.indexOf%28%27blob%3A%27%29%20%3D%3D%20-1%29%20%7C%7C%20%28%28t%20%3D%20vobj.innerHTML.match%28/%3Csource.*%3F%5Cssrc%3D%28%3F%3A%28%3F%3A%27%28%5B%5E%27%5D*%29%27%29%7C%28%3F%3A%22%28%5B%5E%22%5D*%29%22%29%7C%28%5B%5E%5Cs%5D*%29%29.*%3F%5Cstype%3D%5B%27%22%5D%3Fvideo%5C//i%29%29%20%26%26%20%28t%29%20%26%26%20%28tt%20%3D%20t%5B1%5D%20%7C%7C%20t%5B2%5D%20%7C%7C%20t%5B3%5D%29%29%29%20%26%26%20tt.length%20%3E%202%20%26%26%20tt.indexOf%28%27blob%3A%27%29%20%3D%3D%20-1%29%20%7B%0A%09%09%09if%20%28tt.indexOf%28%22.mp4/%3F%22%29%20%3D%3D%20-1%29%20%7B%0A%09%09%09%09tt%20%3D%20tt.replace%28/%26amp%3B/g%2C%20%22%26%22%29%0A%09%09%09%7D%3B%0A%09%09%09t%20%3D%20restProtHost%28tt%2C%20currentLoc%29%3B%0A%09%09%09return%20t%3B%0A%09%09%7D%3B%0A%09%09return%20%27%27%3B%0A%09%7D%3B%0A%0A%09function%20getLink%28obj%2C%20curLocation%29%20%7B%0A%0A%09%09if%20%28%21obj%20%7C%7C%20%21obj.tagName%29%0A%09%09%09return%20%27%27%3B%0A%09%09q%20%3D%20obj.tagName.toLowerCase%28%29%3B%0A%0A%09%09var%20getParam%20%3D%20function%20%28e%2C%20n%29%20%7B%0A%09%09%09var%20v%20%3D%20%27%27%2C%0A%09%09%09r%20%3D%20new%20RegExp%28%27%5E%28%27%20+%20n%20+%20%27%29%24%27%2C%20%27i%27%29%2C%0A%09%09%09param%20%3D%20e.getElementsByTagName%28%27param%27%29%3B%0A%09%09%09for%20%28var%20igp%20%3D%200%2C%20p%3B%20p%20%3D%20param%5Bigp%5D%3B%20igp++%29%20%7B%0A%09%09%09%09if%20%28p.hasAttribute%28%27name%27%29%20%26%26%20p.getAttribute%28%27name%27%29.match%28r%29%29%20%7B%0A%09%09%09%09%09v%20%3D%20p.getAttribute%28%27value%27%29%3B%0A%09%09%09%09%09break%0A%09%09%09%09%7D%3B%0A%09%09%09%7D%3B%0A%09%09%09return%20v%3B%0A%09%09%7D%3B%0A%0A%09%09var%20restPath%20%3D%20function%20%28f%2C%20s%29%20%7B%0A%09%09%09return%20%28f.substring%280%2C%204%29%20%3D%3D%20%27http%27%29%20%3F%20f%20%3A%20s.replace%28/%5B%23%3F%5D.*%24/%2C%20%27%27%29.replace%28/%5B%5E%5C/%5D*%24/%2C%20f%29%0A%09%09%7D%3B%0A%0A%09%09function%20videoLinkExtract%28fl%29%20%7B%0A%09%09%09alert%28fl%29%3B%0A%09%09%09var%20linkArr%20%3D%20%5B%5D%2C%0A%09%09%09outLinks%20%3D%20%5B%5D%2C%0A%09%09%09jj%20%3D%200%2C%0A%09%09%09lba%20%3D%20%27%27%2C%0A%09%09%09lbb%20%3D%20%27%27%2C%0A%09%09%09decodeURL%20%3D%20gBrowser.currentURI.spec%3B%20%7B%0A%09%09%09%09try%20%7B%0A%09%09%09%09%09return%20decodeURIComponent%28s%29%0A%09%09%09%09%7D%20catch%20%28e%29%20%7B%0A%09%09%09%09%09return%20unescape%28s%29%0A%09%09%09%09%7D%0A%09%09%09%7D%3B%0A%0A%09%09%09for%20%28var%20ij%20%3D%200%3B%20ij%20%3C%203%3B%20ij++%29%20%7B%0A%09%09%09%09lba%20%3D%20lba%20+%20String.fromCharCode%28parseInt%28%28Math.random%28%29%20*%2015%20+%201%29%20+%20%27%27%2C%2010%29%29%3B%0A%09%09%09%09lbb%20%3D%20lbb%20+%20String.fromCharCode%28parseInt%28%28Math.random%28%29%20*%2015%20+%2016%29%20+%20%27%27%2C%2010%29%29%3B%0A%09%09%09%7D%3B%0A%0A%09%09%09function%20pushWithMerit%28lnk%29%20%7B%0A%0A%09%09%09%09var%20merit%20%3D%20-11%3B%0A%09%09%09%09if%20%28lnk.match%28/%5Ehttps%3F%3A%5C/%5C//i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%2040%3B%0A%09%09%09%09if%20%28outLinks.length%20%3D%3D%200%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%201%3B%0A%09%09%09%09if%20%28lnk.match%28/%5E%5C//%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%207%3B%0A%09%09%09%09if%20%28lnk.match%28/%5E%5C/%5C//%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%2030%3B%0A%09%09%09%09if%20%28lnk.match%28/240p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%201%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D240%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%201%3B%0A%09%09%09%09if%20%28lnk.match%28/360p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%203%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D360%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%203%3B%0A%09%09%09%09if%20%28lnk.match%28/480p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%205%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D480%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%205%3B%0A%09%09%09%09if%20%28lnk.match%28/720p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%207%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D720%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%207%3B%0A%09%09%09%09if%20%28lnk.match%28/%5C.mp4%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%208%3B%0A%09%09%09%09if%20%28lnk.match%28/_hd%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%206%3B%0A%09%09%09%09if%20%28lnk.match%28/%5C.%28jpg%7Cxml%29%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20-%2040%3B%0A%09%09%09%09if%20%28merit%20%3E%200%29%0A%09%09%09%09%09outLinks.push%28merit%20+%20lba%20+%20lnk%29%3B%0A%09%09%09%09Services.console.logStringMessage%28%27merit%3A%27%20+%20merit%20+%20%27%20lnk-%3E%27%20+%20lnk%29%3B%0A%09%09%09%7D%3B%0A%0A%09%09%09linkArr.push%28fl%29%3B%0A%09%09%09while%20%28linkArr.length%20%3E%20jj%20%26%26%20jj%20%3C%2030%29%20%7B%0A%0A%09%09%09%09var%20testPaths%20%3D%20%5B%5D%3B%0A%09%09%09%09testPaths%20%3D%20linkArr%5Bjj%5D.split%28/%28%5C.%28%3F%3Aflv%7Cmp4%7Cm3u8%29%29/i%29%3B%0A%09%09%09%09if%20%28testPaths%5BtestPaths.length%20-%201%5D%20%3D%3D%20%27%27%29%0A%09%09%09%09%09testPaths.pop%28%29%3B%0A%0A%09%09%09%09for%20%28k%20%3D%201%3B%20k%20%3C%20testPaths.length%3B%20k%20%3D%20k%20+%202%29%20%7B%0A%0A%09%09%09%09%09if%20%28testPaths%5Bk%20-%201%5D.indexOf%28lba%29%20%3E%20-1%29%20%7B%0A%09%09%09%09%09%09pref%20%3D%20testPaths%5Bk%20-%201%5D%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09var%20testAboutDom%20%3D%20testPaths%5Bk%20-%201%5D.toLowerCase%28%29.split%28/%28https%3F%3A%5C/%5C/%29/%29%3B%0A%09%09%09%09%09%09if%20%28testAboutDom%5BtestAboutDom.length%20-%201%5D%20%3D%3D%20%27%27%29%0A%09%09%09%09%09%09%09testAboutDom.pop%28%29%3B%0A%09%09%09%09%09%09var%20pTest%20%3D%20testAboutDom%5BtestAboutDom.length%20-%201%5D.split%28/%28%5C%3F%5B%5E%5C%3F%5D*%3F%26%29/%29%3B%0A%09%09%09%09%09%09if%20%28pTest.length%20%3E%202%29%20%7B%0A%09%09%09%09%09%09%09pTest.pop%28%29%3B%0A%09%09%09%09%09%09%09pTest.pop%28%29%3B%0A%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09testAboutDom%5BtestAboutDom.length%20-%201%5D%20%3D%20pTest.join%28%27%27%29%3B%0A%09%09%09%09%09%09pref%20%3D%20testPaths%5Bk%20-%201%5D.substring%28testAboutDom.join%28%27%27%29.lastIndexOf%28%22%26%22%29%20+%201%29%3B%0A%09%09%09%09%09%7D%3B%0A%0A%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28lbb%29%3B%0A%09%09%09%09%09if%20%28t2%20%3E%20-1%29%20%7B%0A%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%203%29%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%0A%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28%27%7B%22%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28%27%5B%22%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28%27%2C%22%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%22http%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%22https%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%2Chttp%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%2Chttps%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%3Bhttp%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27*https%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%20or%20%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%204%29%3B%0A%0A%09%09%09%09%09%09pref%20%3D%20pref.substring%28pref.split%28%27/%27%29%5B0%5D.toLowerCase%28%29.split%28%27%252f%27%29%5B0%5D.lastIndexOf%28%27%3D%27%29%20+%201%29%3B%0A%0A%09%09%09%09%09%7D%0A%0A%09%09%09%09%09if%20%28pref.length%20%3E%200%29%20%7B%0A%0A%09%09%09%09%09%09if%20%28pref.split%28%27%3F%27%29%5B0%5D.toLowerCase%28%29.match%28/%25%5B2-3%5D%5B0-9a-f%5D/%29%29%20%7B%0A%0A%09%09%09%09%09%09%09t2%20%3D%20pref.indexOf%28%27%22%27%29%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09%09%09suff%20%3D%20testPaths%5Bk%20+%201%5D%20%3F%20testPaths%5Bk%20+%201%5D.split%28%27%26%27%29%5B0%5D.split%28%27%22%27%29%5B0%5D.split%28%27%3B%27%29%5B0%5D.split%28/%2Chttp/i%29%5B0%5D%20%3A%20%27%27%3B%0A%09%09%09%09%09%09%09if%20%28%28suff%20%21%3D%20testPaths%5Bk%20+%201%5D%29%20%7C%7C%20%28testPaths.length%20%3C%20k%20+%203%29%29%20%7B%0A%09%09%09%09%09%09%09%09if%20%28testPaths.length%20%3E%20k%20+%201%29%20%7B%0A%09%09%09%09%09%09%09%09%09testPaths%5Bk%20+%201%5D%20%3D%20%28%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%29%20%3F%20%27%27%20%3A%20%27%26%27%29%20+%20testPaths%5Bk%20+%201%5D.substr%28suff.length%29%0A%09%09%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28lba%29%3B%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%203%29%0A%09%09%09%09%09%09%09%09%09%09linkArr.push%28decodeURL%28pref%20+%20testPaths%5Bk%5D%20+%20suff%29%29%3B%0A%0A%09%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09%09testPaths%5Bk%20+%201%5D%20%3D%20%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%20%3F%20%27%27%20%3A%20lbb%29%20+%20pref%20+%20testPaths%5Bk%5D%20+%20suff%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09suff%20%3D%20testPaths%5Bk%20+%201%5D%20%3F%20testPaths%5Bk%20+%201%5D.split%28%27%3B%27%29%5B0%5D.split%28%27%22%5D%27%29%5B0%5D.split%28%27%22%7D%27%29%5B0%5D.split%28%27%22%2C%27%29%5B0%5D.split%28/%2Chttps%3F%3A%5C/%5C//i%29%5B0%5D.split%28%27*https%3A//%27%29%5B0%5D.split%28%27%20or%20%27%29%5B0%5D%20%3A%20%27%27%3B%0A%09%09%09%09%09%09%09t2%20%3D%20suff.indexOf%28%27%26%27%29%3B%0A%09%09%09%09%09%09%09if%20%28%28t2%20%3E%20-1%29%20%26%26%20%28pref%20%21%3D%20testPaths%5Bk%20-%201%5D%29%29%20%7B%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3D%3D%200%29%0A%09%09%09%09%09%09%09%09%09suff%20%3D%20%27%27%3B%0A%09%09%09%09%09%09%09%09if%20%28suff.charAt%280%29%20%21%3D%20%27%3F%27%29%0A%09%09%09%09%09%09%09%09%09suff%20%3D%20suff.split%28/%28%26%5B%5E%26%5D+%3Dhttps%3F%3A%5C/%5C/%29/i%29%5B0%5D%3B%0A%09%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09%09if%20%28%28suff%20%21%3D%20testPaths%5Bk%20+%201%5D%29%20%7C%7C%20%28testPaths.length%20%3C%20k%20+%203%29%29%20%7B%0A%09%09%09%09%09%09%09%09if%20%28testPaths.length%20%3E%20k%20+%201%29%20%7B%0A%09%09%09%09%09%09%09%09%09testPaths%5Bk%20+%201%5D%20%3D%20%28%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%29%20%3F%20%27%27%20%3A%20%27%26%27%29%20+%20testPaths%5Bk%20+%201%5D.substr%28suff.length%29%0A%09%09%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28lba%29%3B%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%203%29%3B%0A%09%09%09%09%09%09%09%09pushWithMerit%28pref%20+%20testPaths%5Bk%5D%20+%20suff%29%3B%0A%0A%09%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09%09testPaths%5Bk%20+%201%5D%20%3D%20lba%20+%20%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%20%3F%20%27%27%20%3A%20lbb%29%20+%20pref%20+%20testPaths%5Bk%5D%20+%20suff%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%3B%0A%09%09%09%09jj%20%3D%20jj%20+%201%3B%0A%09%09%09%7D%3B%0A%0A%09%09%09if%20%28outLinks.length%20%3D%3D%200%29%0A%09%09%09%09return%20%27%27%3B%0A%09%09%09function%20srt%28a%2C%20b%29%20%7B%0A%09%09%09%09a%20%3D%20parseInt%28a.substr%280%2C%20a.indexOf%28lba%29%29%2C%2010%29%3B%0A%09%09%09%09b%20%3D%20parseInt%28b.substr%280%2C%20b.indexOf%28lba%29%29%2C%2010%29%3B%0A%09%09%09%09if%20%28a%20%3C%20b%29%0A%09%09%09%09%09return%201%3B%0A%09%09%09%09if%20%28a%20%3E%20b%29%0A%09%09%09%09%09return%20-1%3B%0A%09%09%09%09return%200%0A%09%09%09%7D%3B%0A%09%09%09outLinks.sort%28srt%29%3B%0A%09%09%09outLinks%5B0%5D%20%3D%20outLinks%5B0%5D.substr%28outLinks%5B0%5D.indexOf%28lba%29%20+%203%29%0A%09%09%09%09if%20%28outLinks%5B0%5D.indexOf%28%27_hq.mp4/%3Ftime%3D%27%29%20%3E%200%29%0A%09%09%09%09%09outLinks%5B0%5D%20%3D%20outLinks%5B0%5D.replace%28/%26/g%2C%20%27%26amp%3B%27%29%3B%0A%09%09%09%09return%20outLinks%5B0%5D%3B%0A%09%09%7D%3B%0A%0A%09%09if%20%28%21ol%29%0A%09%09%09return%20%27%27%3B%0A%09%09//ol%20%3D%20ol.replace%28/%5E%3A%3F%5C/%5C//%2C%20curLocation.protocol%20+%20%22//%22%29%3B%0A%09%09//return%20restPath%28ol%2C%20src%29%3B%0A%09%09return%20restProtHost%28ol%2C%20curLocation%29%3B%0A%09%7D%3B%0A%0A%09try%20%7BhandlWin%28content%29%3B%7D%20finally%20%7Bfound%20%7C%7C%20SEND%28%29%3B%7D%0A%7D%29%3B%0A%0A%20var%20style%20%3D%20custombutton.buttonGetHelp%28self%29.replace%28/id/g%2C%20_id%29%3B%0Avar%20uri%20%3D%20makeURI%28%27data%3Atext/css%2C%27+%20encodeURIComponent%28style%29%29%3B%0Avar%20sss%20%3D%20Cc%5B%22@mozilla.org/content/style-sheet-service%3B1%22%5D.getService%28Ci.nsIStyleSheetService%29%3B%0Asss.loadAndRegisterSheet%28uri%2C%200%29%3B%20%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%0A%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E

Отсутствует

 

№1581505-09-2021 14:19:59

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

Подскажите команду для вызова Окна диалога выбора папки загрузки:

7ada1fb38c8277bcf7f3e49cea06ba6d.png


// Спасибо Dumby.

№15880

Отредактировано thrower (05-09-2021 21:27:56)

Отсутствует

 

№1581605-09-2021 20:31:12

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

Re: Custom Buttons

thrower пишет

Подскажите команду

Команду? В смысле, для страницы about:preferences?
Если, например, она в активной вкладке, то просто:
content.gMainPane.chooseFolder();


А если страницы нет, или просто независимо,
то надо всё добро оттуда с собой притащить,
приблизительно как-то так:

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

Выделить код

Код:

(async (dirp, listp) => {
	var desk = Services.dirsvc.get("Desk", Ci.nsIFile);
	var def = new FileUtils.File(await Downloads.getSystemDownloadsDirectory());

	var currentDirPref;
	var list = Services.prefs.getIntPref(listp);
	if (list == 0)
		currentDirPref = desk;
	else if (list == 1)
		currentDirPref = def;
	else try {
		currentDirPref = Services.prefs.getComplexValue(dirp, Ci.nsIFile);
	} catch {};

	var [title] = await new Localization(["browser/preferences/preferences.ftl"])
		.formatValues([{id: "choose-download-folder-title"}]);

	var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
	fp.init(window, title, fp.modeGetFolder);
	fp.appendFilters(fp.filterAll);

	fp.displayDirectory = currentDirPref?.exists()
		? currentDirPref : def?.exists() ? def : desk;

	var res = await new Promise(fp.open);
	if (res != fp.returnOK) return;

	var {file} = fp, eq = f => f && file.equals(f);
	Services.prefs.setIntPref(listp, eq(desk) ? 0 : eq(def) ? 1 : 2);
	Services.prefs.setComplexValue(dirp, Ci.nsIFile, file);

})("browser.download.dir", "browser.download.folderList");

Отсутствует

 

№1581705-09-2021 21:16:38

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

Dumby
Поставил в жест сложный код. Великолепно работает!

Думал найти и запихнуть какой-нибудь простой код типа
document.getElementById("about:preferences").content.gMainPane.chooseFolder()
а потом вспомнил, что XUL и xhtml - это разные вещи.

Отсутствует

 

№1581806-09-2021 11:59:46

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 29
UA: Chrome 93.0

Re: Custom Buttons

Я хочу установить плагин через отладку, в версии лисы 56.0.2 работает плагин (можно установить не через отладку), а в 57 нет, поэтому хотел установить через отладку и вот такая ошибка (см. скрин).00a4fc8b5a56.png

Отредактировано Senflex (06-09-2021 12:01:11)

Отсутствует

 

№1581907-09-2021 18:17:59

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

Re: Custom Buttons

После обновления на [firefox]-92 расширение в очередной раз исчезло из браузера. :angry: Версия custom_buttons-0.0.7.0.0.17-fx-paxmod.
Какие способы возвращения возможны? Или надо просто версию обновить?


Windows 10 LTSC

Отсутствует

 

№1582007-09-2021 18:22:12

sonyas75
Участник
 
Группа: Members
Откуда: Ставрополь
Зарегистрирован: 22-03-2011
Сообщений: 557
UA: Firefox 91.0

Re: Custom Buttons

Black_Monk
может эту поставить? Custom Buttons 0.0.7.0.0.19 https://forum.mozilla-russia.org/viewtopic.php?pid=793488#p793488

Отсутствует

 

№1582107-09-2021 18:30:41

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

Re: Custom Buttons

sonyas75, спасибо, заработало! :)


Windows 10 LTSC

Отсутствует

 

№1582208-09-2021 11:20:21

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

Re: Custom Buttons

Dumby
Снят вопрос.

Отредактировано ВВП (09-09-2021 13:57:56)

Отсутствует

 

№1582309-09-2021 21:07:06

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 29
UA: Chrome 93.0

Re: Custom Buttons

Можно ли программно из браузера узнать ping сайта?

Отсутствует

 

№1582409-09-2021 22:40:32

vitalii201
Участник
 
Группа: Members
Зарегистрирован: 24-03-2011
Сообщений: 679
UA: Firefox 92.0

Re: Custom Buttons

Senflex

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

Отсутствует

 

№1582509-09-2021 23:34:45

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 29
UA: Chrome 93.0

Re: Custom Buttons

vitalii201 пишет

Senflex

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

Я совсем новичок в CB, пожалуйста подскажите, код.

Отсутствует

 

Board footer

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