diff options
Diffstat (limited to 'chrome/common/extensions/docs/examples/api/debugger/live-headers/background.js')
-rw-r--r-- | chrome/common/extensions/docs/examples/api/debugger/live-headers/background.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/chrome/common/extensions/docs/examples/api/debugger/live-headers/background.js b/chrome/common/extensions/docs/examples/api/debugger/live-headers/background.js index bba6065..45c0bbe 100644 --- a/chrome/common/extensions/docs/examples/api/debugger/live-headers/background.js +++ b/chrome/common/extensions/docs/examples/api/debugger/live-headers/background.js @@ -2,18 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -chrome.browserAction.onClicked.addListener(function() { - chrome.windows.getCurrent(function(win) { - chrome.tabs.getSelected(win.id, actionClicked); - }); +chrome.browserAction.onClicked.addListener(function(tab) { + chrome.debugger.attach({tabId:tab.id}, version, + onAttach.bind(null, tab.id)); }); var version = "1.0"; -function actionClicked(tab) { - chrome.debugger.attach({tabId:tab.id}, version, onAttach.bind(null, tab.id)); -} - function onAttach(tabId) { if (chrome.runtime.lastError) { alert(chrome.runtime.lastError.message); |