aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilya2009-12-30 15:54:35 -0800
committerilya2009-12-30 15:54:35 -0800
commit9262eaaf796cbdd03e8fd18df9be5178e6669e8b (patch)
tree2ce389786c74e9d51f4d8b2a268ac4c30ccd3fb2
parent46ffdfde8bcfe6662d65acb3b3126a3748deaefd (diff)
downloadvimium-9262eaaf796cbdd03e8fd18df9be5178e6669e8b.tar.bz2
Get rid of chrome.tabs.getSelected in getCurrentTabUrl.
-rw-r--r--background_page.html8
1 files changed, 3 insertions, 5 deletions
diff --git a/background_page.html b/background_page.html
index f5b99ac7..9fc9a059 100644
--- a/background_page.html
+++ b/background_page.html
@@ -65,11 +65,9 @@
* Used by the content scripts to get their full URL. This is needed for URLs like "view-source:http:// .."
* because window.location doesn't know anything about the Chrome-specific "view-source:".
*/
- function getCurrentTabUrl(args) {
- chrome.tabs.getSelected(null, function(tab) {
- var returnPort = chrome.tabs.connect(tab.id, { name: "returnCurrentTabUrl" });
- returnPort.postMessage({ url: tab.url });
- });
+ function getCurrentTabUrl(args, port) {
+ var returnPort = chrome.tabs.connect(port.tab.id, { name: "returnCurrentTabUrl" });
+ returnPort.postMessage({ url: port.tab.url });
}
/*