diff --git a/chrome/chrome.js b/chrome/chrome.js index 6fb52702..6a97df24 100644 --- a/chrome/chrome.js +++ b/chrome/chrome.js @@ -61,5 +61,16 @@ var can = Volcanos("chrome", { chrome.history.onVisited.addListener(function(item) { can.run({}, ["history", item.id, item.title, item.url]) }) + chrome.contextMenus.create({ + title: "favor", + onclick: function(event) { + chrome.tabs.query({ active: true}, function (tabs) { + chrome.tabs.sendMessage(tabs[0].id, { action: "copy" }, function (response) { + console.log(response) + can.run({}, ["history", "id", response.title, response.src]) + }) + }) + }, + }) }) diff --git a/chrome/contexts.js b/chrome/contexts.js index adb3699a..dd60865b 100644 --- a/chrome/contexts.js +++ b/chrome/contexts.js @@ -1,4 +1,6 @@ var can = Volcanos("chrome", { + video: function(can) { + }, }, [], function(can) { can.user = user can.page = page diff --git a/favicon.png b/favicon.png new file mode 100644 index 00000000..dd62b405 Binary files /dev/null and b/favicon.png differ diff --git a/manifest.json b/manifest.json index 89864bc6..5bfc29ee 100644 --- a/manifest.json +++ b/manifest.json @@ -2,9 +2,14 @@ "manifest_version": 2, "name": "volcanos", "version": "0.0.1", + "icons": { + "16": "favicon.png", + "48": "favicon.png", + "128": "favicon.png" + }, "background": {"page": "/chrome/chrome.html"}, "browser_action": { - "default_icon": "/favicon.ico", + "default_icon": "/favicon.png", "default_popup": "/chrome/popup.html" }, "content_scripts": [ @@ -25,6 +30,7 @@ "cookies", "bookmarks", "notifications", + "contextMenus", "*://localhost/*", "*://localhost:9020/*" ]