I'm trying to create a chrome extension that will allow a user to right click a file and choose to send it to an online service that will then do something (haven't made it that far yet) to it. However I'm having trouble getting it to work. I'm very new to jquery so this is probably a simple fix.
function uploadfile(info)
{
var fileurl = info.srcUrl;
var file;
$.get(fileurl, function(data) {
file = data;
alert(fileurl);
});
}
chrome.contextMenus.create({title: "send somewhere", contexts:["image"], onclick: uploadfile});
alert();
The alerts are just my way of trying to debug (very open to better ways). Also my manifest:
{
"name": "Practice",
"version": "0.1",
"manifest_version": 2,
"description": "Practice",
"icons": {
"16": "icon1.png",
"48": "icon2.png"
},
"background": {
"scripts": ["background.js"]
},
"permissions": [ "contextMenus",
"tabs",
"https://*/*",
"http://*/*"
],
"content_scripts": [
{
"matches": ["http://*/*"],
"js": ["jquery.js"]
} ]
}