Dumby все бьюсь над многопроцессорным переводом. Окно запускается, переводит, но есть еще ошибки. Помоги пожайлуста разобраться.
/*Initialization Code*/ document.addEventListener('mouseup', function(e){ if(e && e.button == 0){ var lc = window.navigator.lastClick || (window.navigator.lastClick = {}); lc.X = e.clientX; lc.Y = e.clientY; lc.element = e.target; } }, false); window.navigator.ujs_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.createElement('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.createElement('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); w.addEle(title, 'display:table;color:#000;font:16px Times New Roman;width:auto;height:auto;padding:0;margin:0 2px;cursor:text;'); 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; }; function ujs_google_translate(){ // var winWait = function(lng){navigator.ujs_createWindow('', (lng == 'ru' ? '\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C' : 'Translating')+'\u2026', 'Яндекс', '_gt', window.navigator.lastClick)}; var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt); var lng = window.navigator.language.slice(0, 2); if(location.hostname != 'translate.yandex.net'){ //winWait(lng); var encTxt = encodeURIComponent(txt); var keyuser = "trnsl.1.1.20170531T164120Z.57e9764369279ca0.2a07c3f1cc980dab3c31eb4d00e5a85d78cfd50d"; var langFrom_yandex_text = ""; //авто var langTo_yandex_text = "ru"; if (txt) { var xhr = new XMLHttpRequest(); var encTxt = encodeURIComponent(txt); var url ="https://translate.yandex.net/api/v1.5/tr.json/translate?key="+keyuser+"&lang="+langFrom_yandex_text+langTo_yandex_text+"&text=" + encTxt; xhr.open('GET', url, true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8'); xhr.onreadystatechange = function() { if (xhr.readyState==4) { var tryain=xhr.responseText; tryain=tryain.replace(/\\n/g, "<br />"); var data = JSON.parse( tryain ); var result,status; if (data.code == "401") {result = "Неправильный ключ API"; status = "";} if (data.code == "402") {result = "Ключ API заблокирован"; status = "";} if (data.code == "403") {result = "Превышено суточное ограничение на количество запросов"; status = "";} if (data.code == "404") {result = "Превышено суточное ограничение на объем переведенного текста"; status = "";} if (data.code == "413") {result = "Превышен максимально допустимый размер текста"; status = "";} if (data.code == "422") {result = "Текст не может быть переведен"; status = "";} if (data.code == "501") {result = "Заданное направление перевода не поддерживается"; status = "";} if (data.code == "200") {result = data.text; var status1 = data.lang; status =(status1.replace(/\-/g, "-\u203A")).toUpperCase();} var urlt = 'http://translate.yandex.ru/?text=' + encTxt + '&lang=' + status1; navigator.ujs_createWindow(result, status, '<a href="'+urlt.replace(/&/g,'&')+'" target="_blank" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman;">Яндекс</a>', '_gt', navigator.lastClick); } }; xhr.send('q=' + encodeURIComponent(txt)); } } }; (function () { if ( document.getElementById("TranslateBu") ) return; var contextMenu = document.getElementById("contentAreaContextMenu"); var Item = document.createXULElement("menuitem"); Item.setAttribute("Id", "TranslateBu"); Item.setAttribute("label", "Перевод"); Item.addEventListener("command", function(){ujs_google_translate()}, false); contextMenu.insertBefore(Item, document.getElementById("context-viewpartialsource-selection") ); addDestructor(function() { contextMenu.removeChild( Item ) }); })();
Вторая кнопка
//----------Заменить текст переводом Яндекс------------ function ujs_TexReplace_translate() { var txt = gContextMenuContentData.selectionInfo.fullText; var keyuser = "trnsl.1.1.20170531T164120Z.57e9764369279ca0.2a07c3f1cc980dab3c31eb4d00e5a85d78cfd50d"; var encTxt = encodeURIComponent(txt); if (txt) { var xhr = new XMLHttpRequest(); var encTxt = encodeURIComponent(txt); var langFrom_yandex_text = ""; //авто var langTo_yandex_text = "ru"; var url ="https://translate.yandex.net/api/v1.5/tr.json/translate?key="+keyuser+"&lang="+langFrom_yandex_text+langTo_yandex_text+"&text=" + encTxt; if (txt) { var xhr = new XMLHttpRequest(); var encTxt = encodeURIComponent(txt); var url ="https://translate.yandex.net/api/v1.5/tr.json/translate?key="+keyuser+"&lang="+langFrom_yandex_text+langTo_yandex_text+"&text=" + encTxt; xhr.open('GET', url, true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8'); xhr.onreadystatechange = function(){ if (xhr.readyState==4) { var tryain=xhr.responseText; tryain=tryain.replace(/\\n/g, "<br />"); var data = JSON.parse( tryain ); var result = data.text; var range = document.getSelection().getRangeAt(0); range.deleteContents(); range.insertNode(range. createContextualFragment(result)); } }; xhr.send('q=' + encodeURIComponent(txt)); } } }; (function () { if ( document.getElementById("TranslateB") ) return; var contextMenu = document.getElementById("contentAreaContextMenu"); var Item = document.createXULElement("menuitem"); Item.setAttribute("Id", "TranslateB"); Item.setAttribute("label", "Перевод заменить"); Item.addEventListener("command", function(){ujs_TexReplace_translate()}, false); contextMenu.insertBefore(Item, document.getElementById("context-viewpartialsource-selection") ); addDestructor(function() { contextMenu.removeChild( Item ) }); })();
Отредактировано Andrey_Krropotkin (16-07-2019 14:50:11)
Отсутствует
Всем привет.
Помогите с этой кнопкой для запуска приложений и утилит:
startProcess("d:\\total\\TCIMGZ\\TCIMG.exe",["tcimg=$am_command_1"]); function startProcess(path, args) { var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(path); if(file.exists()) { var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } else custombuttons. alertBox ("Файл не найден", path); };
В 45 и 52 версиях работает, но после вынужденной миграции на Firefox ESR portable 60.8 уже нет.
Заранее благодарен, Спасибо.
Отредактировано shveicar (16-07-2019 18:41:09)
Отсутствует
shveicar Попробуй заменить nsILocalFile на nsIFile
Отсутствует
shveicar Попробуй заменить nsILocalFile на nsIFile
Большое Спасибо.
Теперь заработало.
Одно не пойму, зачем они все время меняют код в новых версиях.
Видимо, по заказу гугла и компании, что бы пользователи контент не сохраняли..
Вот например, еще одна нужная кнопка (так как ScrapBook Plus в новой версии уже не пашет) - сохранение html страницы в одном файле:
var saveToFile = function (fileContent, fileName) { var uc = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'].createInstance(Components.interfaces.nsIScriptableUnicodeConverter); uc.charset = 'utf-8'; fileContent = uc.ConvertFromUnicode(fileContent); var nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker); fp.init(window, '', fp.modeSave); fp.defaultString = fileName; fp.appendFilters(fp.filterHTML); fp.appendFilters(fp.filterAll); if(fp.show() == fp.returnCancel) return; var stream = Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutputStream); stream.init(fp.file, 0x02|0x20|0x08, 0666, 0); stream.write(fileContent, fileContent.length); stream.close(); }; var resolveURL = function (url, base) { try { var ioService = Components.classes['@mozilla.org/network/io-service;1'].getService(Components.interfaces.nsIIOService); var baseURI = ioService.newURI(base, null, null); var absURI = ioService.newURI(url, null, baseURI); return absURI.spec; } catch (e) {} }; var getSelWin = function (w) { if (w.getSelection().toString()) return w; for (var i = 0, f, r; f = w.frames[i]; i++) { try { if (r = getSelWin(f)) return r; } catch(e) {} } }; var encodeImg = function (src, obj) { var canvas, img, ret = src; if (/^https?:\/\//.test(src)) { canvas = doc.createElement('canvas'); if (!obj || obj.nodeName.toLowerCase() != 'img') { img = doc.createElement('img'); img.src = src; } else { img = obj; }; if (img.complete) try{ canvas.width = img.width; canvas.height = img.height; canvas.getContext('2d').drawImage(img, 0, 0); ret = canvas.toDataURL((/\.jpe?g/i.test(src) ? 'image/jpeg' : 'image/png')); } catch (e) {}; if (img != obj) img.src = 'about:blank'; }; return ret; }; var toSrc = function (obj) { var strToSrc = function (str) { var chr, ret = '', i = 0, meta = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\x22' : '\\\x22', '\\': '\\\\'}; while (chr = str.charAt(i++)) { ret += meta[chr] || chr; }; return '\x22' + ret + '\x22'; }, arrToSrc = function (arr) { var ret = []; for (var i = 0; i < arr.length; i++) { ret[i] = toSrc(arr[i]) || 'null'; }; return '[' + ret.join(',') + ']'; }, objToSrc = function (obj) { var val, ret = []; for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop) && (val = toSrc(obj[prop]))) ret.push(strToSrc(prop) + ': ' + val); }; return '{' + ret.join(',') + '}'; }; switch (Object.prototype.toString.call(obj).slice(8, -1)) { case 'Array': return arrToSrc(obj); case 'Boolean': case 'Function': case 'RegExp': return obj.toString(); case 'Date': return 'new Date(' + obj.getTime() + ')'; case 'Math': return 'Math'; case 'Number': return isFinite(obj) ? String(obj) : 'null'; case 'Object': return objToSrc(obj); case 'String': return strToSrc(obj); default: return obj ? (obj.nodeType == 1 && obj.id ? 'document.getElementById(' + strToSrc(obj.id) + ')' : '{}') : 'null'; } }; var mainWin = document.commandDispatcher.focusedWindow.top == content ? document.commandDispatcher.focusedWindow : content; var selWin = getSelWin(mainWin), win = selWin || mainWin, doc = win.document, loc = win.location; var ele, pEle, clone, reUrl = /(url\(\x22)(.+?)(\x22\))/g; if (selWin) { var rng = win.getSelection().getRangeAt(0); pEle = rng.commonAncestorContainer; ele = rng.cloneContents(); } else { pEle = doc.documentElement; ele = (doc.body || doc.getElementsByTagName('body')[0]).cloneNode(true); }; while (pEle) { if (pEle.nodeType == 1) { clone = pEle.cloneNode(false); clone.appendChild(ele); ele = clone; }; pEle = pEle.parentNode }; var sel = doc.createElement('div'); sel.appendChild(ele); for (var el, all = sel.getElementsByTagName('*'), i = all.length; i--;) { el = all[i]; if (el.style && el.style.backgroundImage) el.style.backgroundImage = el.style.backgroundImage.replace(reUrl, function (a, prev, url, next) { if (!/^[a-z]+:/.test(url)) url = resolveURL(url, loc.href); return prev + encodeImg(url) + next; }); switch (el.nodeName.toLowerCase()) { case 'link': case 'style': case 'script': el.parentNode.removeChild(el); break; case 'a': case 'area': if (el.hasAttribute('href') && el.getAttribute('href').charAt(0) != '#') el.href = el.href; break; case 'img': case 'input': if (el.hasAttribute('src')) el.src = encodeImg(el.src, el); break; case 'audio': case 'video': case 'embed': case 'frame': case 'iframe': if (el.hasAttribute('src')) el.src = el.src; break; case 'object': if (el.hasAttribute('data')) el.data = el.data; break; case 'form': if (el.hasAttribute('action')) el.action = el.action; break; } }; var head = ele.insertBefore(doc.createElement('head'), ele.firstChild); var meta = doc.createElement('meta'); meta.httpEquiv = 'content-type'; meta.content = 'text/html; charset=utf-8'; head.appendChild(meta); var title = doc.getElementsByTagName('title')[0]; if (title) head.appendChild(title.cloneNode(true)); head.copyScript = function (unsafeWin) { if ('$' in unsafeWin) return; var f = doc.createElement('iframe'); f.src = 'about:blank'; f.setAttribute('style', 'position:fixed;left:0;top:0;visibility:hidden;width:0;height:0;'); doc.documentElement.appendChild(f); var str, script = doc.createElement('script'); script.type = 'text/javascript'; for (var name in unsafeWin) { if (name in f.contentWindow || !/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)) continue; try { str = toSrc(unsafeWin[name]); if (!/\{\s*\[native code\]\s*\}/.test(str)) { script.appendChild(doc.createTextNode('var ' + name + ' = ' + str.replace(/<\/(script>)/ig, '<\\/$1') + ';\n')); } } catch (e) {}; }; f.parentNode.removeChild(f); if (script.childNodes.length) this.nextSibling.appendChild(script); }; head.copyScript(win.wrappedJSObject || win); head.copyStyle = function (s) { if (!s) return; var style = doc.createElement('style'); style.type = 'text/css'; if (s.media && s.media.mediaText) style.media = s.media.mediaText; try { for (var i = 0, rule; rule = s.cssRules[i]; i++) { if (rule.type != 3) { if((!rule.selectorText || rule.selectorText.indexOf(':') != -1) || (!sel.querySelector || sel.querySelector(rule.selectorText))) { var css = !rule.cssText ? '' : rule.cssText.replace(reUrl, function (a, prev, url, next) { if (!/^[a-z]+:/.test(url)) url = resolveURL(url, s.href || loc.href); if(rule.type == 1 && rule.style && rule.style.backgroundImage) url = encodeImg(url); return prev + url + next; }); style.appendChild(doc.createTextNode(css + '\n')); } } else { this.copyStyle(rule.styleSheet); } } } catch(e) { if (s.ownerNode) style = s.ownerNode.cloneNode(false); }; this.appendChild(style); }; var sheets = doc.styleSheets; for (var j = 0; j < sheets.length; j++) head.copyStyle(sheets[j]); head.appendChild(doc.createTextNode('\n')); var doctype = '', dt = doc.doctype; if (dt && dt.name) { doctype += '<!DOCTYPE ' + dt.name; if (dt.publicId) doctype += ' PUBLIC \x22' + dt.publicId + '\x22'; if (dt.systemId) doctype += ' \x22' + dt.systemId + '\x22'; doctype += '>\n'; }; var fileName = selWin ? win.getSelection().toString() : (title && title.text ? title.text : loc.pathname.split('/').pop()); fileName = fileName.replace(/[:\\\/<>?*|"\s,-]+/g, '_').replace(/[-_]+/g, '_').slice(0, 60); fileName += (function () { var d = new Date(), z = function(n){return '_' + (n < 10 ? '0' : '') + n}; return z(d.getHours()) + z(d.getMinutes()); })(); if(!/\.html?$/.test(fileName))fileName += '.html'; saveToFile(doctype + sel.innerHTML + '\n<!-- This document saved from ' + (loc.protocol != 'data:' ? loc.href : 'data:uri') + ' -->', fileName);
Отредактировано shveicar (16-07-2019 19:26:54)
Отсутствует
shveicar поищите поиском, тут в этом разделе где-то была исправленная версия
Отсутствует
поищите поиском, тут в этом разделе где-то была исправленная версия
Нашел только аналог этой кнопки, в виде расширения https://addons.mozilla.org/ru/firefox/addon/save-page-we/ но главное, он работает.
Спасибо за помощь.
Отсутствует
бьюсь над многопроцессорным переводом. Окно запускается, переводит, но есть еще ошибки. Помоги пожайлуста разобраться.
Не вижу ничего многопроцессного, у тебя всё происходит
в одном родительском процессе. Ладно, пусть будет так.
2. В создаваемом окне не работает w.addEle = function(str, style) в частности ele.innerHTML = str;
Установку innerHTML общипали уже давно, а затем и unsafeSetInnerHTML() убрали.
Поэтому, поскольку в FF68 от документа браузера ещё родятся XUL элементы,
меняем createElement('div') на createElementNS(xhtmlns, 'div')
Заодно у них и offset{Width, Height} появится.
1. окно не возле выделяемого текста, т.е. не работает window.navigator.lastClick
"Окно" позиционируется относительно последнего левого mouseup,
а не возле выделяемого текста.
Раз уж, зачем-то, понадобилось использовать объект navigator, то,
для начала, хотя бы пишем вместо этого что-нибудь чуть более подходящее.
Рестарт не помешает.
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 range = document.getSelection().getRangeAt(0);
Что-то выделено в документе браузера? Нет?
Тогда откуда getRangeAt(0) возьмётся?
Выделено, но не в документе браузера, а в content'ском документе?
Тогда к этому документу и следует обращаться.
Только его здесь нет, он в другом процессе.
Вот, повыделяй, понажимай...
var msgName = _id + ":ReplaceSelectionRangeAt0"; var url = "data:," + encodeURIComponent( `addMessageListener("${msgName}", function listener(msg) { removeMessageListener("${msgName}", listener); var win = {}; Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager) .getFocusedElementForWindow(content, true, win); var sel = win.value.document.getSelection(); if (sel.isCollapsed) return; var range = sel.getRangeAt(0); range.deleteContents(); range.insertNode(range.createContextualFragment(msg.data)); });` ); function replace(tagString) { var mm = gBrowser.selectedBrowser.messageManager; mm.loadFrameScript(url, false); mm.sendAsyncMessage(msgName, tagString); } replace('<span style="font-weight: bold; color: red">[REPLACED]</span>');
Отсутствует
Dumby под многопроцессорным переводом я имел ввиду когда в браузере включен многопроцессорный режим. Теперь окно создается правильно, перевод выполняется, но окно как было в левом верхнем углу так и осталось. Может есть другой способ, можно и без navigator.
При нажатии на заголовок (<a href="'+urlt.replace(/&/g,'&')+'" target="_blank" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman;">Яндекс</a> ) перевод выполняется не в новой вкладке, а запускается почему-то новое окно, даже если target="_self" происходит то же самое. Кажется здесь решение простое, но что я запнулся на этом.
Для многопроцессорного режима браузера вот предварительный вариант перевода для Google Translate
/*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.createElement('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); w.addEle(title, 'display:table;color:#000;font:16px Times New Roman;width:auto;height:auto;padding:0;margin:0 2px;cursor:text;'); 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 urlt = "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="'+urlt.replace(/&/g,'&')+'" target="_blank" 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); addEventListener('keydown', function (e){ if(e.shiftKey && !e.ctrlKey && e.altKey && e.keyCode == 84)ujs_google_translate('auto|ru'); }, false);
Отредактировано Andrey_Krropotkin (17-07-2019 12:31:14)
Отсутствует
Проверь пожалуйста, 69b5 работает с bootstrapped extensions? У меня на чистом профиле не работает.
Проверил. Установил начисто бету 69.0b5 (32-битный),
создал config.js, config-prefs.js и новый чистый профиль.
Поставил CB 0.0.7.0.0.5 и DOMi 7.0.3 — всё работает вполне терпимо.
Ещё установил Stylish 2.0.8.68.2019.06.27-xiao.
Кнопка расширения, конечно, никакая, и панель навигации подрасколбасила,
но ничего, набрал вручную about:stylish-edit, написал * {color: red !important;}
и надписи и svg'шки стали красными.
Так что конфигурация работает, а как поведёт себя конкретное расширение...
зависит от расширения.
окно как было в левом верхнем углу так и осталось
Это потому, что не изменил создание корневого элемента, там где
w = doc.createElement('div');
Кажется здесь решение простое, но что я запнулся на этом.
Свой собственный обработчик, например.
//w.addEle(title, 'display:table;color:#000;font:16px Times New Roman;width:auto;height:auto;padding:0;margin:0 2px;cursor:text;'); 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 как хотим. alert(url); }
Отсутствует
Dumby спасибо, благодаря Вам теперь и в многопроцессорном режиме работает
Исправленная для многопроцессорного режима кнопка перевода от Lex1 google-translate
Тестирована на Firefox 68:
только для контекстного меню
перевод текста при выделении на русский или английский
перевод страниц в новой вкладке на русский или английский
при переводе текста, нажатие на заголовок Google Translate переводит текст в Google в новой вкладке на русский или английский
закрытие на крестик или Esc
/*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);
Отсутствует
Еще одна маленькая кнопка для многопроцессорного режима на основе окна как в переводе выше - просмотр Буфера обмена и его очистка
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%u0411%u0443%u0444%u0435%u0440%20%u043E%u0431%u043C%u0435%u043D%u0430%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAD///8A////AAAHSZkABkfMAAZHzAAGR8wABkfMAAZHzAAGR8wABkfMAAZHzAAGR8wABkfMAAdJmf///wD///8A////AP///wAAEFXM+fnp//Pz4v/z8+L/8/Pi//Pz4v/z8+L/8/Pi//Pz4v/z8+L/+fnp/wAQVcz///8A////AP///wD///8AAB1nzPT05f/o6Nn/6OjZ/+jo2f/o6Nn/6OjZ/+jo2f/o6Nn/6OjZ//T05f8AHWfM////AP///wD///8A////AAAjbsz19ef/6urc/+rq3P/q6tz/6urc/+rq3P/q6tz/6urc/+rq3P/19ef/ACNuzP///wD///8A////AP///wAAJnLM9vbq/+zs4P/s7OD/7Ozg/+zs4P/s7OD/7Ozg/+zs4P/s7OD/9vbq/wAmcsz///8A////AP///wD///8AACl3zPf37f/v7+T/7+/k/+/v5P/v7+T/7+/k/+/v5P/v7+T/7+/k//f37f8AKXfM////AP///wD///8A////AAAse8z5+fD/8vLo//Ly6P/y8uj/8vLo//Ly6P/y8uj/8vLo//Ly6P/5+fD/ACx7zP///wD///8A////AP///wAAMH/M+vrz//T07f/09O3/9PTt//T07f/09O3/9PTt//T07f/09O3/+vrz/wAwf8z///8A////AP///wD///8AADODzPv79v/39/H/9/fx//f38f/39/H/9/fx//f38f/39/H/9/fx//v79v8AM4PM////AP///wD///8A////AAA1h8z9/fn/+vr1//r69f/6+vX/+vr1//r69f/6+vX/+vr1//r69f/9/fn/ADWHzP///wD///8A////AP///wAAOIrM/v77//z8+f/8/Pn//Pz5//z8+f/8/Pn//Pz5//z8+f/8/Pn//v77/wA4isz///8A////AP///wD///8AADqNzP///v/+/vz/3Nzb/9zc2//c3Nv/3Nzb/9zc2//c3Nv//v78/////v8AOo3M////AP///wD///8A////AAA9kMz/////o6Ki/4uJif+amJj/p6Wl/6yqqv+hn57/kpCQ/6empv//////AD2QzP///wD///8A////AP///wAAP5PMYpXZ/zVorP/Sx8f/2M/P/+Te3v/k3t7/2M/P/9LHx/81aKz/YpXZ/wA/k8z///8A////AP///wD///8AAECVmQBAlcwAQJXMADGG0G54oubc2tr/3Nra/254ouYAMYbQAECVzABAlcwAQJWZ////AP///wD///8A////AABAlQAAQJUAAECVAClJdAZUVFRSVFRUZ1RUVGdUVFRSKUl0BgBAlQAAQJUAAECVAP///wD///8AwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAA+B8AAA%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B/*Initialization%20Code*/%0A%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%0A%0Avar%20createWindow%20%3D%20function%28text%2C%20title%2C%20id%2C%20pos%2C%20size%29%7B%0A%20%20%20%20var%20win%20%3D%20window%2C%20doc%20%3D%20win.document%2C%20wId%20%3D%20%27ujs_window%27+%28id%20%7C%7C%20%27%27%29%2C%20w%20%3D%20doc.getElementById%28wId%29%3B%0A%20%20%20%20var%20keyDown%20%3D%20function%28e%29%7Bif%28%21e.shiftKey%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.altKey%20%26%26%20e.keyCode%20%3D%3D%2027%29doc.getElementById%28wId%29.closeWin%28%29%7D%3B%0A%20%20%20%20if%28w%29w.closeWin%28%29%3B%0A%20%20%20%20w%20%3D%20doc.createElementNS%28xhtmlns%2C%20%27div%27%29%3B%0A%20%20%20%20w.setAttribute%28%27style%27%2C%20%27position%3Afixed%3Bdisplay%3Ablock%3Bvisibility%3Ahidden%3Bleft%3A0%3Btop%3A0%3Bwidth%3Aauto%3Bheight%3Aauto%3Bborder%3A1px%20solid%20gray%3Bpadding%3A3px%3Bmargin%3A0%3Bz-index%3A99999%3Boverflow%3Ahidden%3Bcursor%3Amove%3B%27+%28typeof%20w.style.borderRadius%20%3D%3D%3D%20%27string%27%20%3F%20%27background-color%3A%23f3f5f7%3Bpadding-top%3A4px%3Bborder-radius%3A4px%3Bbox-shadow%3A0%200%2012px%20rgba%280%2C0%2C0%2C.4%29%3B%27%20%3A%20%27background%3A-o-skin%28%22Window%20Skin%22%29%3B%27%29%29%3B%0A%20%20%20%20w.id%20%3D%20wId%3B%0A%20%20%20%20w.closeWin%20%3D%20function%28%29%7B%0A%20%20%20%20%20%20%20%20doc.removeEventListener%28%27keydown%27%2C%20keyDown%2C%20false%29%3B%0A%20%20%20%20%20%20%20%20this.parentNode.removeChild%28this%29%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20%20w.clearClipboard%20%3D%20function%28%29%7B%0A%20%20%20%20%20%20%20%20copyToClipboard%28%22%22%29%3B%0A%20%20%20%20%20%20%20%20result%20%3D%20%22%22%3B%0A%20%20%20%20%20%20%20%20w.closeWin%28%29%3B%0A%20%20%20%20%20%20%20%20createWindow%28result%2C%20%27%3Ca%20href%3D%22%23%22%20style%3D%22display%3Ainline%3Bpadding%3A0%3Bmargin%3A0%3Btext-decoration%3Anone%3Bborder%3Anone%3Bcolor%3A%23009%3Bfont%3A16px%20Times%20New%20Roman%20%3B%22%3E%3Cb%3E%u0411%u0443%u0444%u0435%u0440%20%u043E%u0431%u043C%u0435%u043D%u0430%3C/b%3E%3C/a%3E%27%29%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20w.addEle%20%3D%20function%28str%2C%20style%29%7B%0A%20%20%20%20%20%20%20%20var%20ele%20%3D%20doc.createElementNS%28xhtmlns%2C%20%27div%27%29%3B%0A%20%20%20%20%20%20%20%20ele.setAttribute%28%27style%27%2C%20style%29%3B%0A%20%20%20%20%20%20%20%20if%28str%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20ele.innerHTML%20%3D%20str%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20for%28var%20el%2C%20all%20%3D%20ele.getElementsByTagName%28%27*%27%29%2C%20i%20%3D%20all.length%3B%20i--%3B%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20el%20%3D%20all%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%28/%5E%28script%7Cframe%7Ciframe%7Capplet%7Cembed%7Cobject%29%24/i.test%28el.nodeName%29%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20el.parentNode.removeChild%28el%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Delse%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%28var%20att%20%3D%20el.attributes%2C%20j%20%3D%20att.length%3B%20j--%3B%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%28/%5Eon%5Ba-z%5D+%24/i.test%28att%5Bj%5D.name%29%29att%5Bj%5D.value%20%3D%20%27%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%20%20%20%20return%20this.appendChild%28ele%29%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20var%20img%20%3D%20doc.createElement%28%27div%27%29%3B%0A%20%20%20%20img.setAttribute%28%27style%27%2C%20%27display%3Ablock%3Bfloat%3Aright%3Bwidth%3A18px%3Bheight%3A18px%3Bpadding%3A0%3Bmargin%3A0%3Bborder%3Anone%3Bcursor%3Apointer%3Bbackground-image%3Aurl%28%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAAZElEQVR42mNgGNyAGQixsVGU/AdCXjCbHczmxKaMFywlAlWiw6DAwIZNmQhYGqJEDWoqFiAGVmKKTwk73CRJ/Ep0GIyhbsPpO4hbIG4TwKaMk0EZ7hYBBk1cvmNDEmbDrmSwAADE8h10+qICXwAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII%3D%22%29%3Bbackground%3A-o-skin%28%22Caption%20Close%20Button%20Skin%22%29%3B%27%29%3B%0A%20%20%20%20img.title%20%3D%20%27Close%27%3B%0A%20%20%20%20img.addEventListener%28%27click%27%2C%20function%28%29%7Bthis.parentNode.closeWin%28%29%7D%2C%20false%29%3B%0A%20%20%20%20w.appendChild%28img%29%3B%0A%20%20%20%20%0A%20%20%20%20w.addEle%28title%2C%20%27display%3Atable%3Bcolor%3A%23000%3Bfont%3A16px%20Times%20New%20Roman%3Bwidth%3Aauto%3Bheight%3Aauto%3Bpadding%3A0%3Bmargin%3A0%202px%3Bcursor%3Atext%3B%27%29%3B%0A%20%20%20%20var%20cnt%20%3D%20w.addEle%28text%2C%20%27display%3Ablock%3Bborder%3A1px%20solid%20%23aaa%3Bmargin%3A2px%200%201px%200%3Bpadding%3A4px%3Bbackground-color%3A%23fafcfe%3Bcolor%3A%23000%3Bfont%3A14px%20Times%20New%20Roman%3Bwidth%3A240px%3Bheight%3A120px%3Boverflow%3Aauto%3Bcursor%3Atext%3B%27%29%3B%0A%20%20%20%20%0A%20%20%20%20var%20img1%20%3D%20doc.createElementNS%28xhtmlns%2C%20%27input%27%29%3B%0A%20%20%20%20img1.setAttribute%20%28%27type%27%2C%20%27button%27%29%3B%0A%20%20%20%20img1.setAttribute%28%27style%27%2C%20%27float%3Aleft%3Bwidth%3A75px%3Bheight%3A18px%3Bfont%3A10px%20Times%20New%20Roman%3Bpadding%3A0%3Bborder-width%3A%201px%20%21%20important%3B%20border-style%3A%20solid%20%21%20important%3B%20border-color%3A%20rgb%28192%2C%20225%2C%20240%29%20rgb%28154%2C%20201%2C%20221%29%20rgb%28154%2C%20201%2C%20221%29%20rgb%28192%2C%20225%2C%20240%29%20%21%20important%3B%20color%3A%20rgb%2851%2C%2051%2C%2051%29%3Bmargin%3A0%3Bcursor%3Apointer%3B%27%29%3B%0A%20%20%20%20img1.setAttribute%20%28%27value%27%2C%20%27%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%27%29%3B%0A%20%20%20%20img1.addEventListener%28%27click%27%2C%20function%28%29%7Bthis.parentNode.clearClipboard%28%29%7D%2C%20false%29%3B%0A%20%20%20%20w.appendChild%28img1%29%3B%0A%0A%20%20%20%20w.addEventListener%28%27mousedown%27%2C%20function%28e%29%7B%0A%20%20%20%20%20%20%20%20if%28e.target%20%3D%3D%20w%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20e.preventDefault%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20grabX%20%3D%20e.clientX%2C%20grabY%20%3D%20e.clientY%2C%20origX%20%3D%20parseInt%28w.style.left%29%2C%20origY%20%3D%20parseInt%28w.style.top%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20mouseMove%20%3D%20function%28ev%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20w.style.left%20%3D%20origX+ev.clientX-grabX+%27px%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20w.style.top%20%3D%20origY+ev.clientY-grabY+%27px%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20doc.addEventListener%28%27mousemove%27%2C%20mouseMove%2C%20false%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20doc.addEventListener%28%27mouseup%27%2C%20function%28%29%7Bdoc.removeEventListener%28%27mousemove%27%2C%20mouseMove%2C%20false%29%7D%2C%20false%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%2C%20false%29%3B%0A%20%20%20%20doc.documentElement.appendChild%28w%29%3B%0A%0A%20%20%20%20if%28size%29%7B%0A%20%20%20%20%20%20%20%20cnt.style.height%20%3D%20size.height%3B%0A%20%20%20%20%20%20%20%20cnt.style.width%20%3D%20size.width%3B%0A%20%20%20%20%7Delse%7B%0A%20%20%20%20%20%20%20%20for%28var%20i%20%3D%203%3B%20i%20%3C%2010%3B%20i++%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%28cnt.scrollHeight%20%3E%20cnt.offsetHeight%20%7C%7C%20cnt.scrollWidth%20%3E%20cnt.offsetWidth%29%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cnt.style.height%20%3D%20100*i+%27px%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cnt.style.width%20%3D%20100*i+%27px%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7Delse%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20var%20docEle%20%3D%20doc.compatMode%20%3D%3D%20%27CSS1Compat%27%20%3F%20doc.documentElement%20%3A%20doc.body%3B%0A%20%20%20%20var%20mX%20%3D%20docEle.clientWidth-w.offsetWidth%2C%20mY%20%3D%20docEle.clientHeight-w.offsetHeight%3B%0A%20%20%20%20if%28mX%20%3C%200%29%7Bcnt.style.width%20%3D%20parseInt%28cnt.style.width%29+mX+%27px%27%3B%20mX%20%3D%200%7D%3B%0A%20%20%20%20if%28mY%20%3C%200%29%7Bcnt.style.height%20%3D%20parseInt%28cnt.style.height%29+mY+%27px%27%3B%20mY%20%3D0%7D%3B%0A%20%20%20%20var%20hW%20%3D%20parseInt%28w.offsetWidth/2%29%3B%0A%20%20%20%20w.style.left%20%3D%20%28pos%20%26%26%20pos.X%20%3C%20mX+hW%20%3F%20%28pos.X%20%3E%20hW%20%3F%20pos.X-hW%20%3A%200%29%20%3A%20mX%29+%27px%27%3B%0A%20%20%20%20w.style.top%20%3D%20%28pos%20%26%26%20pos.Y+10%20%3C%20mY%20%3F%20pos.Y+10%20%3A%20mY%29+%27px%27%3B%0A%20%20%20%20w.style.visibility%20%3D%20%27visible%27%3B%0A%20%20%20%20doc.addEventListener%28%27keydown%27%2C%20keyDown%2C%20false%29%3B%0A%7D%3B%0A%0Afunction%20readFromClipboard%28%29%20%7B%0A%20%20var%20string%3B%0A%20%20try%20%7B%0A%20%20%20%20%20%20var%20clipboard%20%3D%20Cc%5B%22@mozilla.org/widget/clipboard%3B1%22%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20getService%28Ci.nsIClipboard%29%3B%0A%20%20%20%20%20%20var%20trans%20%3D%20Cc%5B%22@mozilla.org/widget/transferable%3B1%22%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20createInstance%28Ci.nsITransferable%29%3B%0A%20%20%20%20%20%20trans.addDataFlavor%28%22text/unicode%22%29%3B%0A%20%20%20%20%20%20if%20%28clipboard.supportsSelectionClipboard%28%29%29%20%7B%0A%20%20%20%20%20%20%20%20clipboard.getData%28trans%2C%20clipboard.kSelectionClipboard%29%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20clipboard.getData%28trans%2C%20clipboard.kGlobalClipboard%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20data%20%3D%20%7B%7D%3B%0A%20%20%20%20%20%20var%20dataLen%20%3D%20%7B%7D%3B%0A%20%20%20%20%20%20trans.getTransferData%28%22text/unicode%22%2C%20data%2C%20dataLen%29%3B%0A%20%20%20%20%20%20if%20%28data%29%20%7B%0A%20%20%20%20%20%20%20%20data%20%3D%20data.value.QueryInterface%28Ci.nsISupportsString%29%3B%0A%20%20%20%20%20%20%20%20string%20%3D%20trans.getTransferData.length%20%3D%3D%202%0A%20%20%20%20%20%20%20%20%20%20%3F%20data.data%20%3A%20data.data.substring%280%2C%20dataLen.value%20/%202%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%7D%20catch%20%28ex%29%20%7B%0A%20%20%7D%0A%20%20return%20string%3B%0A%7D%3B%0A%0Afunction%20copyToClipboard%28aString%29%20%7B%0A%20%20let%20clipboardHelper%20%3D%20Cc%5B%22@mozilla.org/widget/clipboardhelper%3B1%22%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20getService%28Ci.nsIClipboardHelper%29%3B%0A%20%20clipboardHelper.copyString%28aString%29%3B%0A%7D%3B%0A%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20result%20%3DreadFromClipboard%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20result.replace%28/%5C%26/g%2C%22%26amp%3B%22%29.replace%28/%3C/g%2C%22%26lt%3B%22%29.replace%28/%3E/g%2C%22%26gt%3B%22%29.replace%28/%22/g%2C%22%26quot%3B%22%29.replace%28/%60/g%2C%22%26%23x60%3B%22%29%3B%0A%0A%0A%0AcreateWindow%28result%2C%20%27%3Ca%20href%3D%22%23%22%20style%3D%22display%3Ainline%3Bpadding%3A0%3Bmargin%3A0%3Btext-decoration%3Anone%3Bborder%3Anone%3Bcolor%3A%23009%3Bfont%3A16px%20Times%20New%20Roman%20%3B%22%3E%3Cb%3E%u0411%u0443%u0444%u0435%u0440%20%u043E%u0431%u043C%u0435%u043D%u0430%3C/b%3E%3C/a%3E%27%29%3B%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E
/*CODE*/ var createWindow = function(text, 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.clearClipboard = function(){ copyToClipboard(""); result = ""; w.closeWin(); createWindow(result, '<a href="#" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman ;"><b>Буфер обмена</b></a>'); }; 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 = 'Close'; img.addEventListener('click', function(){this.parentNode.closeWin()}, false); w.appendChild(img); w.addEle(title, 'display:table;color:#000;font:16px Times New Roman;width:auto;height:auto;padding:0;margin:0 2px;cursor:text;'); 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;'); var img1 = doc.createElementNS(xhtmlns, 'input'); img1.setAttribute ('type', 'button'); img1.setAttribute('style', 'float:left;width:75px;height:18px;font:10px Times New Roman;padding:0;border-width: 1px ! important; border-style: solid ! important; border-color: rgb(192, 225, 240) rgb(154, 201, 221) rgb(154, 201, 221) rgb(192, 225, 240) ! important; color: rgb(51, 51, 51);margin:0;cursor:pointer;'); img1.setAttribute ('value', 'Очистить'); img1.addEventListener('click', function(){this.parentNode.clearClipboard()}, false); w.appendChild(img1); 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 = 100*i+'px'; cnt.style.width = 100*i+'px'; }else break; } }; var docEle = doc.compatMode == 'CSS1Compat' ? 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); }; function readFromClipboard() { var string; try { var clipboard = Cc["@mozilla.org/widget/clipboard;1"]. getService(Ci.nsIClipboard); var trans = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); trans.addDataFlavor("text/unicode"); if (clipboard.supportsSelectionClipboard()) { clipboard.getData(trans, clipboard.kSelectionClipboard); } else { clipboard.getData(trans, clipboard.kGlobalClipboard); } var data = {}; var dataLen = {}; trans.getTransferData("text/unicode", data, dataLen); if (data) { data = data.value.QueryInterface(Ci.nsISupportsString); string = trans.getTransferData.length == 2 ? data.data : data.data.substring(0, dataLen.value / 2); } } catch (ex) { } return string; }; function copyToClipboard(aString) { let clipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"]. getService(Ci.nsIClipboardHelper); clipboardHelper.copyString(aString); }; var result =readFromClipboard(); result = result.replace(/\&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/`/g,"`"); createWindow(result, '<a href="#" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman ;"><b>Буфер обмена</b></a>');
Отсутствует
Alex_one у меня нормально, давай подождем, что другие скажут
Подправил для многопроцессорного режима еще одну кнопку комбайн перевода
/*Initialization Code*/ //--------------------------------Перевод---------------------------------------- //Здесь можно изменять парамеры: //Ключи //Яндекс var keyuser = "____Ваш ключ______"; //"trnsl.1.1.20170531T164120Z.57e9764369279ca0.2a07c3f1cc980dab3c31eb4d00e5a85d78cfd50d"; - ключ из свободного доступа //Microsoft var keyus = "____Ваш ключ______"; //Варианты выбора языка переводчика для перевода текста в окне. Нужное разкоментировать. Остальное закоментировать. //Google, var langFrom_google_text = "auto";//авто var langTo_google_text = "ru"; //Microsoft var langFrom_Microsoft_text = "";//авто var langTo_Microsoft_text = "ru"; //Promt var langFrom_PROMT_text = "a";//авто var langTo_PROMT_text = "r"; //Яндекс var langFrom_yandex_text = ""; //авто //var langFrom_yandex_text = "en-"; //английский и так же другие языки, тире обязательно var langTo_yandex_text = "ru"; //Назначаем иконки var mainicon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQtJREFUKM9VkSFOhFEQg799/CjEihWAwKDgIFwAyWHgLDjuAGfZgMCQDQkG8abtQ/z8u9A0k4rOTCez2u0GB0gCsLELbCuxLduJy0zAZgOQBBqQALEbtOQoyRgjSZLt9nOaJyf5K2zPjr01SWst8ermZtzd5euLhCQ2Y9iOHXssIvZYr1f39x/T87Ourtr7O3ZUyK6KlN5HVRaOqlxcNGACJKRItigdHFXpFdXoPVWRGmSac0suRYWUWhz7zt5/BXh65Pi6Hr7rI/IopZyqpSqldLsq9onPX3iabuHYr6o3pCVHP2Sa11nIzZdnMAmOSpyejiocVEhtjrwc15L5l4HVDgReCGTR+V9n/AAByma0J+vVwwAAAABJRU5ErkJggg=="; var gticon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADPElEQVR4nGWTTWhjZRSG3/uTNr39mTqTn1KacagTqyKIlYJ2ExQCUhiprgpduRVFpLvZjOCsXEgWFqRk0RZcWLopmOnCQcPUsVBiTEZbalrGTJOZJm2aNGm++92b737fcdGZTfvAuznwnMV7OBouEI/HdSHEyNzcXCwajb7r8/n6T09P99bW1u4PDw8/SiQSbHd396IGBINBJJPJQDqdvssYK0kpO0SkiIiUUlII0SqVSr8lk8n3JycnjUsLZmdnb5bL5T+klPK5RNzp0BlzyHEFKXU+cxynubKy8tXExIQJABoAzM/PB6amptYikch70DRtv3iMh5kClPQglcKzozMMXhnAh7E3EL0RhCcEX19f/6xSqSxhdHRUT6VS39i2LYUQtJ7epm9/uEdHtSZJKUkpRa0zm75fvE+f3/mRmM3JcRyqVqulmZmZl7G6uhopl8sHtm3TduEpffH1T1Srn9FFavUmnTRaJKUkx3Go0WiojY2N22aj0Yj5fL6wJyVS6R289koYVwd7L3V07aUBAICUEkopSCk1v99/Sw+Hw5NSyi7OXZQrTQwFBy6f6DlKKSil4HkeOp0ODMO4btq23S+EgFQaAAKzO1BKQdd1AICmaSAiEBGUlBBCwHVduK4LzrlpHh4e7nHOVW+vofdbPmxkHuPWB6/D6vFD13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AAASUVORK5CYII="; function GetXmlHttpObject(){ if (window.XMLHttpRequest){ return new XMLHttpRequest();} if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP");} return null; }; 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); }; //----------Перевести текст из буфера в окне Google------------ var ujs_google_translat = function (dir){ var lng = 'ru'; var txt = gClipboard.read(), 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 urlt = "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').replace(/\\n/g, "<br />")); 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="'+urlt.replace(/&/g,'&')+'" target="_blank" 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)); }; }; //----------Перевести выделенный текст в окне Google------------ function ujs_google_translate (){ var lng = 'ru'; var txt = gContextMenuContentData.selectionInfo.fullText; 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 url = 'https://translate.google.com/translate_a/single?client=t&sl=' + langFrom_google_text + '&tl=' + langTo_google_text + '&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 urlt = "http://translate.google.com/translate_t?text="+encTxt+"&sl=' + langFrom_google_text + '&tl=' + langTo_google_text +'&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').replace(/\\n/g, "<br />")); 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(); status = tmp[8][0][0].toUpperCase() + ' -\u203A ' + langTo_google_text.toUpperCase(); createWindow(result, status, '<a href="'+urlt.replace(/&/g,'&')+'" target="_blank" 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)); }; }; //----------Перевести текст в окне Яндекс------------ function ujs_yandex_translate() { var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt); var lng = 'ru'; var winWait = function(lng){createWindow('', (lng == 'ru' ? '\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C' : 'Translating')+'\u2026', 'Яндекс', '_gt', window.navigator.lastClick)}; if (txt) { winWait(lng); var xhr = new XMLHttpRequest(); var encTxt = encodeURIComponent(txt); var url ="https://translate.yandex.net/api/v1.5/tr.json/translate?key="+keyuser+"&lang="+langFrom_yandex_text+langTo_yandex_text+"&text=" + encTxt; function gettransdata(){ xmlhttp=GetXmlHttpObject(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open('GET', url, true); xmlhttp.send(null); } function stateChanged(){ if (xmlhttp.readyState==4) { var tryain=xmlhttp.responseText; tryain=tryain.replace(/\\n/g, "<br />"); var data = JSON.parse( tryain ); var result,status; if (data.code == "401") {result = "Неправильный ключ API"; status = "";} if (data.code == "402") {result = "Ключ API заблокирован"; status = "";} if (data.code == "403") {result = "Превышено суточное ограничение на количество запросов"; status = "";} if (data.code == "404") {result = "Превышено суточное ограничение на объем переведенного текста"; status = "";} if (data.code == "413") {result = "Превышен максимально допустимый размер текста"; status = "";} if (data.code == "422") {result = "Текст не может быть переведен"; status = "";} if (data.code == "501") {result = "Заданное направление перевода не поддерживается"; status = "";} if (data.code == "200") {result = data.text; var status1 = data.lang; status =(status1.replace(/\-/g, "-\u203A")).toUpperCase();} var urlt = 'http://translate.yandex.ru/?text=' + encTxt + '&lang=' + status1; createWindow(result, status, '<a href="'+urlt.replace(/&/g,'&')+'" target="_blank" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman;">Яндекс</a>', '_gt', window.navigator.lastClick); } } gettransdata(); } }; //----------Перевести выделенный текст в окне Microsoft------------ function ujs_Microsoft_translate (){ var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt); if (txt) { var xhr = new XMLHttpRequest(); var encTxt = encodeURIComponent(txt), post = encTxt.length > 1024; var urlt = 'http://www.bing.com/translator/?from='+langFrom_Microsoft_text+'&to='+langTo_Microsoft_text+'&Text=' + encTxt; var uridetect = "http://api.microsofttranslator.com/V2/Ajax.svc/Detect?appId="+keyus+"&text="+ encTxt; var url="http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appId="+keyus+"&from="+langFrom_Microsoft_text+"&to="+langTo_Microsoft_text+"&text="+ encTxt; if (txt && location. hostname != 'http://api.microsofttranslator.com/') { var result="", status="Подождите идет перевод"; createWindow(result, status,'<a href="'+url.replace(/&/g,'&')+'" target="_blank" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman;">Bing</a>', '_gt', window.navigator.lastClick); } function gettransdata(){ xmlhttp=GetXmlHttpObject(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open(post ? 'POST' : 'GET', url, true); if(post)xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(post ? encTxt : null); xmlhttp1=GetXmlHttpObject(); xmlhttp1.onreadystatechange=stateChanged; xmlhttp1.open('GET', uridetect, true); xmlhttp1.send(null); } function stateChanged(){ if (xmlhttp.readyState==4 && xmlhttp1.readyState==4) { var tryain=xmlhttp.responseText; tryain=tryain.replace(/\"/g, '').replace(/\\u000d/g, " ").replace(/\\u000a/g, "<br />").replace(/\//g, '').replace(/\\n/g, "<br/>").replace(/\\r/g, ""); var tryain1=xmlhttp1.responseText; tryain1=tryain1.replace(/\"/g, ''); var result = tryain; var status =(tryain1 +' -\u203A '+ "ru").toUpperCase(); createWindow(result, status, '<a href="'+urlt.replace(/&/g,'&')+'" target="_blank" style="display:inline;padding:0;margin:0;text-decoration:none;border:none;color:#009;font:16px Times New Roman;">Bing</a>', '_gt', window.navigator.lastClick); } } gettransdata(); } }; //----------Заменить текст переводом Microsoft------------ function ujs_Microsoft_TexReplace (){ var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt); if (txt) { var xhr = new XMLHttpRequest(); var encTxt = encodeURIComponent(txt), post = encTxt.length > 1024; var urlt = 'http://www.bing.com/translator/?from='+langFrom_Microsoft_text+'&to='+langTo_Microsoft_text+'&SourceText=' + encTxt; var uridetect = "http://api.microsofttranslator.com/V2/Ajax.svc/Detect?appId="+keyus+"&text="+ encTxt; var url="http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appId="+keyus+"&from="+langFrom_Microsoft_text+"&to="+langTo_Microsoft_text+"&text="+ encTxt; function gettransdata(){ xmlhttp=GetXmlHttpObject(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open(post ? 'POST' : 'GET', url, true); if(post)xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(post ? encTxt : null); xmlhttp1=GetXmlHttpObject(); xmlhttp1.onreadystatechange=stateChanged; xmlhttp1.open('GET', uridetect, true); xmlhttp1.send(null); } function stateChanged(){ if (xmlhttp.readyState==4 && xmlhttp1.readyState==4) { var tryain=xmlhttp.responseText; tryain=tryain.replace(/\"/g, '').replace(/\\u000d/g, " ").replace(/\\u000a/g, "<br />").replace(/\//g, '').replace(/\\n/g, "<br/>").replace(/\\r/g, ""); var tryain1=xmlhttp1.responseText; tryain1=tryain1.replace(/\"/g, ''); var result = tryain; var msgName = _id + ":ReplaceSelectionRangeAt0"; var url = "data:," + encodeURIComponent( `addMessageListener("${msgName}", function listener(msg) { removeMessageListener("${msgName}", listener); var win = {}; Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager) .getFocusedElementForWindow(content, true, win); var sel = win.value.document.getSelection(); if (sel.isCollapsed) return; var range = sel.getRangeAt(0); range.deleteContents(); range.insertNode(range.createContextualFragment(msg.data)); });` ); function replace(tagString) { var mm = gBrowser.selectedBrowser.messageManager; mm.loadFrameScript(url, false); mm.sendAsyncMessage(msgName, tagString); } replace('<span>'+result+'</span>'); } } gettransdata(); } }; //----------Заменить текст переводом Яндекс------------ function ujs_TexReplace_translate() { var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt); if (txt) { var xhr = new XMLHttpRequest(); var encTxt = encodeURIComponent(txt); var url ="https://translate.yandex.net/api/v1.5/tr.json/translate?key="+keyuser+"&lang="+langFrom_yandex_text+langTo_yandex_text+"&text=" + encTxt; function gettransdata(){ xmlhttp=GetXmlHttpObject(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open('GET', url, true); xmlhttp.send(null); } function stateChanged(){ if (xmlhttp.readyState==4) { var tryain=xmlhttp.responseText; tryain=tryain.replace(/\\n/g, "<br />"); var data = JSON.parse( tryain ); var result = data.text; var msgName = _id + ":ReplaceSelectionRangeAt0"; var url = "data:," + encodeURIComponent( `addMessageListener("${msgName}", function listener(msg) { removeMessageListener("${msgName}", listener); var win = {}; Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager) .getFocusedElementForWindow(content, true, win); var sel = win.value.document.getSelection(); if (sel.isCollapsed) return; var range = sel.getRangeAt(0); range.deleteContents(); range.insertNode(range.createContextualFragment(msg.data)); });` ); function replace(tagString) { var mm = gBrowser.selectedBrowser.messageManager; mm.loadFrameScript(url, false); mm.sendAsyncMessage(msgName, tagString); } replace('<span>'+result+'</span>'); } } gettransdata(); } }; //----------Заменить текст переводом Google------------ function ujs_google_TexReplace() { var lng = 'ru'; var txt = gContextMenuContentData.selectionInfo.fullText; if (txt) { var xhr = new XMLHttpRequest(); var url = 'https://translate.google.com/translate_a/single?client=t&sl=' + langFrom_google_text + '&tl=' + langTo_google_text + '&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); function gettransdata(){ xmlhttp=GetXmlHttpObject(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open('POST', url, true); xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8'); xmlhttp.send('q=' + encodeURIComponent(txt)); } function stateChanged() { if (xmlhttp.readyState == 4 ) { var result = ''; var data = JSON.parse(xmlhttp.responseText.replace(/\[(?=,)/g, '[0').replace(/,(?=,|\])/g, ',0').replace(/\\n/g, "<br />")); for(var i = 0, n; n = data[0][i]; i++){ if(n[0])result += n[0].toString(); }; var msgName = _id + ":ReplaceSelectionRangeAt0"; var url = "data:," + encodeURIComponent( `addMessageListener("${msgName}", function listener(msg) { removeMessageListener("${msgName}", listener); var win = {}; Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager) .getFocusedElementForWindow(content, true, win); var sel = win.value.document.getSelection(); if (sel.isCollapsed) return; var range = sel.getRangeAt(0); range.deleteContents(); range.insertNode(range.createContextualFragment(msg.data)); });` ); function replace(tagString) { var mm = gBrowser.selectedBrowser.messageManager; mm.loadFrameScript(url, false); mm.sendAsyncMessage(msgName, tagString); } replace('<span>'+result+'</span>'); } } gettransdata(); } }; //--------Перевести текст в Google в новой вкладке-------------- function ujs_GoogleTextPageNew_translate() { var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt); var ctabpos = gBrowser.selectedTab._tPos +1; var url="http://translate.google.com/translate_t?text="+encTxt+"&sl=auto&tl=ru&hl=ru&eotf=0&ujs=gtt"; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; //--------Перевести текст в Яндексе в новой вкладке-------------- function ujs_yandexTextPageNew_translate() { var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt), post = encTxt.length > 1024; var ctabpos = gBrowser.selectedTab._tPos +1; if (txt) { var xhr = new XMLHttpRequest(); var url ="https://translate.yandex.net/api/v1.5/tr.json/detect?key="+keyuser+"&lang=ru&text=" + (post ? '' : encTxt); function gettransdata(){ xmlhttp=GetXmlHttpObject(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open(post ? 'POST' : 'GET', url, true); if(post)xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(post ? encTxt : null); } function stateChanged(){ if (xmlhttp.readyState==4) { var tryain=xmlhttp.responseText; var data = JSON.parse( tryain ); var status1 = data.lang; var urlt="http://translate.yandex.ru/?text=" + encTxt + "&lang=" + status1 + "-ru"; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(urlt), ctabpos); } } gettransdata(); } }; //---------Перевести текст в PROMT в новой вкладке--------------- function ujs_PROMTTextPageNew_translate(){ var txt = gContextMenuContentData.selectionInfo.fullText; var encTxt = encodeURIComponent(txt); var ctabpos = gBrowser.selectedTab._tPos +1; var url="http://www.translate.ru/?External=IE8Accelerator&formEncoding=utf-8&direction=ar&prmtlang=ru&status=translate&template=General&source="+encTxt; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; //---------Перевести текст в Microsoft в новой вкладке--------------- function ujs_MicrosoftTextPageNew_translate(){ var txt = gContextMenuContentData.selectionInfo.fullText; var ctabpos = gBrowser.selectedTab._tPos +1; var encTxt = encodeURIComponent(txt); var url="http://www.bing.com/translator/?to=ru&Text="+encTxt; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; //--------Перевести страницу с Google-------------- function ujs_googlePage_translate() { var urlt = gBrowser.currentURI.spec; var url = "http://translate.google.com/translate?hl=ru&sl=auto&tl=ru&u="+ encodeURIComponent(urlt) + "&sandbox=1"; gBrowser. loadURI(url, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); }; //---------Перевести страницу с Promt--------------- function ujs_PromtPage_translate() { var urlt = gBrowser.currentURI.spec; var url = "http://www.translate.ru/siteTranslation/autolink/?direction=ar&template=General&sourceURL="+encodeURIComponent(urlt); gBrowser. loadURI(url, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); }; //---------Перевести страницу с Yandex--------------- function ujs_YandexPage_translate() { // var urlt = content.document.location.href; var urlt = gBrowser.currentURI.spec; var url = "https://translate.yandex.com/translate?url=" + encodeURIComponent(urlt) + "&dir=&ui=ru&lang=auto-ru" ; gBrowser. loadURI(url, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); }; //---------Перевести страницу с Microsoft--------------- function ujs_MicrosoftPage_translate() { var urlt = gBrowser.currentURI.spec; var url = "http://www.microsofttranslator.com/bv.aspx?from=&to=ru&a="+encodeURIComponent(urlt); gBrowser. loadURI(url, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); }; //---------Перевести страницу с Yandex в новой вкладке -------------- function ujs_yandexPageNew_translate() { var urlt = gBrowser.currentURI.spec; var url = "https://translate.yandex.com/translate?url=" + encodeURIComponent(urlt) + "&dir=&ui=ru&lang=auto-ru" ; var ctabpos = gBrowser.selectedTab._tPos +1; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; //---------Перевести страницу с Microsoft в новой вкладке --------------- function ujs_MicrosoftPageNew_translate() { var urlt = gBrowser.currentURI.spec; var url = "http://www.microsofttranslator.com/bv.aspx?from=&to=ru&a="+encodeURIComponent(urlt); var ctabpos = gBrowser.selectedTab._tPos +1; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; //---------Перевести страницу с Promt в новой вкладке --------------- function ujs_PromtPageNew_translate() { var urlt = gBrowser.currentURI.spec; var url = "http://www.translate.ru/site/General/au-ru/?url="+ encodeURIComponent(urlt) + ""; var ctabpos = gBrowser.selectedTab._tPos +1; gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; //--------Перевести страницу с Google в новой вкладке -------------- function ujs_GooglePageNew_translate() { var urlt = gBrowser.currentURI.spec; var url = "http://translate.google.com/translate?hl=ru&sl=auto&tl=ru&u="+ encodeURIComponent(urlt) + "&sandbox=1"; var ctabpos = gBrowser.selectedTab._tPos +1; var css = '@-moz-document domain("translate.google.com") {\ #gb, #gt-c:not([class="g-section"]) { display: none !important; }\ #contentframe { top: 0 !important; }\ }'; var uri = makeURI("data:text/css," + encodeURIComponent(css)); var sss = Cc["@mozilla.org/content/style-sheet-service;1"]. getService(Ci.nsIStyleSheetService); try { sss.unregisterSheet(uri, sss.AGENT_SHEET) } catch(e) { sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET) } gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addWebTab(url), ctabpos); }; //Контекстное меню для перевода из буфера------------------------------------------- (function () { if ( document.getElementById("TranslateBufer") ) return; var contextMenu = document.getElementById("contentAreaContextMenu"); var Item = document.createXULElement("menuitem"); Item.setAttribute("Id", "TranslateBufer"); Item.setAttribute("label", "Перевод из буфера"); Item.setAttribute("class", "menuitem-iconic"); Item.setAttribute("image", mainicon); Item.addEventListener("command", function(){ujs_google_translat('auto|ru')}, false); contextMenu.insertBefore(Item, document.getElementById("context-viewpartialsource-selection") ); addDestructor(function() { contextMenu.removeChild( Item ) }); })(); //Контекстное меню для перевода страниц------------------------------------------- (function () { if ( document.getElementById("TranslatePage") ) return; var menu = document.createXULElement("menu"); var menuPopup = document.createXULElement("menupopup"); var contextMenu = document.getElementById("contentAreaContextMenu"); menu.id = "TranslatePage"; menu.setAttribute("label", "Перевести страницу"); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", mainicon); contextMenu.insertBefore(menu, document.getElementById("context-viewsource") ); menu.appendChild( menuPopup ); addDestructor(function() { contextMenu.removeChild( menu ) }); var array = [ {label:"Google", func: ujs_googlePage_translate, image:gticon}, {label:"Promt ", func: ujs_PromtPageNew_translate, image:promticon}, {label:"Yandex ", func: ujs_YandexPage_translate, image:yndicon}, {label:"Microsoft", func: ujs_MicrosoftPage_translate, image:bingicon}, { separator: '' }, {label:"Google в новой вкладке", func: ujs_GooglePageNew_translate, image:gticon}, {label:"Promt в новой вкладке", func: ujs_PromtPageNew_translate, image:promticon}, {label:"Yandex в новой вкладке", func: ujs_yandexPageNew_translate, image:yndicon}, {label:"Microsoft в новой вкладке", func: ujs_MicrosoftPageNew_translate, image:bingicon} ]; array.forEach(function( m ) { if ( "separator" in m ) { menuPopup.appendChild( document.createXULElement("menuseparator") ); return }; var mItem = document.createXULElement("menuitem"); mItem.setAttribute("label", m.label); mItem.setAttribute("class", "menuitem-iconic"); mItem.setAttribute("image", m.image); mItem.addEventListener("command", m.func, false); menuPopup.appendChild( mItem ); }); addEventListener("popupshowing", function() { menu.hidden = gContextMenu.isTextSelected || gContextMenu.onImage || gContextMenu.onTextInput ; }, true, contextMenu ); })(); //Контекстное меню для перевода текста------------------------------------------- (function () { if ( document.getElementById("TranslateSelected") ) return; var menu = document.createXULElement("menu"); var menuPopup = document.createXULElement("menupopup"); var contextMenu = document.getElementById("contentAreaContextMenu"); menu.id = "TranslateSelected"; menu.setAttribute("label", "Перевести выделенный текст"); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", mainicon); contextMenu.insertBefore(menu, document.getElementById("context-viewpartialsource-selection") ); menu.appendChild( menuPopup ); addDestructor(function() { contextMenu.removeChild( menu ) }); var array = [ {label:"В окне Google", func: ujs_google_translate, image:gticon}, {label:"В окне Яндекс", func: ujs_yandex_translate, image:yndicon}, {label:"В окне Microsoft", func: ujs_Microsoft_translate, image:bingicon}, { separator: ''}, {label:"Заменить текст переводом Яндекс", func: ujs_TexReplace_translate, image:yndicon}, {label:"Заменить текст переводом Microsoft", func: ujs_Microsoft_TexReplace, image:bingicon}, {label:"Заменить текст переводом Google", func: ujs_google_TexReplace, image:gticon}, { separator: ''}, {label:"В Google в новой вкладке", func: ujs_GoogleTextPageNew_translate, image:gticon}, {label:"В Яндексе в новой вкладке", func: ujs_yandexTextPageNew_translate, image:yndicon}, {label:"В PROMT в новой вкладке", func: ujs_PROMTTextPageNew_translate, image:promticon}, {label:"В Microsoft в новой вкладке", func: ujs_MicrosoftTextPageNew_translate, image:bingicon} ]; array.forEach(function( m ) { if ( "separator" in m ) { menuPopup.appendChild( document.createXULElement("menuseparator") ); return }; var mItem = document.createXULElement("menuitem"); mItem.setAttribute("label", m.label); mItem.setAttribute("class", "menuitem-iconic"); mItem.setAttribute("image", m.image); mItem.addEventListener("command", m.func, false); menuPopup.appendChild( mItem ); }); addEventListener("popupshowing", function() { menu.hidden = !gContextMenu.isTextSelected; }, false, contextMenu ); })();
Отсутствует
rubel из предыдущего поста добавь блоки
//----------Перевести текст из буфера в окне Google------------
//Контекстное меню для перевода из буфера------------
Отсутствует
Dumby
Помогите разобраться.
Ставлю чистую сборку 69b5. bootstrap-loader.js беру из вашего поста
https://forum.mozilla-russia.org/viewtopic.php?pid=771479#p771479
Вот мой config.js
// try { (function() { var Cu = Components.utils; var {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); var sandbox = Cu.Sandbox(Services.scriptSecurityManager.getSystemPrincipal(), { wantComponents: true, sandboxName: "user_chrome_files" }); sandbox.Services = Services; Cu.evalInSandbox(` var Ci = Components.interfaces; var config = { subScript: {}, observe: function(aSubject, aTopic, aData) { if (aTopic == "domwindowopened" && aSubject instanceof Ci.nsIDOMWindow) { aSubject.addEventListener("DOMContentLoaded", function domLoad() { aSubject.removeEventListener("DOMContentLoaded", domLoad, true); var loc = aSubject.location; if (loc && loc.protocol == "chrome:") { try { config.subScript.user_chrome.loadIntoWindow(aSubject, loc.href); } catch(ex) { } } }, true); } else if (aTopic == "profile-after-change") { Services.obs.removeObserver(config, "profile-after-change"); var file = Services.dirsvc.get("UChrm", Ci.nsIFile); file.append("user_chrome_files"); file.append("user_chrome.manifest"); if (!file.exists() || !file.isFile()) { this.removeObs(); return; } try { var reg = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); reg.autoRegister(file); } catch(ex) { this.removeObs(); return; } try { Services.scriptloader.loadSubScript("chrome://user_chrome_files/content/user_chrome.js", this.subScript, "UTF-8"); } catch(ex) { this.removeObs(); } } }, removeObs: function() { Services.obs.removeObserver(config, "domwindowopened"); } }; Services.obs.addObserver(config, "profile-after-change", false); Services.obs.addObserver(config, "domwindowopened", false); `, sandbox); })(); } catch(ex) { // Components.utils.reportError(ex); } // try {(nsvo => { var o = Cu.getGlobalForObject(nsvo).Object, {freeze} = o; o.freeze = obj => { if (Components.stack.caller.filename != "resource://gre/modules/AppConstants.jsm") return freeze(obj); obj.MOZ_REQUIRE_SIGNING = false; obj.MOZ_ALLOW_LEGACY_EXTENSIONS = true; return (o.freeze = freeze)(obj); } lockPref("extensions.legacy.enabled", true); lockPref("xpinstall.signatures.required", false); lockPref("extensions.langpacks.signatures.required", false); nsvo = Cu.import("resource://gre/modules/addons/XPIInstall.jsm", {}); var shouldVerify = nsvo.shouldVerifySignedState; nsvo.shouldVerifySignedState = addon => !addon.id && shouldVerify(addon); })(Cu.import("resource://gre/modules/WebRequestCommon.jsm", {}));} catch(ex) {Cu.reportError(ex);} // try {({ ids: [ "custombuttons@xsms.org", ], init(xrt) { if (xrt.inSafeMode) return; Cu.import("resource://gre/modules/addons/XPIProvider.jsm", this); var load = async file => { var rootURI = this.XPIInternal.getURIForResourceInFile(file, ""); Cu.import(rootURI.resolve("startup.jsm"), {}).start(rootURI); } var proto = this.XPIInternal.BootstrapScope.prototype; var func = proto._beforeCallBootstrapMethod; // try { Cu.createDocumentEncoder && Cc["@mozilla.org/moz/jssubscript-loader;1"] .getService(Ci.mozIJSSubScriptLoader).loadSubScript(String.raw` data:,var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");%0Avar {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");%0A%0Athis.lazyModules = {%0A%09OS: "resource://gre/modules/osfile.jsm",%0A%09Services: "resource://gre/modules/Services.jsm",%0A%09ConsoleAPI: "resource://gre/modules/Console.jsm",%0A%09Blocklist: "resource://gre/modules/Blocklist.jsm",%0A%09AddonInternal: "resource://gre/modules/addons/XPIDatabase.jsm"%0A};%0Aif ("@mozilla.org/intl/domlocalization;1" in Cc)%0A%09this.lazyModules.RDFDataSource = "resource://gre/modules/addons/RDFDataSource.jsm";%0Aelse%0A%09// Firefox 67+%0A%09// Bug 1523194 - Remove XPIDL for DOMLocalization and use do_ImportModule instead%0A%09// https://bugzilla.mozilla.org/show_bug.cgi?id=1523194%0A%09//%0A%09// Bug 857458 - Remove support for update.rdf%0A%09// https://bugzilla.mozilla.org/show_bug.cgi?id=857458%0A%0A%09XPCOMUtils.defineLazyGetter(this, "RDFDataSource", () => {%0A%09%09var obs = {};%0A%09%09var scs = Cc["@mozilla.org/streamConverters;1"].getService(Ci.nsIStreamConverterService);%0A%09%09var sis = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);%0A%09%09var sl = Cc["@mozilla.org/network/stream-loader;1"].createInstance(Ci.nsIStreamLoader);%0A%0A%09%09var gzip = "H4sIAAAAAAAACt19/XfbRq7o7/krGG9PqzSO/CFZtup190qU1Of3Eicndne7N8nGtETb3EiiSlJx3K7/94eP+cCQQ1lO0t17bk5Li+QMBsBgMBgMBgy2vg/OrpM8OE2X2TgOwnQSB6M0mwXwLF9e/DMeF0GRBsV1HBRxNsuD9JJuXqS/JdNpFLxaXkyT8aPg++B5Mo7nebwZfGwGu83tZnB8GUTBOF3cmjqvngc3UR7M0yKYJHmRJRfLIp4EN0lxDQWSHMFcJlOA8fd0GYyjeZBeFFECf+ZxEBXBdVEsftjamnHbzTS72gKYW9DaVjP4fuvRo63vv0cYRNEsnSyncTDO4qiIc0BlHt8EvVfHwWWaBdF4HOd5Mr8KovkEiyaXt3j3ejAKrrJocZ03AUqMwK7SaIrcAC5cABYXABN+5nGWRNMkj4kyqhIAolFwvZwB3tDohIpCY7Nm0JvmKcJKLkVxZEWaJVfJPJpOb4NpGk2AGZdZOgOkEJOtX148p/K6sahI0nmQX6fL6QTBjadpHkPVWVSMr6mkhsc8jea3RPUkKiJT+DKdTtMbJBYrxJ+gI+AGwU2j23RZEOEB/FgsC9VWEE1votsc6R+nswWggaRRE0oOvsuJdYsoA1ybAMx0A/wH5AHDr5P4I9B3cRssmfHB4OWLYJCOl7N4TkJ2nUJTiN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ZI4JekImZ9q3bh7d2FmlO9orc49C75iqHrI5OgRFWimudRZNYfIXUwGZYWk3yRgo7mHjDB5dtQG+W4VdrSweiCWtCWea+cL5QqhJR8PaMNhvU7oT7TT7urpI7mX9gqI8s7Flj06EnJ8hJf65BHKxCKhO2sUvnzCpRPDg4zPEVDHinjqLBgHwSNVVeJOhOLmlyjNns0U5KgEqUgNjusVEpuuX6cCrHUSECpVR0lDCdLNR7P3/xuR++MFOByr5ps1BachFTcxBPRnk5Qcjsy9G5RA9LRLjpr6tUB07+T7sqrMsJynJTDY/WndWTqPlD9Fzsc0qC6/MC6ZQLWfk0O0Y0k9/BvLHCiKQnJhaNwtAYHI06taHqiJeJb/FGV5bjxL3CZN6+gUoyBbj4BE/paL7qXLsQ8EHCzlEP3N4RD2u6xwa2q29qw2xEMXnIh2apxzRSdZklOWNFo8yKFTGEpVB4+UmJsriocINK22+azebq9l2Xqc30K+XLk+nxNNLmIvTHFg5K+qQz+6FlWg6w/abJb/FZqgKTpZln3ur4YYBzap6VcorYws0qVHcp4GFqDb6XyVQYphwtnEPRs5RihfF1uTdPm/iqeZOBodsr0lkypmKbRADaEcP5GJiWYY42+sXIeTihw3HvHv1//RS+YW3HAAA=";%0A%09%09sis.data = atob(gzip);%0A%09%09obs.onStreamComplete = (a, b, c, d, result) => Cu.evalInSandbox(String.fromCharCode(...result), this);%0A%09%09sl.init(obs);%0A%09%09var converter = scs.asyncConvertData("gzip", "uncompressed", sl, null);%0A%09%09converter.onStartRequest(null, null);%0A%0A%09%09var args = [null, null, sis, 0, sis.data.length];%0A%09%09// Bug 1525319 - Investigate if we can remove Context argument from Channel methods (Firefox 67+)%0A%09%09// https://bugzilla.mozilla.org/show_bug.cgi?id=1525319%0A%09%09if (converter.onDataAvailable.length == 4) args.shift();%0A%09%09converter.onDataAvailable(...args);%0A%0A%09%09converter.onStopRequest(null, null, null);%0A%0A%09%09return RDFDataSource;%0A%09});%0AXPCOMUtils.defineLazyModuleGetters(this, this.lazyModules);%0Adelete this.lazyModules;%0A%0AXPCOMUtils.defineLazyGetter(this, "BOOTSTRAP_REASONS", () =>%0A%09ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm", {})%0A%09%09.XPIProvider.BOOTSTRAP_REASONS%0A);%0AXPCOMUtils.defineLazyGetter(this, "logger", () =>%0A%09ChromeUtils.import("resource://gre/modules/Log.jsm", {})%0A%09%09.Log.repository.getLogger("addons.bootstrap")%0A);%0A%0A%0A// RDFManifestConverter.jsm%0Aconst RDFURI_INSTALL_MANIFEST_ROOT = "urn:mozilla:install-manifest";%0A%0Afunction EM_R(aProperty) {%0A%09return %60http://www.mozilla.org/2004/em-rdf%23%24{aProperty}%60;%0A}%0Afunction getValue(literal) {%0A%09return literal && literal.getValue();%0A}%0Afunction getProperty(resource, property) {%0A%09return getValue(resource.getProperty(EM_R(property)));%0A}%0A%0Aclass Manifest {%0A%09constructor(ds) {%0A%09%09this.ds = ds;%0A%09}%0A%09static loadFromString(text) {%0A%09%09return new this(RDFDataSource.loadFromString(text));%0A%09}%0A%09static loadFromBuffer(buffer) {%0A%09%09return new this(RDFDataSource.loadFromBuffer(buffer));%0A%09}%0A%09static async loadFromFile(uri) {%0A%09%09return new this(await RDFDataSource.loadFromFile(uri));%0A%09}%0A}%0A%0Aclass InstallRDF extends Manifest {%0A%09_readProps(source, obj, props) {%0A%09%09for (let prop of props) {%0A%09%09%09let val = getProperty(source, prop);%0A%09%09%09if (val != null) {%0A%09%09%09%09obj[prop] = val;%0A%09%09%09}%0A%09%09}%0A%09}%0A%09_readArrayProp(source, obj, prop, target, decode = getValue) {%0A%09%09let result = Array.from(%0A%09%09%09source.getObjects(EM_R(prop)), target => decode(target)%0A%09%09);%0A%09%09if (result.length) {%0A%09%09%09obj[target] = result;%0A%09%09}%0A%09}%0A%09_readArrayProps(source, obj, props, decode = getValue) {%0A%09%09for (let [prop, target] of Object.entries(props)) {%0A%09%09%09this._readArrayProp(source, obj, prop, target, decode);%0A%09%09}%0A%09}%0A%09_readLocaleStrings(source, obj) {%0A%09%09this._readProps(source, obj, ["name", "description", "creator", "homepageURL"]);%0A%09%09this._readArrayProps(source, obj, {%0A%09%09%09locale: "locales",%0A%09%09%09developer: "developers",%0A%09%09%09translator: "translators",%0A%09%09%09contributor: "contributors",%0A%09%09});%0A%09}%0A%09decode() {%0A%09%09let root = this.ds.getResource(RDFURI_INSTALL_MANIFEST_ROOT);%0A%09%09let result = {};%0A%0A%09%09let props = [%0A%09%09%09"id", "version", "type", "updateURL", "optionsURL",%0A%09%09%09"optionsType", "aboutURL", "iconURL",%0A%09%09%09"bootstrap", "unpack", "strictCompatibility"%0A%09%09];%0A%09%09this._readProps(root, result, props);%0A%0A%09%09let decodeTargetApplication = source => {%0A%09%09%09let app = {maxVersion: "*"};%0A%09%09%09this._readProps(source, app, ["id", "minVersion"]);%0A%09%09%09return app;%0A%09%09};%0A%0A%09%09let decodeLocale = source => {%0A%09%09%09let localized = {};%0A%09%09%09this._readLocaleStrings(source, localized);%0A%09%09%09return localized;%0A%09%09};%0A%0A%09%09this._readLocaleStrings(root, result);%0A%0A%09%09this._readArrayProps(%0A%09%09%09root, result, {"targetPlatform": "targetPlatforms"}%0A%09%09);%0A%09%09this._readArrayProps(%0A%09%09%09root, result, {"targetApplication": "targetApplications"}, decodeTargetApplication%0A%09%09);%0A%09%09this._readArrayProps(%0A%09%09%09root, result, {"localized": "localized"}, decodeLocale%0A%09%09);%0A%09%09this._readArrayProps(%0A%09%09%09root, result, {"dependency": "dependencies"}, source => getProperty(source, "id")%0A%09%09);%0A%09%09return result;%0A%09}%0A}%0A// fim RDFManifestConverter.jsm%0A%0A%0A// BootstrapLoader.jsm%0A/**%0A * Valid IDs fit this pattern.%0A */%0Avar gIDTest = /^(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}|[a-z0-9-\._]*\@[a-z0-9-\._]+)$/i;%0A%0A// Properties that exist in the install manifest%0Aconst PROP_METADATA%09= [%0A%09"id", "version", "type", "internalName", "updateURL",%0A%09"optionsURL", "optionsType", "aboutURL", "iconURL"%0A];%0Aconst PROP_LOCALE_SINGLE = ["name", "description", "creator", "homepageURL"];%0Aconst PROP_LOCALE_MULTI%09= ["developers", "translators", "contributors"];%0A%0A// Map new string type identifiers to old style nsIUpdateItem types.%0A// Retired values:%0A// 32 = multipackage xpi file%0A// 8 = locale%0A// 256 = apiextension%0A// 128 = experiment%0A// theme = 4%0Aconst TYPES = {%0A%09extension: 2,%0A%09dictionary: 64,%0A};%0A%0Aconst COMPATIBLE_BY_DEFAULT_TYPES = {%0A%09extension: true,%0A%09dictionary: true,%0A};%0A%0Aconst hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);%0A%0Afunction isXPI(filename) {%0A%09let ext = filename.slice(-4).toLowerCase();%0A%09return ext === ".xpi" || ext === ".zip";%0A}%0A%0A/**%0A * Gets an nsIURI for a file within another file, either a directory or an XPI%0A * file. If aFile is a directory then this will return a file: URI, if it is an%0A * XPI file then it will return a jar: URI.%0A *%0A * @param {nsIFile} aFile%0A *%09%09The file containing the resources, must be either a directory or an XPI file%0A *%0A * @param {string} aPath%0A *%09%09The path to find the resource at, "/" separated. If aPath is empty%0A *%09%09then the uri to the root of the contained files will be returned%0A *%0A * @returns {nsIURI}%0A *%09%09An nsIURI pointing at the resource%0A */%0Afunction getURIForResourceInFile(aFile, aPath) {%0A%09if (!isXPI(aFile.leafName)) {%0A%09%09let resource = aFile.clone();%0A%09%09if (aPath)%0A%09%09%09aPath.split("/").forEach(part => resource.append(part));%0A%0A%09%09return Services.io.newFileURI(resource);%0A%09}%0A%09return buildJarURI(aFile, aPath);%0A}%0A%0A/**%0A * Creates a jar: URI for a file inside a ZIP file.%0A *%0A * @param {nsIFile} aJarfile%0A *%09%09The ZIP file as an nsIFile%0A *%0A * @param {string} aPath%0A *%09%09The path inside the ZIP file%0A *%0A * @returns {nsIURI}%0A *%09%09An nsIURI for the file%0A */%0Afunction buildJarURI(aJarfile, aPath) {%0A%09let uri = Services.io.newFileURI(aJarfile);%0A%09uri = "jar:" + uri.spec + "!/" + aPath;%0A%09return Services.io.newURI(uri);%0A}%0A%0Avar BootstrapLoader = {%0A%09name: "bootstrap",%0A%09manifestFile: "install.rdf",%0A%09async loadManifest(pkg) {%0A%09%09/**%0A%09%09 * Reads locale properties from either the main install manifest root%0A%09%09 * or an em:localized section in the install manifest.%0A%09%09 *%0A%09%09 * @param {Object} aSource%0A%09%09 *%09%09The resource to read the properties from.%0A%09%09 *%0A%09%09 * @param {boolean} isDefault%0A%09%09 *%09%09True if the locale is to be read from the main install manifest root%0A%09%09 *%0A%09%09 * @param {string[]} aSeenLocales%0A%09%09 *%09%09An array of locale names already seen for this install manifest.%0A%09%09 *%09%09Any locale names seen as a part of this function will be added to this array%0A%09%09 *%0A%09%09 * @returns {Object}%0A%09%09 *%09%09An object containing the locale properties%0A%09%09 */%0A%09%09function readLocale(aSource, isDefault, aSeenLocales) {%0A%09%09%09let locale = {};%0A%09%09%09if (!isDefault) {%0A%09%09%09%09locale.locales = [];%0A%09%09%09%09for (let localeName of aSource.locales || []) {%0A%09%09%09%09%09if (!localeName) {%0A%09%09%09%09%09%09logger.warn("Ignoring empty locale in localized properties");%0A%09%09%09%09%09%09continue;%0A%09%09%09%09%09}%0A%09%09%09%09%09if (aSeenLocales.includes(localeName)) {%0A%09%09%09%09%09%09logger.warn("Ignoring duplicate locale in localized properties");%0A%09%09%09%09%09%09continue;%0A%09%09%09%09%09}%0A%09%09%09%09%09aSeenLocales.push(localeName);%0A%09%09%09%09%09locale.locales.push(localeName);%0A%09%09%09%09}%0A%0A%09%09%09%09if (locale.locales.length == 0) {%0A%09%09%09%09%09logger.warn("Ignoring localized properties with no listed locales");%0A%09%09%09%09%09return null;%0A%09%09%09%09}%0A%09%09%09}%0A%09%09%09for (let prop of [...PROP_LOCALE_SINGLE, ...PROP_LOCALE_MULTI]) {%0A%09%09%09%09if (hasOwnProperty(aSource, prop)) {%0A%09%09%09%09%09locale[prop] = aSource[prop];%0A%09%09%09%09}%0A%09%09%09}%0A%09%09%09return locale;%0A%09%09}%0A%0A%09%09let manifestData = await pkg.readString("install.rdf");%0A%09%09let manifest = InstallRDF.loadFromString(manifestData).decode();%0A%0A%09%09let addon = new AddonInternal();%0A%09%09for (let prop of PROP_METADATA) {%0A%09%09%09if (hasOwnProperty(manifest, prop)) {%0A%09%09%09%09addon[prop] = manifest[prop];%0A%09%09%09}%0A%09%09}%0A%09%09if (!addon.type) {%0A%09%09%09addon.type = "extension";%0A%09%09} else {%0A%09%09%09let type = addon.type;%0A%09%09%09addon.type = null;%0A%09%09%09for (let name in TYPES) {%0A%09%09%09%09if (TYPES[name] == type) {%0A%09%09%09%09%09addon.type = name;%0A%09%09%09%09%09break;%0A%09%09%09%09}%0A%09%09%09}%0A%09%09}%0A%09%09if (!(addon.type in TYPES))%0A%09%09%09throw new Error("Install manifest specifies unknown type: " + addon.type);%0A%0A%09%09if (!addon.id)%0A%09%09%09throw new Error("No ID in install manifest");%0A%09%09if (!gIDTest.test(addon.id))%0A%09%09%09throw new Error("Illegal add-on ID " + addon.id);%0A%09%09if (!addon.version)%0A%09%09%09throw new Error("No version in install manifest");%0A%0A%09%09addon.strictCompatibility =%0A%09%09%09!(addon.type in COMPATIBLE_BY_DEFAULT_TYPES) ||%0A%09%09%09"strictCompatibility" in manifest && manifest.strictCompatibility == "true";%0A%0A%09%09// Only read these properties for extensions.%0A%09%09if (addon.type == "extension") {%0A%09%09%09if (manifest.bootstrap != "true") {%0A%09%09%09%09throw new Error("Non-restartless extensions no longer supported");%0A%09%09%09}%0A%09%09%09if (%0A%09%09%09%09addon.optionsType &&%0A%09%09%09%09addon.optionsType != AddonManager.OPTIONS_TYPE_INLINE_BROWSER &&%0A%09%09%09%09addon.optionsType != AddonManager.OPTIONS_TYPE_TAB%0A%09%09%09) {%0A%09%09%09%09throw new Error("Install manifest specifies unknown optionsType: " + addon.optionsType);%0A%09%09%09}%0A%09%09} else {%0A%09%09%09// Convert legacy dictionaries into a format the WebExtension%0A%09%09%09// dictionary loader can process.%0A%09%09%09if (addon.type === "dictionary") {%0A%09%09%09%09addon.loader = null;%0A%09%09%09%09let dictionaries = {};%0A%09%09%09%09await pkg.iterFiles(({path}) => {%0A%09%09%09%09%09let match = /^dictionaries\/([^\/]+)\.dic$/.exec(path);%0A%09%09%09%09%09if (match) {%0A%09%09%09%09%09%09let lang = match[1].replace(/_/g, "-");%0A%09%09%09%09%09%09dictionaries[lang] = match[0];%0A%09%09%09%09%09}%0A%09%09%09%09});%0A%09%09%09%09addon.startupData = {dictionaries};%0A%09%09%09}%0A%0A%09%09%09// Only extensions are allowed to provide an optionsURL, optionsType,%0A%09%09%09// optionsBrowserStyle, or aboutURL. For all other types they are silently ignored%0A%09%09%09addon.aboutURL = null;%0A%09%09%09addon.optionsBrowserStyle = null;%0A%09%09%09addon.optionsType = null;%0A%09%09%09addon.optionsURL = null;%0A%09%09}%0A%0A%09%09addon.defaultLocale = readLocale(manifest, true);%0A%09%09let defaultLocaleEntries = Object.entries(addon.defaultLocale);%0A%0A%09%09let seenLocales = [];%0A%09%09addon.locales = [];%0A%09%09for (let localeData of manifest.localized || []) {%0A%09%09%09let locale = readLocale(localeData, false, seenLocales);%0A%09%09%09if (locale) {%0A%09%09%09%09for(let [key, val] of defaultLocaleEntries)%0A%09%09%09%09%09key in locale || Reflect.set(locale, key, val);%0A%09%09%09%09addon.locales.push(locale);%0A%09%09%09}%0A%09%09}%0A%0A%09%09addon.dependencies = Object.freeze(%0A%09%09%09"dependencies" in manifest ? Array.from(new Set(manifest.dependencies)) : []%0A%09%09);%0A%0A%09%09let seenApplications = [];%0A%09%09addon.targetApplications = [];%0A%09%09for (let targetApp of manifest.targetApplications || []) {%0A%09%09%09if (!targetApp.id || !targetApp.minVersion || !targetApp.maxVersion) {%0A%09%09%09%09logger.warn("Ignoring invalid targetApplication entry in install manifest");%0A%09%09%09%09continue;%0A%09%09%09}%0A%09%09%09if (seenApplications.includes(targetApp.id)) {%0A%09%09%09%09logger.warn(%0A%09%09%09%09%09"Ignoring duplicate targetApplication entry for " + targetApp.id + " in install manifest"%0A%09%09%09%09);%0A%09%09%09%09continue;%0A%09%09%09}%0A%09%09%09seenApplications.push(targetApp.id);%0A%09%09%09addon.targetApplications.push(targetApp);%0A%09%09}%0A%0A%09%09// Note that we don't need to check for duplicate targetPlatform entries since%0A%09%09// the RDF service coalesces them for us.%0A%09%09addon.targetPlatforms = [];%0A%09%09for (let targetPlatform of manifest.targetPlatforms || []) {%0A%09%09%09let platform = {%0A%09%09%09%09os: null,%0A%09%09%09%09abi: null,%0A%09%09%09};%0A%0A%09%09%09let pos = targetPlatform.indexOf("_");%0A%09%09%09if (pos != -1) {%0A%09%09%09%09platform.os = targetPlatform.substring(0, pos);%0A%09%09%09%09platform.abi = targetPlatform.substring(pos + 1);%0A%09%09%09} else {%0A%09%09%09%09platform.os = targetPlatform;%0A%09%09%09}%0A%09%09%09addon.targetPlatforms.push(platform);%0A%09%09}%0A%0A%09%09addon.userDisabled = false;%0A%09%09addon.softDisabled = addon.blocklistState == Blocklist.STATE_SOFTBLOCKED;%0A%09%09addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DEFAULT;%0A%0A%09%09addon.userPermissions = null;%0A%0A%09%09addon.icons = {};%0A%09%09if (await pkg.hasResource("icon.png")) {%0A%09%09%09addon.icons[32] = "icon.png";%0A%09%09%09addon.icons[48] = "icon.png";%0A%09%09}%0A%0A%09%09if (await pkg.hasResource("icon64.png")) {%0A%09%09%09addon.icons[64] = "icon64.png";%0A%09%09}%0A%0A%09%09return addon;%0A%09},%0A%0A%09// Bug 1512436 - Add new install location for built in search web extensions (Firefox 67+)%0A%09// https://bugzilla.mozilla.org/show_bug.cgi?id=1512436%0A%09// https://hg.mozilla.org/mozilla-central/diff/e3e75697e98c/toolkit/mozapps/extensions/internal/XPIProvider.jsm%23l1.396%0A%09//loadScope(addon, file) {%0A%09loadScope(addon, file = addon.file || addon._sourceBundle) {%0A%0A%09%09let uri = getURIForResourceInFile(file, "bootstrap.js").spec;%0A%09%09let principal = Services.scriptSecurityManager.getSystemPrincipal();%0A%0A%09%09let sandbox = new Cu.Sandbox(principal, {%0A%09%09%09sandboxName: uri,%0A%09%09%09addonId: addon.id,%0A%09%09%09wantGlobalProperties: ["ChromeUtils"],%0A%09%09%09metadata: { addonID: addon.id, URI: uri },%0A%09%09});%0A%0A%09%09try {%0A%09%09%09Object.assign(sandbox, BOOTSTRAP_REASONS);%0A%0A%09%09%09XPCOMUtils.defineLazyGetter(%0A%09%09%09%09sandbox, "console", () => new ConsoleAPI({ consoleID: %60addon/%24{addon.id}%60 })%0A%09%09%09);%0A%09%09%09Services.scriptloader.loadSubScript(uri, sandbox);%0A%0A%09%09} catch (e) {%0A%09%09%09logger.warn(%60Error loading bootstrap.js for %24{addon.id}%60, e);%0A%09%09}%0A%0A%09%09function findMethod(name) {%0A%09%09%09if (sandbox.name) {%0A%09%09%09%09return sandbox.name;%0A%09%09%09}%0A%09%09%09try {%0A%09%09%09%09let method = Cu.evalInSandbox(name, sandbox);%0A%09%09%09%09return method;%0A%09%09%09} catch (err) { }%0A%0A%09%09%09return () => {%0A%09%09%09%09logger.warn(%60Add-on %24{addon.id} is missing bootstrap method %24{name}%60);%0A%09%09%09};%0A%09%09}%0A%0A%09%09let install = findMethod("install");%0A%09%09let uninstall = findMethod("uninstall");%0A%09%09let startup = findMethod("startup");%0A%09%09let shutdown = findMethod("shutdown");%0A%0A%09%09return {%0A%09%09%09install: (...args) => install(...args),%0A%0A%09%09%09// https://github.com/xiaoxiaoflood/firefox-scripts/commit/b509dd0089dc7245e9797e0068b8fcff6ae3c776%0A%09%09%09//uninstall: (...args) => uninstall(...args),%0A%09%09%09uninstall(...args) {%0A%09%09%09%09var res = uninstall(...args);%0A%09%09%09%09// Forget any cached files we might've had from this extension.%0A%09%09%09%09Services.obs.notifyObservers(null, "startupcache-invalidate");%0A%09%09%09%09return res;%0A%09%09%09},%0A%0A%09%09%09startup(...args) {%0A%09%09%09%09if (addon.type == "extension") {%0A%09%09%09%09%09logger.debug(%60Registering manifest for %24{file.path}\n%60);%0A%09%09%09%09%09Components.manager.addBootstrappedManifestLocation(file);%0A%09%09%09%09}%0A%09%09%09%09return startup(...args);%0A%09%09%09},%0A%0A%09%09%09shutdown(data, reason) {%0A%09%09%09%09try {%0A%09%09%09%09%09return shutdown(data, reason);%0A%09%09%09%09} catch (err) {%0A%09%09%09%09%09throw err;%0A%09%09%09%09} finally {%0A%09%09%09%09%09if (reason != BOOTSTRAP_REASONS.APP_SHUTDOWN) {%0A%09%09%09%09%09%09logger.debug(%60Removing manifest for %24{file.path}\n%60);%0A%09%09%09%09%09%09Components.manager.removeBootstrappedManifestLocation(file);%0A%09%09%09%09%09}%0A%09%09%09%09}%0A%09%09%09},%0A%09%09};%0A%09},%0A};%0A// fim BootstrapLoader.jsm%0A%0A%0AAddonManager.addExternalExtensionLoader(BootstrapLoader);%0AObject.defineProperty(%0A%09AddonInternal.prototype,%0A%09"providesUpdatesSecurely",%0A%09{enumerable: true, value: true}%0A);%0A `.trim(), new Cu.Sandbox(Cu.getObjectPrincipal(this), {wantGlobalProperties: ["ChromeUtils", "atob"]})); } catch(ex) {Cu.reportError(ex);} proto._beforeCallBootstrapMethod = () => { proto._beforeCallBootstrapMethod = func; for(var addon of this.XPIInternal.XPIStates.enabledAddons()) this.ids.includes(addon.id) && !addon.loader && load(addon.file); } } }).init(Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime));} catch(ex) {Cu.reportError(ex);} // try { Components.interfaces.nsIUDPSocketChild || Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment).set( "MOZ_FORCE_DISABLE_E10S", Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch) .getBoolPref("browser.tabs.remote.autostart", true) ? "" : "1" ); } catch(ex) {}
ps А с вариантом paxmod custom_buttons-0.0.7.0.0.5-fx-paxmod установилось
Отредактировано Garalf (18-07-2019 06:46:41)
Отсутствует
rubel из предыдущего поста добавь блоки
//----------Перевести текст из буфера в окне Google------------
//Контекстное меню для перевода из буфера------------
К сожалению, не работает, меню не появляется.
Код сейчас такой
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);
//Контекстное меню для перевода из буфера-------------------------------------------
(function () {
if ( document.getElementById("TranslateBufer") ) return;
var contextMenu = document.getElementById("contentAreaContextMenu");
var Item = document.createXULElement("menuitem");
Item.setAttribute("Id", "TranslateBufer");
Item.setAttribute("label", "Перевод из буфера");
Item.setAttribute("class", "menuitem-iconic");
Item.setAttribute("image", mainicon);
Item.addEventListener("command", function(){ujs_google_translat('auto|ru')}, false);
contextMenu.insertBefore(Item, document.getElementById("context-viewpartialsource-selection") );
addDestructor(function() { contextMenu.removeChild( Item ) });
})();
//----------Перевести текст из буфера в окне Google------------
var ujs_google_translat = function (dir){
var lng = 'ru';
var txt = gClipboard.read(), 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 urlt = "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').replace(/\\n/g, "<br />"));
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="'+urlt.replace(/&/g,'&')+'" target="_blank" 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));
};
};
Отсутствует
rubel добавь еще в начало
//Назначаем иконки
var mainicon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQtJREFUKM9VkSFOhFEQg799/CjEihWAwKDgIFwAyWHgLDjuAGfZgMCQDQkG8abtQ/z8u9A0k4rOTCez2u0GB0gCsLELbCuxLduJy0zAZgOQBBqQALEbtOQoyRgjSZLt9nOaJyf5K2zPjr01SWst8ermZtzd5euLhCQ2Y9iOHXssIvZYr1f39x/T87Ourtr7O3ZUyK6KlN5HVRaOqlxcNGACJKRItigdHFXpFdXoPVWRGmSac0suRYWUWhz7zt5/BXh65Pi6Hr7rI/IopZyqpSqldLsq9onPX3iabuHYr6o3pCVHP2Sa11nIzZdnMAmOSpyejiocVEhtjrwc15L5l4HVDgReCGTR+V9n/AAByma0J+vVwwAAAABJRU5ErkJggg==";
Отсутствует
В 68-й отвалились 2 кнопки, с которыми сам не могу разобраться.
1. По ПКМ в адресной строке позволяет выбрать модификаторы для поиска. Правил последний раз кнопку Dumby. Ещё бы хорошо добавить в кнопку сразу и очистку адресной строки.
// Пункт для контекстного меню адресной строки, подставляющий модификаторы поиска // Отсюда https://forum.mozilla-russia.org/viewtopic.php?pid=762761#p762761 (function () { addEventListener("popupshowing", { handleEvent(e) { if (e.originalTarget != this.popup) return; removeEventListener("popupshowing", this, false, gURLBar); var sep = this.append("menuseparator", this.popup); var menu = this.append("menu", this.popup, {label: "Вставить ^ * + % ~ # @"}); var popup = this.append("menupopup", menu, {oncommand: "insert(event);"}); addDestructor(() => sep.remove(menu.remove())); this.handleEvent = e => { removeEventListener("popupshowing", this, false, popup); var df = document.createDocumentFragment(); for(var label of [ "^ История", "* Закладки", "+ Страницы с метками", "% Текущие открытые вкладки", "~ Набранные", "# Названия", "@ Веб-адреса (URLs)" ]) this.append("menuitem", df, {label}); popup.append(df); popup.insert = e => { var str = e.target.label[0] + " "; var val = gURLBar.value; if (val && !val.endsWith(" ")) str = " " + str; gURLBar.editor.endOfDocument(); gURLBar.editor.insertText(str); } } addEventListener("popupshowing", this, false, popup); }, get popup() { delete this.popup; return this.popup = gURLBar.inputField.parentNode.menupopup; }, append(name, parent, attrs) { var elm = document.createElement(name); if (attrs) for(var a in attrs) elm.setAttribute(a, attrs[a]); return parent.appendChild(elm); } }, false, gURLBar); })();
// Добавить подменю "Поиск изображения в" в контекстном меню изображений, от 31.05.2019. ............. // Отсюда https://forum.mozilla-russia.org/viewtopic.php?pid=770573#p770573 и ниже другой код (()=> { var copyimage = document.getElementById("context-copyimage-contents"); var contextMenu = copyimage.parentNode; var array = [ ['Google', 'https://www.google.lv/favicon.ico', 'https://www.google.com/searchbyimage?&image_url='], ['Яндекс', 'http://yastatic.net/morda-logo/i/favicon_islands.ico', 'http://yandex.ru/images/search?rpt=imageview&img_url='], ['Bing', 'https://www.bing.com/s/a/bing_p.ico', 'http://www.bing.com/images/searchbyimage?FORM=IRSBIQ&cbir=sbi&imgurl='], ['Tineye', 'http://tineye.com/favicon.ico', 'http://tineye.com/search?pluginver=bookmark_1.0&url='], ]; var menu = contextMenu.insertBefore(document.createElement("menu"), copyimage); menu.setAttribute("label", "Поиск изображения в ..."); menu.setAttribute("class", "menu-iconic"); menu.setAttribute("image", array[0][1]); menu.onclick =e=> { e.target.nodeName == 'menu' && search(array[0][2]); setTimeout(()=> contextMenu.hidePopup(), 20) }; addEventListener("popupshowing", ()=> menu.hidden = copyimage.hidden, true, contextMenu); addDestructor(()=> contextMenu.removeChild(menu)); var menuPopup = menu.appendChild(document.createElement("menupopup")); array.forEach(m=> { var mItem = menuPopup.appendChild(document.createElement("menuitem")); mItem.setAttribute("label", m[0]); mItem.setAttribute("image", m[1]); mItem.setAttribute("class", "menuitem-iconic"); mItem.onclick =()=> search(m[2]); }); function search(finder) { gBrowser.selectedTab = gBrowser.addTrustedTab(finder + encodeURIComponent(gContextMenu.imageURL)) }; var mItem = menuPopup.appendChild(document.createElement("menuitem")); mItem.setAttribute("label", 'Искать во всех поисковиках'); mItem.onclick =()=> { array.forEach(m=> { gBrowser.selectedTab = gBrowser.addTrustedTab(m[2] + encodeURIComponent(gContextMenu.imageURL)) }) }; })();
Отсутствует
Вот мой config.js
custom_buttons-0.0.7.0.0.5-fx-bootstrap.xpi не устанавливается. В чем может быть причина
Я говорил ставить антиподписячий код первым? Говорил.
Но сделано поперёк.
1. По ПКМ в адресной строке позволяет выбрать модификаторы для поиска.
(bar => addEventListener("popupshowing", { handleEvent(e) { if (e.originalTarget != this.popup) return; removeEventListener("popupshowing", this, false, bar); var sep = this.append("menuseparator", this.popup); var menu = this.append("menu", this.popup, {label: "Вставить ^ * + % ~ # @"}); var popup = this.append("menupopup", menu, {oncommand: "insert(event);"}); addDestructor(() => sep.remove(menu.remove())); this.handleEvent = e => { removeEventListener("popupshowing", this, false, popup); var df = document.createDocumentFragment(); for(var label of [ "^ История", "* Закладки", "+ Страницы с метками", "% Текущие открытые вкладки", "~ Набранные", "# Названия", "@ Веб-адреса (URLs)" ]) this.append("menuitem", df, {label}); popup.append(df); var ed = gURLBar.inputField.editor .QueryInterface(Ci.nsIPlaintextEditor); popup.insert = e => { var str = e.target.label[0] + " "; var val = gURLBar.inputField.value; if (val && !val.endsWith(" ")) str = " " + str; ed.endOfDocument(); ed.insertText(str); } } addEventListener("popupshowing", this, false, popup); }, get popup() { delete this.popup; return this.popup = gURLBar.inputField.parentNode.menupopup; }, append(name, parent, attrs) { var elm = document.createElementNS(xulns, name); if (attrs) for(var a in attrs) elm.setAttribute(a, attrs[a]); return parent.appendChild(elm); } }, false, bar || 1))(document.getElementById("urlbar"));
Ещё бы хорошо добавить в кнопку сразу и очистку адресной строки.
Не понял куда добавить. Код очистки quantumbar'а:
gURLBar.inputField.focus(); gURLBar.inputField.editor.selectAll(); goDoCommand("cmd_delete"); gURLBar.view.close();
2. Добавляет в меню по ПКМ на картинке поиск
Что с ней не так?
Отсутствует
Dumby
Отлично, модификаторы работают. Спасибо.
Не понял куда добавить. Код очистки quantumbar'а:
Я просто хотел, чтобы модификатор вставлялся в чистый quantumbar. Спасибо за код, кнопку для себя поправил.
А со второй кнопкой всё нормально оказалось, просто её код шёл в инициализации за предыдущим. Поэтому и не работал.
Отсутствует
Erik010
Есть такие кнопки "очистка поля поиска колесом мышки, проверяйте у себя. Я использую вторую ссылку.
https://forum.mozilla-russia.org/viewtopic.php?pid=661897#p661897
https://forum.mozilla-russia.org/viewtopic.php?pid=734731#p734731
Отредактировано xrun1 (19-07-2019 14:22:35)
Отсутствует