Comparer les révisions

...

16 Révisions
5.0 ... master

Auteur SHA1 Message Date
Albirew a8a76a1cba Fixed "applications" property in the manifest is deprecated and will no longer be accepted in Manifest Version 3 and above. 2024-03-09 15:18:03 +01:00
Albirew 4cd0f61d80 Added sexy dark mode on popup 2024-03-09 15:05:06 +01:00
Albirew d2cb1d9492 Replaced Google with Cachew (Cache-view) 2024-03-09 15:04:52 +01:00
Albirew 72f4983f96 updated readme and contributing files moved LICENSE to license.md 2023-05-08 17:39:47 +02:00
Albirew 816e5d6ed8 updated changelog 2019-12-12 22:07:06 +01:00
Albirew ca7773baf7 Specify openerTabId for opened tabs
See https://github.com/arantius/resurrect-pages/pull/44
2019-12-12 22:05:41 +01:00
Albirew 16d1af6868 bump manifest to 6.2 2019-09-13 02:11:32 +02:00
Albirew d8566c66a4 changed (dead) archive.is tld to archive.md 2019-09-12 19:24:32 +02:00
Albirew c6a25e7312 Update 6.1 2018-05-04 16:37:58 +02:00
Albirew e2fed0aac7
Merge pull request #13 from DenB10/patch-1
Update background.js
2018-05-04 16:29:57 +02:00
DenB10 12774ecfc3
Update background.js
Context menu revived
2018-05-04 11:30:33 +02:00
Albirew 9fc038e1dd fixed bug
fixed "WARN Please specify whether you want browser_style or not in your browser_action options"
2018-03-29 19:24:50 +02:00
Albirew 17af6aea37 Revert "Bug fix"
This reverts commit 6c15d1a399.
2018-03-29 19:18:56 +02:00
Albirew 6c15d1a399 Bug fix 2018-03-29 19:10:01 +02:00
Albirew 9565aea0ea Updated icons 2018-03-29 19:09:35 +02:00
Albirew e0155d5ab6 Updated with latest version from Arrantius
- Add "list all versions" for The Internet Archive.
- Add MementoWeb TimeTravel source.

-Updated translation
2018-03-29 19:09:11 +02:00
18 fichiers modifiés avec 169 ajouts et 112 suppressions

Voir le fichier

@ -1,8 +0,0 @@
# Contributing to resurrect-pages
I love pull requests from everyone.
In fact, since I don't have much time for coding (neither much skill, I must admit),
any pull request is very welcome!
If you find a bug in the source code, you can help me by submitting an issue to this [GitHub Repository][github].
Even better you can submit a Pull Request with a fix.

Voir le fichier

@ -1,20 +1,22 @@
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENCE) - [![MAXVERSION](https://img.shields.io/badge/Firefox-57+-green.svg)](https://addons.mozilla.org/firefox/addon/resurrect-pages-isup-edition/)
# resurrect-pages-isup-edition
# Documentation
# Description
Dead pages, broken links, the scourge of the internet.
Powerhouse sites like Slashdot and Digg can bring a server to its knees.
What do we do when a page is dead but we still want to see it?
Call in the clerics, and perform a resurrection ceremony!
Or, the easier route, use this extension.
## Features
* Searches through seven page cache/mirrors:
* [Google Cache](http://www.google.com/) (plus text-only version)
# Features
* Searches through six page cache/mirrors:
* [Cachew](https://cachedview.nl/)
* [The Internet Archive](http://web.archive.org/)
* [WebCite](http://www.webcitation.org/)
* [archive.is](https://archive.is/)
* [Memento Time Travel](http://timetravel.mementoweb.org/)
* [Down for everyone?](http://www.isup.me/)
Of course, not every page can be in every cache.
@ -26,7 +28,24 @@ Hit back and try another one!
* In the toolbar, just customize it to drag the button in.
* With the keyboard: press `Ctrl-Shift-U`
# Changelog
* Version 7
* Replaced Google with Cachew (Cache-view)
* Added sexy dark mode on popup
* Version 6.2.1
* Specify openerTabId for opened tabs
* Version 6.2
* changed archive.is tld to archive.md
* Version 6.1
* Revived context menu (PR #13 from DenB10)
* Version 6
* Merged with latest version from Arrantius
* Add "list all versions" for The Internet Archive.
* Add MementoWeb TimeTravel source.
* Updated icons (HD)
* Bug fix
* Version 5
* Merged with WebExtensions version from Arrantius (#3 #10)
* Does not include netError page ([not currently possible](http://bugzil.la/1376793))
@ -57,9 +76,10 @@ Hit back and try another one!
* Typo in some languages for Gigablast
* Removed yahoo cache (yahoo uses bing cache now)
* Removed coral CDN (almost alsways dead)
* Version 2.1 (Sep 19, 2013)
* Version 2.1 (Sep 19, 2013) FORK
* Firefox 22+ compatibility
* Added isup.me provider
* Version 2.0.7 (Jun 26, 2011)
* Firefox 5.0 compatibility.
* Updated translations from babelzilla.org.
@ -116,3 +136,16 @@ Hit back and try another one!
* Integrate into the net error page.
* Version 0.5.1
* Bugfix, broken shortcut key.
# Contact
Mastodon: https://soshar.dess.ga/@Albirew
Twitter: https://twitter.com/Albirew
# Installation
Use either release file or install from Firefox Addons:
https://addons.mozilla.org/firefox/addon/resurrect-pages-isup-edition/
# Licence
MIT Licence (https://choosealicense.com/licenses/mit/)

Voir le fichier

@ -19,14 +19,9 @@
"description": "Resurrect this link"
},
"resurrectGoogle": {
"message": "with Google",
"description": "with Google"
},
"resurrectGoogleText": {
"message": "with Google (text only)",
"description": "with Google (text only)"
"resurrectCachew": {
"message": "with Cachew",
"description": "with Cache-view"
},
"resurrectArchive": {
@ -34,6 +29,11 @@
"description": "with The Internet Archive"
},
"resurrectArchiveList": {
"message": "with The Internet Archive (list all)",
"description": "with The Internet Archive (list all)"
},
"resurrectArchiveIs": {
"message": "with archive.is",
"description": "with archive.is"
@ -44,6 +44,11 @@
"description": "with WebCite"
},
"resurrectMementoWeb": {
"message": "with Memento Timetravel",
"description": "with Memento Timetravel"
},
"resurrectIsUp": {
"message": "check if really down",
"description": "with isup.me"

Voir le fichier

@ -20,8 +20,8 @@
},
"resurrectGoogle": {
"message": "avec Google",
"description": "with Google"
"message": "avec Cachew",
"description": "with Cache-view"
},
"resurrectGoogleText": {
@ -34,6 +34,11 @@
"description": "with The Internet Archive"
},
"resurrectArchiveList": {
"message": "avec l'Archive Internet (historique)",
"description": "with The Internet Archive (list all)"
},
"resurrectArchiveIs": {
"message": "avec archive.is",
"description": "with archive.is"
@ -44,6 +49,11 @@
"description": "with WebCite"
},
"resurrectMementoWeb": {
"message": "avec Memento Timetravel",
"description": "with Memento Timetravel"
},
"resurrectIsUp": {
"message": "Vérifier si le site est mort",
"description": "with isup.me"

Voir le fichier

@ -1,65 +1,58 @@
function onCreated(n) {
}
chrome.storage.local.get('openIn', item => {
if (item.openIn) {
openIn = item.openIn;
}
function addResurrectItem(context, i18n, id, icon) {
chrome.contextMenus.create({
id: 'resurrect-' + id + '-' + context,
title: chrome.i18n.getMessage('resurrect' + i18n),
icons: {16: 'icons/cacheicons/' + icon + '.png'},
contexts: [context],
parentId: 'resurrect-' + context
}, onCreated);
}
function addConfigItem(context, i18n, where, checked) {
chrome.contextMenus.create({
id: 'resurrect-' + where + '-' + context,
type: 'radio',
title: chrome.i18n.getMessage('resurrectConfig' + i18n),
contexts: [context],
checked: checked,
parentId: 'resurrect-' + context
}, onCreated);
}
['page', 'link'].forEach(context => {
chrome.contextMenus.create({
contexts: [context],
id: 'resurrect-' + context,
title: chrome.i18n.getMessage('resurrect_' + context),
contexts: [context]
}, onCreated);
}, logLastError);
addResurrectItem(context, 'Google', 'google', 'google');
addResurrectItem(context, 'GoogleText', 'google-text', 'google');
addResurrectItem(context, 'Archive', 'archive', 'waybackmachine');
addResurrectItem(context, 'ArchiveIs', 'archiveis', 'archiveis');
addResurrectItem(context, 'Webcitation', 'webcitation', 'webcitation');
addResurrectItem(context, 'IsUp', 'isup', 'isup');
for (let [name, id, icon] of [
['Cachew', 'cachew', 'cachew'],
['Archive', 'archive', 'waybackmachine'],
['ArchiveList', 'archivelist', 'waybackmachine'],
['ArchiveIs', 'archiveis', 'archiveis'],
['WebCitation', 'webcitation', 'webcitation'],
['MementoWeb', 'mementoweb', 'mementoweb'],
['IsUp', 'isup', 'isup'],
]) {
chrome.contextMenus.create({
contexts: [context],
icons: {16: 'icons/cacheicons/' + icon + '.png'},
id: 'resurrect-' + id + '-' + context,
parentId: 'resurrect-' + context,
title: chrome.i18n.getMessage('resurrect' + name),
}, logLastError);
}
chrome.contextMenus.create({
id: 'resurrect-separator-config-' + context,
type: 'separator',
contexts: [context],
parentId: 'resurrect-' + context
}, onCreated);
}, logLastError);
addConfigItem(
context, 'CurrentTab', 'current-tab', openIn == openInEnum.CURRENT_TAB);
addConfigItem(
context, 'NewTab', 'new-tab', openIn == openInEnum.NEW_TAB);
addConfigItem(
context, 'BgTab', 'bg-tab', openIn == openInEnum.BG_TAB);
addConfigItem(
context, 'NewWindow', 'new-window', openIn == openInEnum.NEW_WINDOW);
for (let [name, where, checked] of [
['CurrentTab', 'current-tab', openIn == openInEnum.CURRENT_TAB],
['NewTab', 'new-tab', openIn == openInEnum.NEW_TAB],
['BgTab', 'bg-tab', openIn == openInEnum.NEW_BGTAB],
['NewWindow', 'new-window', openIn == openInEnum.NEW_WINDOW],
]) {
chrome.contextMenus.create({
id: 'resurrect-' + where + '-' + context,
type: 'radio',
title: chrome.i18n.getMessage('resurrectConfig' + name),
contexts: [context],
checked: checked,
parentId: 'resurrect-' + context
}, logLastError);
}
});
});
chrome.contextMenus.onClicked.addListener(function(info, tab) {
let id = info.menuItemId;
let url = null;
@ -68,19 +61,20 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) {
} else if (id.endsWith('-link')) {
url = info.linkUrl;
}
if (id.startsWith('resurrect-google-')) {
goToUrl(genGoogleUrl(url), openIn);
} else if (id.startsWith('resurrect-googletext-')) {
goToUrl(genGoogleTextUrl(url), openIn);
if (id.startsWith('resurrect-cachew-')) {
goToUrl(genCachewUrl(url), openIn, tab.id);
} else if (id.startsWith('resurrect-archive-')) {
goToUrl(genIaUrl(url), openIn);
goToUrl(genIaUrl(url), openIn, tab.id);
} else if (id.startsWith('resurrect-archivelist-')) {
goToUrl(genIaListUrl(url), openIn, tab.id);
} else if (id.startsWith('resurrect-archiveis-')) {
goToUrl(genArchiveIsUrl(url), openIn);
goToUrl(genArchiveIsUrl(url), openIn, tab.id);
} else if (id.startsWith('resurrect-isup-')) {
goToUrl(genIsUpUrl(url), openIn);
goToUrl(genIsUpUrl(url), openIn, tab.id);
} else if (id.startsWith('resurrect-webcitation-')) {
goToUrl(genWebCiteUrl(url), openIn);
goToUrl(genWebCiteUrl(url), openIn, tab.id);
} else if (id.startsWith('resurrect-mementoweb-')) {
goToUrl(genMementoUrl(url), openIn, tab.id);
} else if (id.startsWith('resurrect-current-tab-')) {
setOpenIn(openInEnum.CURRENT_TAB);
} else if (id.startsWith('resurrect-new-tab-')) {

Voir le fichier

@ -5,77 +5,82 @@ openInEnum = {
NEW_WINDOW : 3
}
let openIn = openInEnum.CURRENT_TAB;
chrome.storage.local.get('openIn', item => {
if (item.openIn) {
openIn = item.openIn;
}
});
function onError(error) {
function logLastError() {
if (chrome.runtime.lastError) {
console.error('Resurrect error: ', chrome.runtime.lastError);
console.error('Resurrect error:', chrome.runtime.lastError);
}
}
function genGoogleUrl(url) {
return 'https://www.google.com/search?q=cache:'+encodeURIComponent(url);
}
function genGoogleTextUrl(url) {
return 'https://www.google.com/search?strip=1&q=cache:'+encodeURIComponent(url);
function genCachewUrl(url) {
return 'https://cachedview.nl/#' +url;
}
function genIaUrl(url) {
let dateStr =(new Date()).toISOString().replace(/-|T|:|\..*/g, '');
let dateStr = (new Date()).toISOString().replace(/-|T|:|\..*/g, '');
return 'https://web.archive.org/web/'+dateStr+'/'+url;
}
function genIaListUrl(url) {
let dateStr = (new Date()).toISOString().replace(/-|T|:|\..*/g, '');
return 'https://web.archive.org/web/*/'+url;
}
function genArchiveIsUrl(url) {
return 'https://archive.is/'+url;
return 'https://archive.ph/'+url;
}
function genWebCiteUrl(url) {
return 'http://webcitation.org/query.php?url='+encodeURIComponent(url);
}
function genMementoUrl(url) {
let dateStr = (new Date()).toISOString().replace(/-|T|:|\..*/g, '');
return 'http://timetravel.mementoweb.org/list/'
+ dateStr + '/' +url;
}
function genIsUpUrl(url) {
return 'http://isup.me/'+url;
}
function setOpenIn(where) {
openIn = where;
chrome.storage.local.set({openIn: openIn}, onError);
chrome.storage.local.set({openIn: openIn}, logLastError);
updateContextRadios();
}
function updateContextRadios() {
['page', 'link'].forEach(context => {
chrome.contextMenus.update(
'resurrect-current-tab-' + context,
{checked: openIn == openInEnum.CURRENT_TAB});
'resurrect-current-tab-' + context,
{checked: openIn == openInEnum.CURRENT_TAB});
chrome.contextMenus.update(
'resurrect-new-tab-' + context,
{checked: openIn == openInEnum.NEW_TAB});
'resurrect-new-tab-' + context,
{checked: openIn == openInEnum.NEW_TAB});
chrome.contextMenus.update(
'resurrect-bg-tab-' + context,
{checked: openIn == openInEnum.NEW_BGTAB});
'resurrect-bg-tab-' + context,
{checked: openIn == openInEnum.NEW_BGTAB});
chrome.contextMenus.update(
'resurrect-new-window-' + context,
{checked: openIn == openInEnum.NEW_WINDOW});
'resurrect-new-window-' + context,
{checked: openIn == openInEnum.NEW_WINDOW});
});
}
function goToUrl(url, where) {
function goToUrl(url, where, openerTabId) {
switch(Number(where)) {
case openInEnum.CURRENT_TAB:
chrome.tabs.update({'url': url});
break;
case openInEnum.NEW_TAB:
chrome.tabs.create({'url': url});
chrome.tabs.create({'url': url, openerTabId});
break;
case openInEnum.NEW_BGTAB:
chrome.tabs.create({'url': url, 'active': false});
chrome.tabs.create({'url': url, 'active': false, openerTabId});
break;
case openInEnum.NEW_WINDOW:
chrome.windows.create({'url': url});

6
contribute.md Fichier normal
Voir le fichier

@ -0,0 +1,6 @@
# Contribute
I love pull requests from everyone.
In fact, since I don't have much time for coding (neither much skill, I must admit), any pull request is very welcome!
If you find a bug in the source code, you can help me by submitting an issue to this repository.
Even better if you can submit a Pull Request with a fix.

Fichier binaire non affiché.

Avant

Largeur:  |  Hauteur:  |  Taille: 709 B

Après

Largeur:  |  Hauteur:  |  Taille: 15 KiB

BIN
icons/cacheicons/cachew.png Fichier normal

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 9.4 KiB

Fichier binaire non affiché.

Avant

Largeur:  |  Hauteur:  |  Taille: 711 B

Fichier binaire non affiché.

Avant

Largeur:  |  Hauteur:  |  Taille: 437 B

Après

Largeur:  |  Hauteur:  |  Taille: 6.8 KiB

BIN
icons/cacheicons/mementoweb.png Fichier normal

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 1.7 KiB

Fichier binaire non affiché.

Avant

Largeur:  |  Hauteur:  |  Taille: 468 B

Après

Largeur:  |  Hauteur:  |  Taille: 6.6 KiB

Fichier binaire non affiché.

Avant

Largeur:  |  Hauteur:  |  Taille: 537 B

Après

Largeur:  |  Hauteur:  |  Taille: 17 KiB

Voir le fichier

Voir le fichier

@ -3,11 +3,11 @@
"name": "__MSG_extensionName__",
"short_name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "5",
"version": "7.0.1",
"default_locale": "en",
"homepage_url": "https://github.com/Albirew/resurrect-pages",
"applications": {
"browser_specific_settings": {
"gecko": {
"id": "resurrect-pages@albirew.fr",
"strict_min_version": "57.0"
@ -24,7 +24,8 @@
"browser_action": {
"default_icon": "icons/page-32.png",
"default_title": "__MSG_extensionName__",
"default_popup": "popup.htm"
"default_popup": "popup.htm",
"browser_style":false
},
"commands": {

Voir le fichier

@ -18,29 +18,39 @@ label {
}
img {
vertical-align: bottom;
height: 16px;
}
@media (prefers-color-scheme: dark){
body {
filter: hue-rotate(180deg) invert(1);
background-color:#102;
}
}
</style>
<form>
<button data-locale="resurrectGoogle" data-gen="genGoogleUrl">
<img src="icons/cacheicons/google.png">
</button>
<button data-locale="resurrectGoogleText" data-gen="genGoogleTextUrl">
<img src="icons/cacheicons/google.png">
<button data-locale="resurrectCachew" data-gen="genCachewUrl">
<img src="icons/cacheicons/cachew.png">
</button>
<button data-locale="resurrectArchive" data-gen="genIaUrl">
<img src="icons/cacheicons/waybackmachine.png">
</button>
<button data-locale="resurrectArchiveList" data-gen="genIaListUrl">
<img src="icons/cacheicons/waybackmachine.png">
</button>
<button data-locale="resurrectArchiveIs" data-gen="genArchiveIsUrl">
<img src="icons/cacheicons/archiveis.png">
</button>
<button data-locale="resurrectWebcitation" data-gen="genWebCiteUrl">
<img src="icons/cacheicons/webcitation.png">
</button>
<button data-locale="resurrectMementoWeb" data-gen="genMementoUrl">
<img src="icons/cacheicons/mementoweb.png">
</button>
<button data-locale="resurrectIsUp" data-gen="genIsUpUrl">
<img src="icons/cacheicons/isup.png">
</button>
<br>
<div style='line-height: 8px;'>&nbsp;</div>
<label data-locale="resurrectConfigCurrentTab">
<input type="radio" name="openIn" value="0">

Voir le fichier

@ -4,14 +4,12 @@ chrome.storage.local.get('openIn', res => {
});
});
document.querySelectorAll('*[data-locale]').forEach(el => {
el.appendChild(document.createTextNode(
' ' + chrome.i18n.getMessage(el.getAttribute('data-locale'))
));
});
function onOpenInChange() {
setOpenIn(document.querySelector('input[name="openIn"]:checked').value);
};
@ -19,15 +17,18 @@ document.querySelectorAll('input[type=radio]').forEach(el => {
el.addEventListener('click', onOpenInChange, true);
});
function resurrect(gen) {
return function() {
chrome.tabs.query({active: true, currentWindow: true}, tabObj => {
goToUrl(gen(tabObj[0].url), openIn);
logLastError();
let url = gen(tabObj[0].url);
console.info('Resurrecting via URL', url);
goToUrl(url, openIn, tabObj[0].id);
window.close();
});
}
}
document.querySelectorAll('button').forEach(el => {
el.addEventListener(
'click', resurrect(window[el.getAttribute('data-gen')]), true);