From e52ff430c2ada99daab701174a71ddedc9645692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=9B=BD=E5=AE=9D?= Date: Fri, 20 Nov 2015 00:01:19 +0800 Subject: [PATCH] update --- chromeextension/manifest.json | 3 ++- chromeextension/popup.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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; } };