greatest_nooby
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Создать новую кнопку или добавить в существующую: Инициализация: Код: (()=> { var contMenu = document.getElementById("contentAreaContextMenu"); var addMenufragm = document.createDocumentFragment('menupopup'); (contextMenu => { var menuGl = contextMenu.appendChild(document.createElement("menuitem")); menuGl.id = "content-googlel."; menuGl.setAttribute("label", "Посмотреть ссылку через кэш Google"); menuGl.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://webcache.googleusercontent.com/search?q=cache:" + encodeURIComponent(normlink(gContextMenu.linkURI.spec))); var menuAl = contextMenu.appendChild(document.createElement("menuitem")); menuAl.id = "content-archivel."; menuAl.setAttribute("label", "Посмотреть ссылку через Archive.org"); menuAl.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://web.archive.org/web/" + normlink(gContextMenu.linkURI.spec)); var menuW = contextMenu.appendChild(document.createElement("menuitem")); menuW.id = "content-wot." menuW.setAttribute("label", "Посмотреть отзывы о сайте в WOT"); menuW.onclick = () => gBrowser.selectedTab = gBrowser.addTab("https://www.mywot.com/ru/scorecard/" + normDom()); var menuG = contextMenu.appendChild(document.createElement("menuitem")); menuG.id = "content-google."; menuG.setAttribute("label", "Посмотреть страницу в кэше Google"); menuG.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://webcache.googleusercontent.com/search?q=cache:" + encodeURIComponent(normlink(gBrowser.currentURI.spec))); var menuA = contextMenu.appendChild(document.createElement("menuitem")); menuA.id = "content-archive."; menuA.setAttribute("label", "Посмотреть страницу в Archive.org"); menuA.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://web.archive.org/web/" + normlink(gBrowser.currentURI.spec)); var menuM = contextMenu.appendChild(document.createElement("menu")); menuM.id = "content-addmenu."; menuM.setAttribute("label", "Дополнительно ..."); var menuAddPopup = menuM.appendChild(document.createElement("menupopup")); var contextViewsource = document.getElementById("context-viewsource"); var contextViewsource2 = menuAddPopup.appendChild(contextViewsource.cloneNode(true)); contextViewsource2.id = "context-viewsource2."; contextViewsource2.hidden = false; var menuitem1 = menuAddPopup.appendChild(document.createElement("menuitem")); menuitem1.setAttribute("label", "Узнать, кому принадлежит домен через Domaintools"); menuitem1.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://whois.domaintools.com/" + normDom()); var menuitem2 = menuAddPopup.appendChild(document.createElement("menuitem")); menuitem2.setAttribute("label", "Узнать, кому принадлежит домен через Reg.ru"); menuitem2.onclick = () => gBrowser.selectedTab = gBrowser.addTab("https://www.reg.ru/whois/?dname=" + normDom()); var menuitem5 = menuAddPopup.appendChild(document.createElement("menuitem")); menuitem5.setAttribute("label", "Поискать сохраненную копию страницы на Bing.com"); menuitem5.onclick = () => gBrowser.selectedTab = gBrowser.addTab("https://www.bing.com/search?q=" + encodeURIComponent(normlink(gBrowser.currentURI.spec))); var menuitem3 = menuAddPopup.appendChild(document.createElement("menuitem")); menuitem3.setAttribute("label", "Поискать сохраненную копию страницы на Yandex"); menuitem3.onclick = () => gBrowser.selectedTab = gBrowser.addTab("https://yandex.ru/search/?text=" + encodeURIComponent(normlink(gBrowser.currentURI.spec))); var menuitem4 = menuAddPopup.appendChild(document.createElement("menuitem")); menuitem4.setAttribute("label", "Проверить доступность сайта через isitdownrightnow"); menuitem4.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://www.isitdownrightnow.com/downorjustme.php?url=" + normDom()); var menuitem6 = menuAddPopup.appendChild(document.createElement("menuitem")); menuitem6.setAttribute("label", "Проверить доступность через downforeveryoneorjustme"); menuitem6.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://downforeveryoneorjustme.com/" + normDom()); var menuitem7 = menuAddPopup.appendChild(document.createElement("menuitem")); menuitem7.setAttribute("label", "Информация о сервере (netcraft)"); menuitem7.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://toolbar.netcraft.com/site_report?url=" + normDom()); var menu8 = menuAddPopup.appendChild(document.createElement("menuitem")); menu8.id = "content-bugmen."; menu8.setAttribute("label", "Поискать логины к сайту на BugMeNot.com"); menu8.onclick = () => gBrowser.selectedTab = gBrowser.addTab("http://bugmenot.com/view/" + normDom()); // Удалить куки текущего сайта в контекстном меню на странице, от 04.02.2017. ................bunda1 var menu = contextMenu.appendChild(document.createElement("menu")); menu.id = "content-removeCookies."; menu.setAttribute("label", "Удалить куки текущего сайта"); var menuPopup = menu.appendChild(document.createElement("menupopup")); var menuitem = menuPopup.appendChild(document.createElement("menuitem")); menuitem.setAttribute("label", "Удалить (так же будут удалены все Flash-куки)"); menuitem.onclick =()=> { var host = Services.eTLD.getBaseDomain(gBrowser.currentURI); for ( var en = Services.cookies.enumerator; en.hasMoreElements(); ) { var cookie = en.getNext().QueryInterface(Ci.nsICookie); ~cookie.host.indexOf(host.trim()) && Services.cookies.remove(cookie.host, cookie.name, cookie.path, false); } var reversedDomain = host.split("").reverse().join("") + "."; Cu.import("resource://gre/modules/FileUtils.jsm"); var file = FileUtils.getFile("ProfD", ["webappsstore.sqlite"]); var dbConn = Services.storage.openDatabase(file); dbConn.executeSimpleSQL("DELETE FROM webappsstore2 WHERE scope LIKE \"%" + reversedDomain +"%\""); dbConn.close(); //удалить и все Flash куки. закомпанию. var dir = Services.dirsvc.get('Home', Ci.nsIFile); dir.append("Application Data"); dir.append("Macromedia"); dir.remove(true); dir.create(Ci.nsIFile.DIRECTORY_TYPE, 0777); }; contMenu.addEventListener("popupshowing", () => { contextViewsource.hidden = gBrowser.currentURI.scheme.startsWith("http") || gContextMenu.onLink; menu.hidden = menuW.hidden = menuM.hidden = pophiddP(); menuA.hidden = menu.hidden || onWArch(gBrowser.currentURI.spec); menuG.hidden = menu.hidden || onGCahe(gBrowser.currentURI.spec); menuGl.hidden = !gContextMenu.linkURI || !gContextMenu.linkURI.scheme.startsWith("http"); menuAl.hidden = menuGl.hidden || onWArch(gContextMenu.linkURI.spec); }, false); addDestructor(() => {menuW.remove();menuG.remove();menuA.remove();menuGl.remove();menuAl.remove();menuM.remove();menu.remove()}); })(addMenufragm); contMenu.insertBefore(addMenufragm, contMenu.lastChild); var onGCahe = function(link) { if((link.startsWith('https://webcache.googleusercontent.com/search?q=cache:') || link.startsWith('http://webcache.googleusercontent.com/search?q=cache:') || link.startsWith('http://www.google.com/search?q=cache:') || link.startsWith('https://www.google.com/search?q=cache:')) && link.indexOf(':http') > 0)return true; return false; }; var Glink = function(link) { return decodeURIComponent(link.substring(link.indexOf(':http')+1).split('+&')[0].split('&')[0]); }; var onWArch = function(link) { if((link.startsWith('http://web.archive.org/web/') || link.startsWith('https://web.archive.org/web/')) && link.indexOf('/http') > 0)return true; return false; }; var Wlink = function(link) { return link.substring(link.indexOf('://web.archive.org/web/')+23).match(/\/(https?:\/\/\S+)/)[1]; }; var normlink = function(link) { if(onGCahe(link))return Glink(link); if(onWArch(link))return Wlink(link); return link; }; var normDom = function() { let urispec = gBrowser.currentURI.spec; let dom = ''; if(onGCahe(urispec)) dom = Glink(urispec); if(onWArch(urispec)) dom = Wlink(urispec); if(dom)return dom.replace(/^https?:\/\//,'').split('/')[0].split('?')[0].split('#')[0]; return content.location.hostname; }; var pophiddP = function() { if(!gBrowser.currentURI.scheme.startsWith("http") || gContextMenu.onVideo || gContextMenu.isContentSelected || gContextMenu.onLink || gContextMenu.onTextInput)return true; return false; }; })(); |
|