diff --git a/README.md b/README.md index 4bf8efa..a8e09ab 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ Hit back and try another one! * Accessible: * In the context (right-click) menu for the current page, and for all links. - * In the toolbar, just customize it to drag the button in. - * With the keyboard: press `Ctrl-Shift-U` - * Directly in the net error ("Firefox could not load this page...") page. # Changelog + * Version 4 (Aug 19, 2017) + * completely rewritten as WebExtension + * Not everything from the old version ported over yet * Version 3 (Sep 9, 2015) * Fix layout on error page w.r.t. the "report error" dialog. * Add keyboard accessibility for cache retrieval buttons. diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 0000000..79bab1a --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,72 @@ +{ + "extensionName": { + "message": "Resurrect Pages", + "description": "Name of the extension." + }, + + "extensionDescription": { + "message": "Resurrect dead pages, by finding their ghosts.", + "description": "Description of the add-on." + }, + + "contextMenuItemResurrectPage": { + "message": "Resurrect this page", + "description": "Resurrect this page" + }, + + "contextMenuItemResurrectLink": { + "message": "Resurrect this link", + "description": "Resurrect this link" + }, + + "contextMenuItemResurrectSelection": { + "message": "Resurrect this selection", + "description": "Resurrect this selection, TODO: only if its a link" + }, + + "contextMenuItemResurrectGoogle": { + "message": "with Google", + "description": "with Google" + }, + + "contextMenuItemResurrectGoogleText": { + "message": "with Google (text only)", + "description": "with Google (text only)" + }, + + "contextMenuItemResurrectArchive": { + "message": "with The Internet Archive", + "description": "with The Internet Archive" + }, + + "contextMenuItemResurrectArchiveIs": { + "message": "with archive.is", + "description": "with archive.is" + }, + + "contextMenuItemResurrectWebcitation": { + "message": "with WebCite", + "description": "with WebCite" + }, + + "contextMenuItemResurrectConfigCurrentTab": { + "message": "in the current tab", + "description": "in the current tab" + }, + + "contextMenuItemResurrectConfigNewTab": { + "message": "in a new tab (foreground)", + "description": "in a new tab (foreground)" + }, + + "contextMenuItemResurrectConfigNewBackgroundTab": { + "message": "in a new tab (background)", + "description": "in a new tab (background)" + }, + + "contextMenuItemResurrectConfigNewWindow": { + "message": "in a new window", + "description": "in a new window" + } + +} diff --git a/background.js b/background.js new file mode 100644 index 0000000..181b720 --- /dev/null +++ b/background.js @@ -0,0 +1,412 @@ +openInEnum = { + CURRENT_TAB : 0, + NEW_TAB : 1, + NEW_BGTAB : 2, + NEW_WINDOW : 3 +} + +var openIn = openInEnum.CURRENT_TAB; +browser.storage.local.get ("openIn").then (function (item) {if (item.openIn) {openIn = item.openIn}}, onError); + +function onCreated(n) { + if (browser.runtime.lastError) { + console.log(`Error: ${browser.runtime.lastError}`); + } +} + +function onRemoved() { } + +function onError(error) { + console.log(`Error: ${error}`); +} + +/* +Create all the context menu items. +*/ +// top level {{{ +browser.contextMenus.create({ + id: "resurrect-page", + title: browser.i18n.getMessage("contextMenuItemResurrectPage"), + contexts: ["page"] +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link", + title: browser.i18n.getMessage("contextMenuItemResurrectLink"), + contexts: ["link"] +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection", + title: browser.i18n.getMessage("contextMenuItemResurrectSelection"), + contexts: ["selection"] +}, onCreated); +//}}} + +// resurrect page {{{ +browser.contextMenus.create({ + id: "resurrect-page-google", + title: browser.i18n.getMessage("contextMenuItemResurrectGoogle"), + icons: { 16: "icons/cacheicons/google.png" }, + contexts: ["all"], + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-googletext", + title: browser.i18n.getMessage("contextMenuItemResurrectGoogleText"), + icons: { 16: "icons/cacheicons/google.png" }, + contexts: ["all"], + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-archive", + title: browser.i18n.getMessage("contextMenuItemResurrectArchive"), + icons: { 16: "icons/cacheicons/waybackmachine.png" }, + contexts: ["all"], + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-archiveis", + title: browser.i18n.getMessage("contextMenuItemResurrectArchiveIs"), + icons: { 16: "icons/cacheicons/archiveis.png" }, + contexts: ["all"], + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-webcitation", + title: browser.i18n.getMessage("contextMenuItemResurrectWebcitation"), + icons: { 16: "icons/cacheicons/webcitation.png" }, + contexts: ["all"], + parentId: "resurrect-page" +}, onCreated); +//}}} + +// resurrect link {{{ +browser.contextMenus.create({ + id: "resurrect-link-google", + title: browser.i18n.getMessage("contextMenuItemResurrectGoogle"), + icons: { 16: "icons/cacheicons/google.png" }, + contexts: ["all"], + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-googletext", + title: browser.i18n.getMessage("contextMenuItemResurrectGoogleText"), + icons: { 16: "icons/cacheicons/google.png" }, + contexts: ["all"], + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-archive", + title: browser.i18n.getMessage("contextMenuItemResurrectArchive"), + icons: { 16: "icons/cacheicons/waybackmachine.png" }, + contexts: ["all"], + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-archiveis", + title: browser.i18n.getMessage("contextMenuItemResurrectArchiveIs"), + icons: { 16: "icons/cacheicons/archiveis.png" }, + contexts: ["all"], + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-webcitation", + title: browser.i18n.getMessage("contextMenuItemResurrectWebcitation"), + icons: { 16: "icons/cacheicons/webcitation.png" }, + contexts: ["all"], + parentId: "resurrect-link" +}, onCreated); +//}}} + +// resurrect selection {{{ +browser.contextMenus.create({ + id: "resurrect-selection-google", + title: browser.i18n.getMessage("contextMenuItemResurrectGoogle"), + icons: { 16: "icons/cacheicons/google.png" }, + contexts: ["all"], + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-googletext", + title: browser.i18n.getMessage("contextMenuItemResurrectGoogleText"), + icons: { 16: "icons/cacheicons/google.png" }, + contexts: ["all"], + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-archive", + title: browser.i18n.getMessage("contextMenuItemResurrectArchive"), + icons: { 16: "icons/cacheicons/waybackmachine.png" }, + contexts: ["all"], + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-archiveis", + title: browser.i18n.getMessage("contextMenuItemResurrectArchiveIs"), + icons: { 16: "icons/cacheicons/archiveis.png" }, + contexts: ["all"], + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-webcitation", + title: browser.i18n.getMessage("contextMenuItemResurrectWebcitation"), + icons: { 16: "icons/cacheicons/webcitation.png" }, + contexts: ["all"], + parentId: "resurrect-selection" +}, onCreated); +//}}} + +//config page {{{ +browser.contextMenus.create({ + id: "separator-1", + type: "separator", + contexts: ["all"], + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-current-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigCurrentTab"), + contexts: ["all"], + checked: true, + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-new-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewTab"), + contexts: ["all"], + checked: false, + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-new-background-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewBackgroundTab"), + contexts: ["all"], + checked: false, + parentId: "resurrect-page" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-page-new-window", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewWindow"), + contexts: ["all"], + checked: false, + parentId: "resurrect-page" +}, onCreated); +//}}} + +//config link {{{ +browser.contextMenus.create({ + id: "separator-2", + type: "separator", + contexts: ["all"], + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-current-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigCurrentTab"), + contexts: ["all"], + checked: true, + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-new-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewTab"), + contexts: ["all"], + checked: false, + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-new-background-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewBackgroundTab"), + contexts: ["all"], + checked: false, + parentId: "resurrect-link" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-link-new-window", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewWindow"), + contexts: ["all"], + checked: false, + parentId: "resurrect-link" +}, onCreated); +//}}} + +//config selection {{{ +browser.contextMenus.create({ + id: "separator-3", + type: "separator", + contexts: ["all"], + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-current-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigCurrentTab"), + contexts: ["all"], + checked: true, + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-new-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewTab"), + contexts: ["all"], + checked: false, + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-new-background-tab", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewBackgroundTab"), + contexts: ["all"], + checked: false, + parentId: "resurrect-selection" +}, onCreated); + +browser.contextMenus.create({ + id: "resurrect-selection-new-window", + type: "radio", + title: browser.i18n.getMessage("contextMenuItemResurrectConfigNewWindow"), + contexts: ["all"], + checked: false, + parentId: "resurrect-selection" +}, onCreated); +//}}} + + +browser.contextMenus.onClicked.addListener(function(info, tab) { + var gotoUrl=null; + + var rawUrl = info.pageUrl; + + switch (info.menuItemId) { + case "resurrect-page-google": + gotoUrl='https://www.google.com/search?q=cache:'+encodeURIComponent(info.pageUrl); + break; + case "resurrect-link-google": + gotoUrl='https://www.google.com/search?q=cache:'+encodeURIComponent(info.linkUrl); + break; + case "resurrect-selection-google": + gotoUrl='https://www.google.com/search?q=cache:'+encodeURIComponent(info.selectionText); + break; + + case "resurrect-page-googletext": + gotoUrl='https://www.google.com/search?strip=1&q=cache:'+encodeURIComponent(info.pageUrl); + break; + case "resurrect-link-googletext": + gotoUrl='https://www.google.com/search?strip=1&q=cache:'+encodeURIComponent(info.linkUrl); + break; + case "resurrect-selection-googletext": + gotoUrl='https://www.google.com/search?strip=1&q=cache:'+encodeURIComponent(info.selectionText); + break; + + case "resurrect-page-archive": + var dateStr = (new Date()).toISOString().replace(/-|T|:|\..*/g, ''); + gotoUrl='https://web.archive.org/web/'+dateStr+'/'+info.pageUrl + break; + case "resurrect-link-archive": + var dateStr = (new Date()).toISOString().replace(/-|T|:|\..*/g, ''); + gotoUrl='https://web.archive.org/web/'+dateStr+'/'+info.linkUrl + break; + case "resurrect-selection-archive": + var dateStr = (new Date()).toISOString().replace(/-|T|:|\..*/g, ''); + gotoUrl='https://web.archive.org/web/'+dateStr+'/'+info.selectionText + break; + + case "resurrect-page-archiveis": + gotoUrl='https://archive.is/'+info.pageUrl; + break; + case "resurrect-link-archiveis": + gotoUrl='https://archive.is/'+info.linkUrl; + break; + case "resurrect-selection-archiveis": + gotoUrl='https://archive.is/'+info.selectionText; + break; + + case "resurrect-page-webcitation": + gotoUrl='http://webcitation.org/query.php?url='+encodeURIComponent(info.pageUrl); + break; + case "resurrect-link-webcitation": + gotoUrl='http://webcitation.org/query.php?url='+encodeURIComponent(info.linkUrl); + break; + case "resurrect-selection-webcitation": + gotoUrl='http://webcitation.org/query.php?url='+encodeURIComponent(info.selectionText); + break; + + case "resurrect-page-current-tab": + case "resurrect-link-current-tab": + case "resurrect-selection-current-tab": + openIn = openInEnum.CURRENT_TAB; + browser.storage.local.set({openIn: openIn}); + return; + case "resurrect-page-new-tab": + case "resurrect-link-new-tab": + case "resurrect-selection-new-tab": + openIn = openInEnum.NEW_TAB; + browser.storage.local.set({openIn: openIn}); + return; + case "resurrect-page-new-background-tab": + case "resurrect-link-new-background-tab": + case "resurrect-selection-new-background-tab": + openIn = openInEnum.NEW_BGTAB; + browser.storage.local.set({openIn: openIn}); + return; + case "resurrect-page-new-window": + case "resurrect-link-new-window": + case "resurrect-selection-new-window": + openIn = openInEnum.NEW_WINDOW; + browser.storage.local.set({openIn: openIn}); + return; + } + + if (gotoUrl) { + console.log ("would've gone to " + gotoUrl + " opened in " + openIn); + switch (openIn) { + case openInEnum.CURRENT_TAB: + browser.tabs.update({ "url": gotoUrl}); + break; + case openInEnum.NEW_TAB: + browser.tabs.create({ "url": gotoUrl}); + break; + case openInEnum.NEW_BGTAB: + browser.tabs.create({ "url": gotoUrl, "active":false}); + break; + case openInEnum.NEW_WINDOW: + browser.windows.create({ "url": gotoUrl}); + break; + } + } +}); + + diff --git a/chrome.manifest b/chrome.manifest deleted file mode 100644 index f29ef28..0000000 --- a/chrome.manifest +++ /dev/null @@ -1,42 +0,0 @@ -content resurrect content/ contentaccessible=yes -skin resurrect classic/1.0 skin/ - -overlay chrome://browser/content/browser.xul chrome://resurrect/content/resurrect-overlay.xul -style chrome://global/content/customizeToolbar.xul chrome://resurrect/skin/resurrect-overlay.css - -locale resurrect ca-AD locale/ca-AD/ -locale resurrect cs-CZ locale/cs-CZ/ -locale resurrect da locale/da/ -locale resurrect da-DK locale/da-DK/ -locale resurrect de locale/de/ -locale resurrect de-DE locale/de-DE/ -locale resurrect el locale/el/ -locale resurrect el-GR locale/el-GR/ -locale resurrect en-US locale/en-US/ -locale resurrect es-AR locale/es-AR/ -locale resurrect es-CL locale/es-CL/ -locale resurrect es-ES locale/es-ES/ -locale resurrect fi locale/fi/ -locale resurrect fi-FI locale/fi-FI/ -locale resurrect fr locale/fr/ -locale resurrect fr-FR locale/fr-FR/ -locale resurrect hr-HR locale/hr-HR/ -locale resurrect it locale/it/ -locale resurrect it-IT locale/it-IT/ -locale resurrect ja-JP locale/ja-JP/ -locale resurrect ko-KR locale/ko-KR/ -locale resurrect nl locale/nl/ -locale resurrect nl-NL locale/nl-NL/ -locale resurrect pl locale/pl/ -locale resurrect pl-PL locale/pl-PL/ -locale resurrect pt-BR locale/pt-BR/ -locale resurrect pt-PT locale/pt-PT/ -locale resurrect ru-RU locale/ru-RU/ -locale resurrect sl-SI locale/sl-SI/ -locale resurrect sr locale/sr/ -locale resurrect sv-SE locale/sv-SE/ -locale resurrect tr locale/tr/ -locale resurrect tr-TR locale/tr-TR/ -locale resurrect uk-UA locale/uk-UA/ -locale resurrect zh-CN locale/zh-CN/ -locale resurrect zh-TW locale/zh-TW/ diff --git a/content/netError.xhtml b/content/netError.xhtml deleted file mode 100644 index 2b900d9..0000000 --- a/content/netError.xhtml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -
- - - - - - - &resurrect.thispage; - - - - - - - -
- - diff --git a/content/resurrect-overlay.xul b/content/resurrect-overlay.xul deleted file mode 100644 index 12d8e7f..0000000 --- a/content/resurrect-overlay.xul +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content/resurrect-select-mirror.xul b/content/resurrect-select-mirror.xul deleted file mode 100644 index cd477bb..0000000 --- a/content/resurrect-select-mirror.xul +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content/resurrect.js b/content/resurrect.js deleted file mode 100644 index 108d5a5..0000000 --- a/content/resurrect.js +++ /dev/null @@ -1,191 +0,0 @@ -var resurrect={ - - contextUrl:null, - -// // // // // // // // // // // // // // // // // // // // // // // // // // // - - onLoad:function() { - window.removeEventListener('load', resurrect.onLoad, false); - document.getElementById('contentAreaContextMenu') - .addEventListener('popupshowing', resurrect.toggleContextItems, false); - addEventListener('DOMContentLoaded', resurrect.contentDomLoad, false); - }, - - toggleContextItems:function(event) { - resurrect.contextUrl = gContextMenu.linkURL; - - var onDocument=!( - gContextMenu.isContentSelected || gContextMenu.onTextInput || - gContextMenu.onLink || gContextMenu.onImage); - - document.getElementById('resurrect-page-context') - .setAttribute('hidden', !onDocument); - document.getElementById('resurrect-link-context') - .setAttribute('hidden', !gContextMenu.onLink); - }, - - contentDomLoad:function(event) { - var contentDoc=event.target; - - if (contentDoc.documentURI.indexOf('about:neterror') != 0) return; - - // Inject our content... - var xhr = new XMLHttpRequest(); - xhr.open('GET', 'chrome://resurrect/content/netError.xhtml', true); - xhr.onload = function() { - var fieldset = xhr.responseXML.getElementById('resurrect'); - var xhtml = new XMLSerializer().serializeToString(fieldset); - var container = contentDoc.getElementById('errorPageContainer'); - container.innerHTML += xhtml; - - // ...plus the CSS. - var link = contentDoc.createElement('link'); - link.setAttribute('rel', 'stylesheet'); - link.setAttribute('href', 'chrome://resurrect/skin/netError.css'); - link.setAttribute('type', 'text/css'); - link.setAttribute('media', 'all'); - contentDoc.getElementsByTagName('head')[0].appendChild(link); - - // Add the className that enables it, only when appropriate. - contentDoc.location.href = - 'javascript:if ("nssBadCert" != getErrorCode()) {' - + 'document.body.className += " resurrect";' - + '}; void(0)'; - - // Add event listener. - contentDoc.getElementById('resurrect').addEventListener( - 'click', resurrect.clickedHtml, false); - contentDoc.getElementById('resurrect').addEventListener( - 'keypress', resurrect.clickedHtml, false); - }; - xhr.send(null); - }, - - disableButtons:function(doc) { - var bs=doc.getElementById('resurrect') - .getElementsByTagName('xul:button'); - for (var i=0, b=null; b=bs[i]; i++) { - b.setAttribute('disabled', 'true'); - } - }, - -// // // // // // // // // // // // // // // // // // // // // // // // // // // - - page:function(event) { - var doc=getBrowser().contentWindow.document; - resurrect.showDialog(doc.location.href); - }, - - link:function(event) { - resurrect.showDialog(resurrect.contextUrl); - }, - -// // // // // // // // // // // // // // // // // // // // // // // // // // // - - loadTarget:function() { - var pref=Components.classes['@mozilla.org/preferences-service;1'] - .getService(Components.interfaces.nsIPrefBranch); - var target=pref.getCharPref('extensions.resurrect.target'); - - document.getElementById('targetGroup').selectedItem= - document.getElementById(target); - }, - - saveTarget:function(el) { - var target=document.getElementById('targetGroup').selectedItem.id; - - var pref=Components.classes['@mozilla.org/preferences-service;1'] - .getService(Components.interfaces.nsIPrefBranch); - pref.setCharPref('extensions.resurrect.target', target); - }, - -// // // // // // // // // // // // // // // // // // // // // // // // // // // - - showDialog:function(url) { - window.openDialog( - 'chrome://resurrect/content/resurrect-select-mirror.xul', - '_blank', - 'modal,centerscreen,resizable=no,chrome,dependent', - getBrowser().contentWindow.document, url); - }, - - clickedHtml:function(event) { - if ('true'==event.target.getAttribute('disabled')) { - return; - } - if ('keypress' == event.type) { - if (event.target.parentNode.id != 'resurrect') return; - if (event.charCode != 32 && event.keyCode != 13) return; - } - - return resurrect.clickHandler( - event, - event.target.ownerDocument, - event.target.ownerDocument.location.href); - }, - - clickedXul:function(event) { - resurrect.saveTarget(event.target); - - return resurrect.clickHandler( - event, - window.arguments[0], - window.arguments[1]); - }, - - clickHandler:function(event, contentDoc, rawUrl) { - resurrect.disableButtons(event.target.ownerDocument); - - // Run the actual code. After timeout for UI repaint. - setTimeout( - resurrect.selectMirror, 1, - event.target.getAttribute('value'), - event.target.ownerDocument, - contentDoc, rawUrl); - }, - - selectMirror:function(mirror, ownerDoc, contentDoc, rawUrl) { - var gotoUrl=null; - var encUrl=encodeURIComponent(rawUrl); - - switch (mirror) { - case 'google': - gotoUrl='https://www.google.com/search?q=cache:'+encUrl; - break; - case 'googletext': - gotoUrl='https://www.google.com/search?strip=1&q=cache:'+encUrl; - break; - case 'archive': - var dateStr = (new Date()).toISOString().replace(/-|T|:|\..*/g, ''); - gotoUrl='https://web.archive.org/web/'+dateStr+'/'+rawUrl; - break; - case 'archiveis': - gotoUrl='https://archive.is/'+rawUrl; - break; - case 'webcitation': - gotoUrl='http://webcitation.org/query.php?url='+encUrl; - break; - default: - return false; - break; - } - - if (gotoUrl) { - if (ownerDoc.getElementById('targetTab').getAttribute('selected')) { - window.opener.openUILinkIn(gotoUrl, 'tab'); - } else if (ownerDoc.getElementById('targetWin').getAttribute('selected')) { - // the setTimeout keeps focus from returning to the opener - setTimeout(function(){ - window.opener.openNewWindowWith(gotoUrl, null, null); - }, 10); - } else { - contentDoc.location.assign(gotoUrl); - } - - if ('chrome://resurrect/content/resurrect-select-mirror.xul'==window.document.location) { - // setTimeout avoids errors because the window is gone - setTimeout(window.close, 0); - } - } - } -}; diff --git a/defaults/preferences/resurrect.js b/defaults/preferences/resurrect.js deleted file mode 100644 index c51d0a9..0000000 --- a/defaults/preferences/resurrect.js +++ /dev/null @@ -1,3 +0,0 @@ -pref("extensions.{0c8fbd76-bdeb-4c52-9b24-d587ce7b9dc3}.description", "chrome://resurrect/locale/overlay.properties"); - -pref("extensions.resurrect.target", "targetCurr"); diff --git a/icons/cacheicons/archiveis.png b/icons/cacheicons/archiveis.png new file mode 100644 index 0000000..5262759 Binary files /dev/null and b/icons/cacheicons/archiveis.png differ diff --git a/skin/cacheicons/google.png b/icons/cacheicons/google.png similarity index 100% rename from skin/cacheicons/google.png rename to icons/cacheicons/google.png diff --git a/skin/cacheicons/waybackmachine.png b/icons/cacheicons/waybackmachine.png similarity index 100% rename from skin/cacheicons/waybackmachine.png rename to icons/cacheicons/waybackmachine.png diff --git a/skin/cacheicons/webcitation.png b/icons/cacheicons/webcitation.png similarity index 100% rename from skin/cacheicons/webcitation.png rename to icons/cacheicons/webcitation.png diff --git a/icons/page-16.png b/icons/page-16.png new file mode 100644 index 0000000..58d965e Binary files /dev/null and b/icons/page-16.png differ diff --git a/skin/em-icon.png b/icons/page-32.png similarity index 100% rename from skin/em-icon.png rename to icons/page-32.png diff --git a/skin/tb-icon-large.png b/icons/tb-icon-large.png similarity index 100% rename from skin/tb-icon-large.png rename to icons/tb-icon-large.png diff --git a/install.rdf b/install.rdf deleted file mode 100644 index d36965f..0000000 --- a/install.rdf +++ /dev/null @@ -1,23 +0,0 @@ - - - - {0c8fbd76-bdeb-4c52-9b24-d587ce7b9dc3} - Resurrect Pages - 3 - Resurrect dead pages, by finding their ghosts. - - http://trac.arantius.com/wiki/Extensions/Resurrect - chrome://resurrect/skin/em-icon.png - - Anthony Lieuallen - Translators from BabelZilla.org - - - - {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - 3.0 - 43.* - - - - diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..bcafaa9 --- /dev/null +++ b/manifest.json @@ -0,0 +1,29 @@ +{ + + "manifest_version": 2, + "name": "__MSG_extensionName__", + "description": "__MSG_extensionDescription__", + "version": "1.0", + "default_locale": "en", + "applications": { + "gecko": { + "strict_min_version": "56.0b3" + } + }, + + "background": { + "scripts": ["background.js"] + }, + + "permissions": [ + "storage", + "contextMenus", + "activeTab" + ], + + "icons": { + "16": "icons/page-16.png", + "32": "icons/page-32.png" + } + +} diff --git a/skin/cacheicons/archive.png b/skin/cacheicons/archive.png deleted file mode 100644 index 01f20ca..0000000 Binary files a/skin/cacheicons/archive.png and /dev/null differ diff --git a/skin/cacheicons/archiveis.ico b/skin/cacheicons/archiveis.ico deleted file mode 100755 index b755255..0000000 Binary files a/skin/cacheicons/archiveis.ico and /dev/null differ diff --git a/skin/netError.css b/skin/netError.css deleted file mode 100644 index 62efe44..0000000 --- a/skin/netError.css +++ /dev/null @@ -1,46 +0,0 @@ -body.resurrect div#errorPageContainer { - padding-right: 22em; - max-width: 41em; - min-height: 20em; -} - -fieldset#resurrect { - display: none; -} -body.resurrect fieldset#resurrect { - display: block; - - position: absolute; - top: 0; - right: 0; - - background-color: white; - - width: 14em; - padding: 1em; - margin: 1em; - margin-right: 1.5em; - - -moz-border-radius: 10px; -} - -body.resurrect fieldset#resurrect legend img { - vertical-align: middle; - padding-right: 0.25em; -} - -body.resurrect fieldset#resurrect button { - width: 14em; -} -body.resurrect fieldset#resurrect button img { - vertical-align: middle; - margin-top: -6px; -} - -/* Issue #6: Display below this popup. */ -body.resurrect fieldset#resurrect { - z-index: 1; -} -body.resurrect #certificateErrorReportingPanel { - z-index: 2; -} diff --git a/skin/resurrect-overlay.css b/skin/resurrect-overlay.css deleted file mode 100644 index bad4b73..0000000 --- a/skin/resurrect-overlay.css +++ /dev/null @@ -1,6 +0,0 @@ -#resurrect-page-tb { - list-style-image: url("chrome://resurrect/skin/tb-icon-large.png"); -} -toolbar[iconsize="small"] #resurrect-page-tb { - list-style-image: url("chrome://resurrect/skin/tb-icon-small.png"); -} diff --git a/skin/select-mirror.css b/skin/select-mirror.css deleted file mode 100755 index 57c4409..0000000 --- a/skin/select-mirror.css +++ /dev/null @@ -1,3 +0,0 @@ -#resurrect button { - width: 14em; -} diff --git a/skin/tb-icon-small.png b/skin/tb-icon-small.png deleted file mode 100644 index fe20ef3..0000000 Binary files a/skin/tb-icon-small.png and /dev/null differ