1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5chrome.browserAction.onClicked.addListener(function(tab) {
6  chrome.debugger.attach({tabId:tab.id}, version,
7      onAttach.bind(null, tab.id));
8});
9
10var version = "1.0";
11
12function onAttach(tabId) {
13  if (chrome.runtime.lastError) {
14    alert(chrome.runtime.lastError.message);
15    return;
16  }
17
18  chrome.windows.create(
19      {url: "headers.html?" + tabId, type: "popup", width: 800, height: 600});
20}
21