Что-то не получается это воспроизвести. Но, вообще, вещь знакомая.
Попробуй заменить первую строку на эти двескрытый текст
Так всё отлично. Спасибо.
А возможно ли ещё поправить кнопку Удалить куки текущего сайта под 68?
«The Truth Is Out There»
Отсутствует
Отсутствует
Значит в "квантумах" нету gClipboard.write() или заменено на что-то другое. Звиняй, не знаю. Пусть подскажут другие кто.
Замени на alert() , смотри в Консоль какие ошибки, подсказки тама есть.
...программисты словно войну какую-то ведут за свои обновления. Блин, почему сейчас повсюду мания ухудшать интерфейсы и делать их максимально неудобными?! Radiation
Отсутствует
mokujin консоль при нажатии на кнопку молчит((
посоны, помогите страждующему, поджимаю ногу и прищуриваю глаз для жалолсти
Отсутствует
А возможно ли ещё поправить кнопку Удалить куки текущего сайта
Возможно, наверное, но я для этого совсем неподходящ.
Может Cookies Permissions поставь, или WebExtensions какой-нибудь поищи.
А то как бы с меня чего плохого не приключилось.
(obj => { this.setAttribute("context", ""); this.onclick = e => obj[e.button < 2](e); })({ true(e) { var domain = this.domain(); if (!domain) return; this.cookies(domain); this.webappstore(domain); this.macromedia(); if (e.button) for(var br of gBrowser.browsers) try { this.domain(br) == domain && br.reload(); } catch(ex) {} }, false(e) { e.ctrlKey || e.shiftKey ? gShowPopup(self) : this.window(); }, domain(br = gBrowser.selectedBrowser, res) { try { res = new URL(br.currentURI.spec).hostname; res = res.includes(".") ? Services.eTLD.getBaseDomainFromHost(res) : undefined; } finally {return res;} }, remove(...args) { (this.remove = Services.cookies.remove.length == 4 ? Services.cookies.remove : (h, n, p, a) => Services.cookies.remove(h, n, p, false, a) )(...args); }, cookies(domain, has) { for(var {host, name, path, originAttributes, rawHost} of ( Services.cookies.enumerator || Services.cookies.cookies )) Services.eTLD.hasRootDomain(rawHost, domain) && this.remove(host, name, path, originAttributes); }, webappstore(domain) { var db = FileUtils.getFile("ProfD", ["webappsstore.sqlite"]); var conn = Services.storage.openDatabase(db); conn.executeSimpleSQL(`DELETE FROM webappsstore2 WHERE scope LIKE "%${ domain.split("").reverse().join("") + "." }%"`); conn.close(); }, macromedia() { var dir = Services.dirsvc.get("AppData", Ci.nsIFile); dir.append("Macromedia"); dir.exists() && dir.isDirectory() && dir.remove(true); dir.create(dir.DIRECTORY_TYPE, 0o755); }, get sdm() { this.url = "chrome://browser/content/preferences/siteDataSettings.x" + (parseInt(Services.appinfo.platformVersion) <= 71 ? "ul" : "html"); delete this.sdm; return this.sdm = ChromeUtils.import( "resource:///modules/SiteDataManager.jsm" ).SiteDataManager; }, async window() { var domain = this.domain(); var win = Services.wm.getMostRecentWindow("Browser:SiteDataSettings"); win && win.close(); await this.sdm.updateSites(); win = openDialog(this.url, "_blank", ""); if (!domain) return; await new Promise(resolve => win.addEventListener("DOMContentLoaded", resolve, {once: true}) ); var list = win.document.getElementById("sitesList"); list.clearSelection = () => { delete list.clearSelection; list.selectedIndex = 0; list.focus(); } win.document.getElementById("searchBox").inputField.editor .QueryInterface(Ci.nsIPlaintextEditor).insertText(domain); } });
Значит в "квантумах" нету gClipboard.write()
gClipboard не лисий, а от Custom Buttons.
А вот content в "постквантумах" да, не слишком полезен.
Лучше бы так предложил
var {label} = gBrowser.selectedTab; var re = /(.+) (\(.+\)) \[(\d{4})[^\]]+\] (.+) (.+) (.+)/; re.test(label) && gClipboard.write( label.replace(re, "$1 $2 ($4) ($3)").replace(/ \/ /g, " - ") );
Отсутствует
Dumby спасибо, милый друг! Как то по педристически, но я очень рад, сколько я мучался с фоксреплейсом и прочими автозаменялками, пока меня не осенило, такая простая кнопка, я очень рад!
Отсутствует
Возможно, наверное, но я для этого совсем неподходящ.
Может Cookies Permissions поставь, или WebExtensions какой-нибудь поищи.
А то как бы с меня чего плохого не приключилось.скрытый текстВыделить кодКод:
(obj => { this.setAttribute("context", ""); this.onclick = e => obj[e.button < 2](e); })({ true(e) { var domain = this.domain(); if (!domain) return; this.cookies(domain); this.webappstore(domain); this.macromedia(); if (e.button) for(var br of gBrowser.browsers) try { this.domain(br) == domain && br.reload(); } catch(ex) {} }, false(e) { e.ctrlKey || e.shiftKey ? gShowPopup(self) : this.window(); }, domain(br = gBrowser.selectedBrowser, res) { try { res = new URL(br.currentURI.spec).hostname; res = res.includes(".") ? Services.eTLD.getBaseDomainFromHost(res) : undefined; } finally {return res;} }, remove(...args) { (this.remove = Services.cookies.remove.length == 4 ? Services.cookies.remove : (h, n, p, a) => Services.cookies.remove(h, n, p, false, a) )(...args); }, cookies(domain, has) { for(var {host, name, path, originAttributes, rawHost} of ( Services.cookies.enumerator || Services.cookies.cookies )) Services.eTLD.hasRootDomain(rawHost, domain) && this.remove(host, name, path, originAttributes); }, webappstore(domain) { var db = FileUtils.getFile("ProfD", ["webappsstore.sqlite"]); var conn = Services.storage.openDatabase(db); conn.executeSimpleSQL(`DELETE FROM webappsstore2 WHERE scope LIKE "%${ domain.split("").reverse().join("") + "." }%"`); conn.close(); }, macromedia() { var dir = Services.dirsvc.get("AppData", Ci.nsIFile); dir.append("Macromedia"); dir.exists() && dir.isDirectory() && dir.remove(true); dir.create(dir.DIRECTORY_TYPE, 0o755); }, get sdm() { this.url = "chrome://browser/content/preferences/siteDataSettings.x" + (parseInt(Services.appinfo.platformVersion) <= 71 ? "ul" : "html"); delete this.sdm; return this.sdm = ChromeUtils.import( "resource:///modules/SiteDataManager.jsm" ).SiteDataManager; }, async window() { var domain = this.domain(); var win = Services.wm.getMostRecentWindow("Browser:SiteDataSettings"); win && win.close(); await this.sdm.updateSites(); win = openDialog(this.url, "_blank", ""); if (!domain) return; await new Promise(resolve => win.addEventListener("DOMContentLoaded", resolve, {once: true}) ); var list = win.document.getElementById("sitesList"); list.clearSelection = () => { delete list.clearSelection; list.selectedIndex = 0; list.focus(); } win.document.getElementById("searchBox").inputField.editor .QueryInterface(Ci.nsIPlaintextEditor).insertText(domain); } });
Dumby, ну почему же сразу плохого.
Протестировал на пяти-шести сайтах, пока всё нормально работает. Посмотрим, как будет дальше.
Большое спасибо.
«The Truth Is Out There»
Отсутствует
Dumby, поздравляю с || Сообщений: 1000 || -_-
Отсутствует
Dumby
В 71 отвалилась хорошая кнопка BBCode
const data = this.Help.split("\n"); const names = ["menupopup", "hbox", "popupset", "button"]; const btnAttrs = ["label", "tooltiptext", "value1", "value2", "popup", "image"]; const prefixId = "CB-BBCode-node"; const button = this; function rep(str) { return str.replace(/%dot%/g, ".").replace(/%sym%/g, "|"); } data.forEach(function(str) { if (!str) return; var nm = str.split(".").map(rep); var name = names[nm[0]]; var id = parseInt(nm[1]) && (prefixId + nm[1]); var parent = document.getElementById(prefixId + nm[2]) || button; var attrs = nm[3] ? nm[3].split("|").map(rep) : []; var node = document.createElementNS(xulns,name); if (id) node.id = id; if (name == "button") { btnAttrs.forEach(function(attr, i) { attrs[i] && node.setAttribute(attr, ((attr == "label") ? " " : "") + attrs[i]) }); // node.setAttribute("height", "8px"); var p = node.getAttribute("popup"); p && node.setAttribute("popup", prefixId + p); } else { if (name == "menupopup") node.setAttribute("style", "-moz-appearance: none; border: 1px solid gray"); attrs.forEach(function(str) { var a = str.split("="); node.setAttribute(a[0], a[1]); }); } parent.appendChild(node); }); var popup = document.getElementById(prefixId + 1); popup.setAttribute("oncommand", 'document.getElementById("' + button.id + '").handleClick(event)'); const btnIdPrefix = "cb-bbcode-button-"; const mid = " > .box-inherit.button-box > .button-icon { background-color: "; const sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService); const type = sss.USER_SHEET; var mp = document.getElementById(prefixId + 7); var style = ""; Array.slice(mp.children).forEach(function(btn) { btn.setAttribute("image", "data:image/x-icon;base64,AAABAAEAIA4AAAEAIABgBwAAFgAAACgAAAAgAAAAHAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA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AAAAAAAAAAAAAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAAH////5////+f////n////5////+f////n////5////+f////n////5////+f////gAAAAA="); btn.setAttribute("value1", "color"); var color = btn.getAttribute("value2"); btn.id = btnIdPrefix + color.substring(1); style += "#" + btn.id + mid + color + " !important; }\n" }); var cssURI; setTimeout(function() { cssURI = makeURI("data:text/css," + encodeURIComponent(style), null, null); if (!sss.sheetRegistered(cssURI, type)) sss.loadAndRegisterSheet(cssURI, type); }, 1000); var hbox = document.getElementById(prefixId + 2); this.handleClick = function(evt) { var node = evt.target; if (node.nodeName != "button" || node.parentNode == hbox) return; var v1 = node.getAttribute("value1"); var v2 = node.getAttribute("value2"); if (v2) v2 = "=" + v2.replace("%clipboard%", gClipboard.read()); var bb1 = "[" + v1 + (v2 || "") + "]"; var bb2 = "[/" + v1 + "]"; var box = content.document.activeElement; var txt = box.value; var s = box.selectionStart; var e = box.selectionEnd; var bef = txt.substring(0, s); var mid = txt.substring(s, e); var aft = txt.substring(e); var ins = bb1.replace(/%copy%|%move%/, mid) + (v2 == "=%move%" ? "" : mid) + bb2; var val = bef + ins + aft; box.value = val; box.selectionStart = s; box.selectionEnd = s + ins.length; // box.focus(); } button.onclick = function(e) { if (!e.button) document.getElementById(prefixId + 1).openPopup(button); }; button.onDestroy = function() { if (cssURI && sss.sheetRegistered(cssURI, type)) sss.unregisterSheet(cssURI, type); };
ЗЫ Так вы еще ко всему и автор этой кнопки)
Отредактировано Garalf (29-11-2019 09:49:05)
Отсутствует
И не автор, а утрамбовщик.
Самое то, что и надо)
Добавлено 30-11-2019 12:58:45
Dumby
И еще... очень нужная кнопка перестала работать в 72 - перевести в Google
/*Initialization Code*/ var lc = navigator.lastClick = {}; addEventListener("mouseup", e => { if (e.button) return; lc.X = e.screenX - mozInnerScreenX; lc.Y = e.screenY - mozInnerScreenY; }, false, gBrowser.tabpanels || 1); var createWindow = function(text, status, title, id, pos, size){ var win = window, doc = win.document, wId = 'ujs_window'+(id || ''), w = doc.getElementById(wId); var keyDown = function(e){if(!e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode == 27)doc.getElementById(wId).closeWin()}; if(w)w.closeWin(); w = doc.createElementNS(xhtmlns, 'div'); w.setAttribute('style', 'position:fixed;display:block;visibility:hidden;left:0;top:0;width:auto;height:auto;border:1px solid gray;padding:3px;margin:0;z-index:99999;overflow:hidden;cursor:move;'+(typeof w.style.borderRadius === 'string' ? 'background-color:#f3f5f7;padding-top:4px;border-radius:4px;box-shadow:0 0 12px rgba(0,0,0,.4);' : 'background:-o-skin("Window Skin");')); w.id = wId; w.closeWin = function(){ doc.removeEventListener('keydown', keyDown, false); this.parentNode.removeChild(this); }; w.addEle = function(str, style){ var ele = doc.createElementNS(xhtmlns, 'div'); ele.setAttribute('style', style); if(str){ ele.innerHTML = str; for(var el, all = ele.getElementsByTagName('*'), i = all.length; i--;){ el = all[i]; if(/^(script|frame|iframe|applet|embed|object)$/i.test(el.nodeName)){ el.parentNode.removeChild(el); } else{ for(var att = el.attributes, j = att.length; j--;){ if(/^on[a-z]+$/i.test(att[j].name))att[j].value = ''; } } } }; return this.appendChild(ele); }; var img = doc.createElement('div'); img.setAttribute('style', 'display:block;float:right;width:18px;height:18px;padding:0;margin:0;border:none;cursor:pointer;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAAZElEQVR42mNgGNyAGQixsVGU/AdCXjCbHczmxKaMFywlAlWiw6DAwIZNmQhYGqJEDWoqFiAGVmKKTwk73CRJ/Ep0GIyhbsPpO4hbIG4TwKaMk0EZ7hYBBk1cvmNDEmbDrmSwAADE8h10+qICXwAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=");background:-o-skin("Caption Close Button Skin");'); img.title = (win.navigator.language.indexOf('ru') == 0) ? '\u0417\u0430\u043A\u0440\u044B\u0442\u044C' : 'Close'; img.addEventListener('click', function(){this.parentNode.closeWin()}, false); w.appendChild(img); var title = w.addEle(title, 'display:table;color:#000;font:16px Times New Roman;width:auto;height:auto;padding:0;margin:0 2px;cursor:text;'); title.onclick = e => { e.preventDefault(); var url = e.target.href; // Здесь открываем url как хотим. var ctabpos = gBrowser.selectedTab._tPos +1; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); } var cnt = w.addEle(text, 'display:block;border:1px solid #aaa;margin:2px 0 1px 0;padding:4px;background-color:#fafcfe;color:#000;font:14px Times New Roman;width:240px;height:120px;overflow:auto;cursor:text;'); w.addEle(status, 'display:table;color:#555;font:10px Times New Roman;width:auto;height:auto;padding:0;margin:0 2px;cursor:text;'); w.addEventListener('mousedown', function(e){ if(e.target == w){ e.preventDefault(); var grabX = e.clientX, grabY = e.clientY, origX = parseInt(w.style.left), origY = parseInt(w.style.top); var mouseMove = function(ev){ w.style.left = origX+ev.clientX-grabX+'px'; w.style.top = origY+ev.clientY-grabY+'px'; }; doc.addEventListener('mousemove', mouseMove, false); doc.addEventListener('mouseup', function(){doc.removeEventListener('mousemove', mouseMove, false)}, false); } }, false); doc.documentElement.appendChild(w); if(size){ cnt.style.height = size.height; cnt.style.width = size.width; } else{ for(var i = 3; i < 10; i++){ if(cnt.scrollHeight > cnt.offsetHeight || cnt.scrollWidth > cnt.offsetWidth){ cnt.style.height = 50*i+'px'; cnt.style.width = 100*i+'px'; } else break; } }; var docEle = (doc.compatMode == 'CSS1Compat' && win.postMessage) ? doc.documentElement : doc.body; var mX = docEle.clientWidth-w.offsetWidth, mY = docEle.clientHeight-w.offsetHeight; if(mX < 0){cnt.style.width = parseInt(cnt.style.width)+mX+'px'; mX = 0}; if(mY < 0){cnt.style.height = parseInt(cnt.style.height)+mY+'px'; mY =0}; var hW = parseInt(w.offsetWidth/2); w.style.left = (pos && pos.X < mX+hW ? (pos.X > hW ? pos.X-hW : 0) : mX)+'px'; w.style.top = (pos && pos.Y+10 < mY ? pos.Y+10 : mY)+'px'; w.style.visibility = 'visible'; doc.addEventListener('keydown', keyDown, false); return w; }; var getHash = function (txt) { TKK=eval('((function(){var a\x3d817046147;var b\x3d-335196159;return 410049+\x27.\x27+(a+b)})())'); function sM(a) { var b; if (null !== yr) b = yr; else { b = wr(String.fromCharCode(84)); var c = wr(String.fromCharCode(75)); b = [b(), b()]; b[1] = c(); b = (yr = window[b.join(c())] || "") || "" } var d = wr(String.fromCharCode(116)) , c = wr(String.fromCharCode(107)) , d = [d(), d()]; d[1] = c(); c = "&" + d.join("") + "="; d = b.split("."); b = Number(d[0]) || 0; for (var e = [], f = 0, g = 0; g < a.length; g++) { var l = a.charCodeAt(g); 128 > l ? e[f++] = l : (2048 > l ? e[f++] = l >> 6 | 192 : (55296 == (l & 64512) && g + 1 < a.length && 56320 == (a.charCodeAt(g + 1) & 64512) ? (l = 65536 + ((l & 1023) << 10) + (a.charCodeAt(++g) & 1023), e[f++] = l >> 18 | 240, e[f++] = l >> 12 & 63 | 128) : e[f++] = l >> 12 | 224, e[f++] = l >> 6 & 63 | 128), e[f++] = l & 63 | 128) } a = b; for (f = 0; f < e.length; f++) a += e[f], a = xr(a, "+-a^+6"); a = xr(a, "+-3^+b+-f"); a ^= Number(d[1]) || 0; 0 > a && (a = (a & 2147483647) + 2147483648); a %= 1E6; return c + (a.toString() + "." + (a ^ b)) } var yr = null; var wr = function(a) { return function() { return a } } , xr = function(a, b) { for (var c = 0; c < b.length - 2; c += 3) { var d = b.charAt(c + 2) , d = "a" <= d ? d.charCodeAt(0) - 87 : Number(d) , d = "+" == b.charAt(c + 1) ? a >>> d : a << d; a = "+" == b.charAt(c) ? a + d & 4294967295 : a ^ d } return a }; return sM(txt); }; var ujs_google_translate = function (dir){ var lng = window.navigator.language.slice(0, 2), txt = gContextMenuContentData.selectionInfo.fullText, l = dir.split('|'); var encTxt = encodeURIComponent(txt); var winWait = function(lng){createWindow('', (lng == 'ru' ? '\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C' : 'Translating')+'\u2026', 'Google Translate', '_gt', window.navigator.lastClick)}; if (txt) { winWait(lng); var xhr = new XMLHttpRequest(); var url = 'https://translate.google.com/translate_a/single?client=t&sl=' + l[0] + '&tl=' + l[1] + '&hl=' + lng + '&eotf=0&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t' + getHash(txt); var urle = "http://translate.google.com/translate_t?text="+encTxt+"&sl=' + l[0] + '&tl=' + l[1] + '&hl=' + lng + '&eotf=0&ujs=gtt"; xhr.open('POST', url, true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8'); xhr.onreadystatechange = function() { try{ if (xhr.readyState == 4 && xhr.status == 200) { var result = '', status = '', tmp = JSON.parse(xhr.responseText.replace(/\[(?=,)/g, '[0').replace(/,(?=,|\])/g, ',0')); for(var i = 0, n; n = tmp[0][i]; i++){ if(n[0])result += n[0].toString(); }; result = '<span style="background-color:inherit;color:inherit;font-size:inherit;font-family:Times,serif;">' + result + '</span>'; status = tmp[8][0][0].toUpperCase() + ' -\u203A ' + l[1].toUpperCase(); createWindow(result, status, '<a href="'+urle.replace(/&/g,'&')+'" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman;">Google Translate</a>', '_gt', window.navigator.lastClick); } } catch (x){LOG(x)}; }; xhr.send('q=' + encodeURIComponent(txt)); } else { var urlt = gBrowser.currentURI.spec; var url = "http://translate.google.com/translate?u="+encodeURIComponent(urlt)+"&hl="+lng+"&langpair="+dir+"&tbb=1"; var ctabpos = gBrowser.selectedTab._tPos +1; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; }; var contextMenu = document.getElementById("contentAreaContextMenu"); var nextEleMenu = document.getElementById("context-inspect"); var menuId = "context-ext-google-translate"; var menuItem = document.getElementById(menuId); if (menuItem) { contextMenu.removeChild(menuItem.nextElementSibling); contextMenu.removeChild(menuItem.nextElementSibling); contextMenu.removeChild(menuItem); }; menuItem = document.createXULElement("menuitem"); menuItem.setAttribute("id", menuId); menuItem.setAttribute("label", "Перевести на русский"); menuItem.setAttribute("class", "menuitem-iconic"); menuItem.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAABBUlEQVR4Ac2RMU4DMRREB2MqihQpAkUaqnAduuQw4Sx03CGcJYIiDYqQ0lCsZ77535ZFcgAkRuPvV7zd/dLiz3N1PFb8hmRckrfELZrF9ONQ1B6Yz0MyM7S0O6zGkVprh/3+Kw/JzkHSpRpJKZkpr9fYbOx0cjVsCbWG31oHBM9mtt0q73ZcrdLhAMlYQKkUI22aqsNo8HKZAMQhvVaKSHWj2Q2aPU3mJQFY7nuHyvYFduP83WF3AJRfcPNYnr/Lp1G1uK4m9sno1LaUbnX/htf8BNzoneUD5NhjvLCMhURQSQ93QCZwXYjFwg3I0NZKrvoknQPMIHkt/jRAQKMeG2yX89/mB4EJbKbZxIhFAAAAAElFTkSuQmCC"); menuItem.addEventListener("command", function(){ujs_google_translate('auto|ru')}, false); contextMenu.insertBefore(menuItem, nextEleMenu); menuItem = document.createXULElement("menuitem"); menuItem.setAttribute("label", "Перевести на английский"); menuItem.setAttribute("class", "menuitem-iconic"); menuItem.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAAB5UlEQVR4AWOgPZg0c9+Oq2+qpx9LaQaiw4mNB27efbs2uXFNQh2Q4Zm9zSNth23MhqjGnXMC86vnHmUS4udxv7OvOd2yPE7PTlfCTk9GVVEoyJA7WI8dyPA0k3U1l+jJMV7CeThpTZeoKDdDUsvBPSff/V+6/P/Bvf///2+bdvU/EKRm/k9IBNIlfZe+LFrzvbsbyJ636pKkyQyQhoUb7tZNvPpw3/0/TfX/ISAm5n94BIiRm/n/xYsLd946ei4vajoiqDuRAejQf//+o4PQ0P9+fmhiQGVnrr1kXJNYG2zEzXDxDsPv3wy/fkFJoOTPn39+/fr/69e/37//AUX+/mXRkO458wWHDba2f8wswCyQ3N+/f//8/fP7z5+TV18w2Mdt6plzPiptx5Wr7/+/ffMzOR6kysjkt74hWMPfp06O+2dulZCeFZKwnkE4m8E8bN3i9aCQ+dxY96GrK6bkGJD9R1v3l6Y20NVW9kt+/v//ZdbcFwkxTVPPMQimM8XEqkb7a/zoqLxkH9v4zVyI5+///wyMmtKMmhJAnbLqQjHxaw5r2orOmZN5uj470Zahat6BKS7JzpmLBHXm8GhM5lCdcP7ai1ZpixZxk9NXXjKIFzOIFjAI54oY1vXuue5qmscw+AAAW0tKxtPoicEAAAAASUVORK5CYII="); menuItem.addEventListener("command", function(){ujs_google_translate('auto|en')}, false); contextMenu.insertBefore(menuItem, nextEleMenu); contextMenu.insertBefore(document.createXULElement("menuseparator"), nextEleMenu);
Отредактировано Garalf (30-11-2019 13:36:09)
Отсутствует
«Merge Date»
// CB-0.0.7.0.0.{7-8}-fx.js (async re => { var gzip = "H4sIAAAAAAAACs1b63IcN3b+PVOld+idTXZn1uRw+oJLU0u5KFlesSLLLpOKN6VimOYMhmyrp3vS3SOKK/M18gKuzQPkd37pUfIkAb6Dvs2FomxXKlUkugfAwTkAPny4HPT0Os8W6mC6KspscbkqyywtDqZZWqq0PMjeqTyJbsc/Fh///vE/+339f8/fp6J6d3v9rb+6CffkDLyNVIraUc7a369N/6y/Xu+u9fhMfVVK78NvZs9OCz/dPw+w2ZSFpN48TmdPCUeHznyVTss4S51hPBs5H3S2XJWrXP8ur+Ni7LQyO0fOMsoLdZKWzvBU5e/iqdI5ouUyTufZ2FkmUTnP8sU/q7zQJY6cJ0cOn+gS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bmjFCM8Da6VwzhAYjbCyQU09M5jmuZ6OPP+udRDzXIuMfiyz9+Hc64egNrO98cNh1su7tPGDsxtUz2fa/6qTy7n8Bb0tp/3RJAAA="; var sel = "Select"; try {sel = Services.strings.createBundle("chrome://global/locale/commonDialogs.properties") .GetStringFromName(sel);} catch(ex) {} var picker = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); picker.init(window, sel + " CB 0.0.7.0.0.7", picker.modeOpen); picker.appendFilter(null, "custom_buttons-0.0.7.0.0.7-fx-*.xpi"); await new Promise(resolve => picker.open(resolve)); var {file} = picker; if (!file) return; var ln = file.leafName; if (!re.test(ln)) return alert("???\n" + ln); var {fileURL} = picker; var xpi = file.parent.clone(); xpi.append(ln = ln.replace("7-", "8-")); file.copyTo(file.parent, ln); var obs = {}, data; var td = new TextDecoder(), te = new TextEncoder(); var scs = Cc["@mozilla.org/streamConverters;1"].getService(Ci.nsIStreamConverterService); var sis = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream); var sl = Cc["@mozilla.org/network/stream-loader;1"].createInstance(Ci.nsIStreamLoader); sis.data = atob(gzip); obs.onStreamComplete = (a, b, c, d, result) => data = td.decode(new Uint8Array(result)); sl.init(obs); var converter = scs.asyncConvertData("gzip", "uncompressed", sl, null); converter.onStartRequest(null, null); var args = [null, null, sis, 0, sis.data.length]; if (converter.onDataAvailable.length == 4) args.shift(); converter.onDataAvailable(...args); converter.onStopRequest(null, null, null); var zw = Cc["@mozilla.org/zipwriter;1"].createInstance(Ci.nsIZipWriter); var mt = Date.now() * 1000, cp = zw.COMPRESSION_DEFAULT; var bootstrap = ln.includes("bootstrap"); var prefix = "jar:" + fileURL.spec + "!/"; var lr = /^¦(?:\d+)?$/, sep1 = "£", sep2 = "¥"; zw.open(xpi, 0x04); // PR_RDWR for(var item of data.split(sep1)) { var [entry, val] = item.split(sep2); if (bootstrap && (entry == "manifest.json" || entry == "startup.jsm")) continue; if (val == "+") { zw.addEntryDirectory(entry, mt, false); continue; } if (zw.hasEntry(entry)) { if (val.includes("¦")) { var lines = val.split("\n"); var oldLines = (await (await fetch(prefix + entry)).text()).split("\n"); lines.forEach((line, ind) => { if (lr.test(line)) lines[ind] = oldLines[ line.length == 1 ? ind : +line.slice(1) ]; }); val = lines.join("\n"); } zw.removeEntry(entry, false); if (val == "-") continue; } var stream = Cc["@mozilla.org/io/string-input-stream;1"] .createInstance(Ci.nsISupportsCString); stream.data = String.fromCharCode(...new Uint8Array(te.encode(val))); zw.addEntryStream(entry, mt, cp, stream, false); stream.close(); }; zw.close(); xpi.reveal(); })( /^custom_buttons-0\.0\.7\.0\.0\.7-fx-(?:paxmod|bootstrap)\.xpi$/ );
Отсутствует
solombala
Вот эту кнопку я проверял в твоей сборке 70.0.1 в однопроцессорном режиме работает
https://www.upload.ee/files/10799834/BBCode_70.rar.html
Отредактировано Garalf (03-12-2019 12:18:43)
Отсутствует
BBCode у вас работает? что-то у меня не пашет, CB-0.0.7.0.0.{7-8}-fx и сделал правку... кнопка серая будто ошибка в коде, код в инициализаций.
Отредактировано func4ptch4 (02-12-2019 23:33:33)
Отсутствует
Отсутствует
В 71 перестал работать CB 0.0.7.0.0.6. Кто нибудь может объяснить как применить этот способ ?
Добавлено: разобрался, Dumby, спасибо за способ
Отредактировано kokoss (03-12-2019 19:02:56)
Win7
Отсутствует