Permalink
Browse files

Get rid of chrome.tabs.getSelected in getCurrentTabUrl.

  • Loading branch information...
1 parent 46ffdfd commit 9262eaaf796cbdd03e8fd18df9be5178e6669e8b @ilya ilya committed Dec 30, 2009
Showing with 3 additions and 5 deletions.
  1. +3 −5 background_page.html
View
@@ -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 });
}
/*

0 comments on commit 9262eaa

Please sign in to comment.