Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A Quick fix for saving - didn't use the correct prefix

  • Loading branch information...
commit 9e03a961ca676ce1af8993c5304e081d4b339345 1 parent 133e15d
Paul Kinlan authored
View
26 tools/chrome/extensions/save/background.html
@@ -1,26 +0,0 @@
-<script>
- function clickHandler(info, tab) {
- if(info.mediaType == "image" ||
- info.mediaType == "video" ||
- info.mediaType == "audio") {
- var i = new WebKitIntent({"action": "http://webintents.org/save", "type": info.mediaType + "/*", "data": info.srcUrl});
- window.navigator.startActivty(i);
- }
- else if(!!info.linkUrl) {
- var i = new WebKitIntent({"action": "http://webintents.org/save", "type": "text/uri-list", "data": info.linkUrl });
- window.navigator.webkitStartActivity(i, function() {}, function() {});
- }
- };
-
- chrome.browserAction.onClicked.addListener(function(tab) {
- clickHandler({linkUrl: tab.url}, tab);
- });
-
- chrome.contextMenus.create({
- "title" : "Save",
- "type" : "normal",
- "contexts" : ["link", "image", "page", "video", "audio"],
- "onclick" : clickHandler
- });
-
-</script>
View
23 tools/chrome/extensions/save/background.js
@@ -0,0 +1,23 @@
+function clickHandler(info, tab) {
+ if(info.mediaType == "image" ||
+ info.mediaType == "video" ||
+ info.mediaType == "audio") {
+ var i = new WebKitIntent({"action": "http://webintents.org/save", "type": info.mediaType + "/*", "data": info.srcUrl});
+ window.navigator.webkitStartActivty(i);
+ }
+ else if(!!info.linkUrl) {
+ var i = new WebKitIntent({"action": "http://webintents.org/save", "type": "text/uri-list", "data": info.linkUrl });
+ window.navigator.webkitStartActivity(i, function() {}, function() {});
+ }
+};
+
+chrome.browserAction.onClicked.addListener(function(tab) {
+ clickHandler({linkUrl: tab.url}, tab);
+});
+
+chrome.contextMenus.create({
+ "title" : "Save",
+ "type" : "normal",
+ "contexts" : ["link", "image", "page", "video", "audio"],
+ "onclick" : clickHandler
+});
View
10 tools/chrome/extensions/save/manifest.json
@@ -14,8 +14,12 @@
"default_title": "Save this page"
},
"permissions" : [
- "http://*/*", "https://*/*", "contextMenus"
+ "contextMenus"
],
- "version": "0.0.0.2",
- "background_page": "background.html"
+ "version": "0.0.0.3",
+ "manifest_version": 2,
+ "minimum_chrome_version": "23.0.0.0",
+ "background": {
+ "scripts": ["background.js"]
+ }
}
View
BIN  tools/chrome/extensions/save/save128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.