Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: chrome/common/extensions/docs/examples/api/debugger/live-headers/background.js

Issue 11745015: Update references to the extension messaging APIs to point to the "runtime" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 chrome.browserAction.onClicked.addListener(function() { 5 chrome.browserAction.onClicked.addListener(function() {
6 chrome.windows.getCurrent(function(win) { 6 chrome.windows.getCurrent(function(win) {
7 chrome.tabs.getSelected(win.id, actionClicked); 7 chrome.tabs.getSelected(win.id, actionClicked);
8 }); 8 });
9 }); 9 });
10 10
11 var version = "1.0"; 11 var version = "1.0";
12 12
13 function actionClicked(tab) { 13 function actionClicked(tab) {
14 chrome.debugger.attach({tabId:tab.id}, version, onAttach.bind(null, tab.id)); 14 chrome.debugger.attach({tabId:tab.id}, version, onAttach.bind(null, tab.id));
15 } 15 }
16 16
17 function onAttach(tabId) { 17 function onAttach(tabId) {
18 if (chrome.extension.lastError) { 18 if (chrome.runtime.lastError) {
19 alert(chrome.extension.lastError.message); 19 alert(chrome.runtime.lastError.message);
20 return; 20 return;
21 } 21 }
22 22
23 chrome.windows.create( 23 chrome.windows.create(
24 {url: "headers.html?" + tabId, type: "popup", width: 800, height: 600}); 24 {url: "headers.html?" + tabId, type: "popup", width: 800, height: 600});
25 } 25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698