aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRahiel Kasim <rahielkasim@gmail.com>2018-04-28 14:33:09 +0200
committerRahiel Kasim <rahielkasim@gmail.com>2018-04-28 14:33:09 +0200
commit317460d1f5692119e1b932e4725612ede9536788 (patch)
treed70259e47a734ebe075844f852688ccffb41a681
parent84c3dd441914a8cd7be57afe5c20d2da139ed5ba (diff)
archive context menu when right-clicking links
-rw-r--r--README.md20
-rw-r--r--package.json2
-rw-r--r--src/archiveror.js16
-rw-r--r--src/manifest.json2
4 files changed, 24 insertions, 16 deletions
diff --git a/README.md b/README.md
index c5f3e8b..714b372 100644
--- a/README.md
+++ b/README.md
@@ -14,9 +14,9 @@ on it shows the archive links. Archiving of bookmarks happens when you make a
new bookmark and when you open an old bookmark. This can be disabled.
You can manually archive webpages by clicking on the icon, using the Alt+Shift+Y
-hotkey (configurable), or via the page's right click context menu. The URL for
-the archive is then copied to your clipboard, so you can easily paste the link
-for references and citations.
+hotkey (configurable), via the page's right click context menu, or by
+right-clicking on links on a page. The URL for the archive is then copied to
+your clipboard, so you can easily paste the link for references and citations.
Happy archiving!
@@ -35,8 +35,9 @@ multiple services to archive a single page at multiple web archives.
advertising and (user tracking) JavaScript. Links:
[Example](https://archive.is/N0yex), [FAQ][faq-archive.is],
[Wikipedia][wiki-archive.is].
-- [**archive.org**](https://archive.org/web/), launched in 2001. Respects
- [robots.txt][robot] so it cannot archive all webpages. Links:
+- [**archive.org**](https://archive.org/web/), launched in 2001. Better known as
+ the [Wayback Machine][]. Respects [robots.txt][robot] so it cannot archive all
+ webpages. Links:
[Example](https://web.archive.org/web/20160420095454/http://physics.weber.edu/schroeder/md/),
[FAQ][faq-archive.org], [Wikipedia][wiki-archive.org].
- [**perma.cc**](https://perma.cc/), launched in 2013. Founded by the Harvard
@@ -57,13 +58,14 @@ multiple services to archive a single page at multiple web archives.
[wiki-archive.is]: https://en.wikipedia.org/wiki/Archive.is
[wiki-archive.org]: https://en.wikipedia.org/wiki/Internet_Archive
[wiki-webcite]: https://en.wikipedia.org/wiki/WebCite
+[wayback machine]: https://en.wikipedia.org/wiki/Wayback_Machine
## Local Saving
-Archiveror also makes local copies of webpages. It saves one web page in a
-single [MHTML][] file. Save pages manually by either clicking the button or by
-pressing Ctrl+Shift+S. The filenames end with the UTC date and time of when the
-archive was made.
+Archiveror also makes local copies of webpages. It saves one webpage in a single
+[MHTML][] file. Save pages manually by either clicking the button or by pressing
+Ctrl+Shift+S. The filenames end with the UTC date and time of when the archive
+was made.
To enable local archiving of bookmarks, right click the Archiveror button, go to
the options and then select "MHTML" at the "Bookmarks" section. With this option
diff --git a/package.json b/package.json
index 32d9b97..8dc414e 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"url": "https://github.com/rahiel/archiveror/issues"
},
"devDependencies": {
- "babel-core": "^6.26.0",
+ "babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.19.1",
diff --git a/src/archiveror.js b/src/archiveror.js
index 106f0b0..149f683 100644
--- a/src/archiveror.js
+++ b/src/archiveror.js
@@ -219,26 +219,32 @@ chrome.commands.onCommand.addListener(function (command) {
// context menu
chrome.contextMenus.removeAll(function () {
+ let contexts = ["page", "link"];
let menu = chrome.contextMenus.create({
title: "Archive",
- id: "context-menu"
+ id: "context-menu",
+ contexts: contexts,
});
for (let service of services) {
chrome.contextMenus.create({
title: service,
id: service,
- parentId: menu
+ parentId: menu,
+ contexts: contexts,
});
}
if (hasPageCapture) {
- chrome.contextMenus.create({type: "separator", id: "separator", parentId: menu});
- chrome.contextMenus.create({title: "Save MHTML as...", id: "MHTML", parentId: menu});
+ contexts = ["page"];
+ chrome.contextMenus.create({type: "separator", id: "separator", parentId: menu, contexts: contexts});
+ chrome.contextMenus.create({title: "Save MHTML as...", id: "MHTML", parentId: menu, contexts: contexts});
}
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === "MHTML") {
saveLocal(tab, false);
- } else {
+ } else if (info.hasOwnProperty("linkUrl")) {
+ archiveOnline(info.linkUrl, [info.menuItemId]);
+ } else if (info.hasOwnProperty("pageUrl")) {
archiveOnline(info.pageUrl, [info.menuItemId]);
}
});
diff --git a/src/manifest.json b/src/manifest.json
index 14a2d90..6e3be3e 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -3,7 +3,7 @@
"author": "Rahiel Kasim",
"description": "Archive webpages on archive.is, archive.org and more or on your own computer in MHTML format. Automatically archive your bookmarks.",
"homepage_url": "https://github.com/rahiel/archiveror",
- "version": "0.9",
+ "version": "0.10",
"applications": {
"gecko": {
"id": "archiveror@love.addons.mozilla.org",