diff --git a/chromeextension/manifest.json b/chromeextension/manifest.json index 469575c..84f8db7 100644 --- a/chromeextension/manifest.json +++ b/chromeextension/manifest.json @@ -10,6 +10,7 @@ "default_popup": "popup.html" }, "permissions": [ - "activeTab" + "activeTab", + "tabs" ] } \ No newline at end of file diff --git a/chromeextension/popup.js b/chromeextension/popup.js index b4fe57b..21b84c5 100644 --- a/chromeextension/popup.js +++ b/chromeextension/popup.js @@ -1,8 +1,13 @@ function query(key) { + var url; + chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) { + url = tabs[0].url; + }); + if (key == 'abc') { return null; } else { - return 'result:' + key; + return 'result:' + key + url; } };