OLD | NEW |
| (Empty) |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | |
2 1) The <head> information in this page is significant, should be uniform | |
3 across api docs and should be edited only with knowledge of the | |
4 templating mechanism. | |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | |
6 browser, it will be re-generated from the template, json schema and | |
7 authored overview content. | |
8 4) The <body>.innerHTML is also generated by an offline step so that this | |
9 page may easily be indexed by search engines. | |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | |
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | |
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | |
15 </script> | |
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
17 </script> | |
18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
20 <script type="text/javascript" src="js/sidebar.js"></script> | |
21 <meta name="description" content="Documentation for the chrome.debugger module
, which is part of the Google Chrome extension APIs."><title>chrome.debugger -
Google Chrome Extensions - Google Code</title></head> | |
22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
24 </div> | |
25 <div id="branchWarning" class="displayModeWarning"> | |
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
27 It may not work with the stable release of Chrome.</span> | |
28 <select id="branchChooser"> | |
29 <option>Choose a different version... | |
30 </option><option value="">Stable | |
31 </option><option value="beta">Beta | |
32 </option><option value="dev">Dev | |
33 </option><option value="trunk">Trunk | |
34 </option></select> | |
35 </div> | |
36 <div id="unofficialWarning" class="displayModeWarning"> | |
37 <span>WARNING: This is unofficial documentation. It may not work with the | |
38 current release of Chrome.</span> | |
39 <button id="goToOfficialDocs">Go to the official docs</button> | |
40 </div> | |
41 <div id="gc-container" class="labs"> | |
42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
44 jstemplate to make a copy of the template in this section which | |
45 are not operated on by way of the jsskip="true" --> | |
46 <!-- /SUBTEMPLATES --> | |
47 <a id="top"></a> | |
48 <div id="skipto"> | |
49 <a href="#gc-pagecontent">Skip to page content</a> | |
50 <a href="#gc-toc">Skip to main navigation</a> | |
51 </div> | |
52 <!-- API HEADER --> | |
53 <table id="header" width="100%" cellspacing="0" border="0"> | |
54 <tbody><tr> | |
55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c
ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:
0; margin:0;"></a></td> | |
56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
58 <div id="gsc-search-box"> | |
59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
60 <input type="hidden" name="ie" value="UTF-8"> | |
61 <input type="text" name="q" value="" size="55"> | |
62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
63 <br> | |
64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
65 </div> | |
66 </form> | |
67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
71 </td> | |
72 </tr> | |
73 </tbody></table> | |
74 <div id="codesiteContent" class=""> | |
75 <a id="gc-topnav-anchor"></a> | |
76 <div id="gc-topnav"> | |
77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
78 <ul id="home" class="gc-topnav-tabs"> | |
79 <li id="home_link"> | |
80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
81 </li> | |
82 <li id="docs_link"> | |
83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
84 </li> | |
85 <li id="faq_link"> | |
86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
87 </li> | |
88 <li id="samples_link"> | |
89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
90 </li> | |
91 <li id="group_link"> | |
92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
93 </li> | |
94 <li id="so_link"> | |
95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
96 </li> | |
97 </ul> | |
98 </div> <!-- end gc-topnav --> | |
99 <div class="g-section g-tpl-170"> | |
100 <!-- SIDENAV --> | |
101 <div class="g-unit g-first" id="gc-toc"> | |
102 <ul> | |
103 <li><a href="getstarted.html">Getting Started</a></li> | |
104 <li><a href="overview.html">Overview</a></li> | |
105 <li><a href="whats_new.html">What's New?</a></li> | |
106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
107 <ul> | |
108 <li>Browser UI | |
109 <ul> | |
110 <li><a href="browserAction.html">Browser Actions</a></li> | |
111 <li><a href="contextMenus.html">Context Menus</a></li> | |
112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
113 <li><a href="omnibox.html">Omnibox</a></li> | |
114 <li><a href="options.html">Options Pages</a></li> | |
115 <li><a href="override.html">Override Pages</a></li> | |
116 <li><a href="pageAction.html">Page Actions</a></li> | |
117 </ul> | |
118 </li> | |
119 <li>Browser Interaction | |
120 <ul> | |
121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
122 <li><a href="cookies.html">Cookies</a></li> | |
123 <li><a href="devtools.html">Developer Tools</a></li> | |
124 <li><a href="events.html">Events</a></li> | |
125 <li><a href="history.html">History</a></li> | |
126 <li><a href="management.html">Management</a></li> | |
127 <li><a href="tabs.html">Tabs</a></li> | |
128 <li><a href="windows.html">Windows</a></li> | |
129 </ul> | |
130 </li> | |
131 <li>Implementation | |
132 <ul> | |
133 <li><a href="a11y.html">Accessibility</a></li> | |
134 <li><a href="background_pages.html">Background Pages</a></li> | |
135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
137 <li><a href="i18n.html">Internationalization</a></li> | |
138 <li><a href="messaging.html">Message Passing</a></li> | |
139 <li><a href="permissions.html">Optional Permissions</a></li> | |
140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
141 </ul> | |
142 </li> | |
143 <li>Finishing | |
144 <ul> | |
145 <li><a href="hosting.html">Hosting</a></li> | |
146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
147 </ul> | |
148 </li> | |
149 </ul> | |
150 </li> | |
151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
153 <ul> | |
154 <li><a href="tut_debugging.html">Debugging</a></li> | |
155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
156 <li><a href="tut_oauth.html">OAuth</a></li> | |
157 </ul> | |
158 </li> | |
159 <li><h2>Reference</h2> | |
160 <ul> | |
161 <li>Formats | |
162 <ul> | |
163 <li><a href="manifest.html">Manifest Files</a></li> | |
164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
165 </ul> | |
166 </li> | |
167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
169 <li><a href="api_other.html">Other APIs</a></li> | |
170 </ul> | |
171 </li> | |
172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
173 <div class="line"> </div> | |
174 <li><h2>More</h2> | |
175 <ul> | |
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
178 <li><a href="themes.html">Themes</a></li> | |
179 </ul> | |
180 </li> | |
181 </ul> | |
182 </div> | |
183 <script> | |
184 initToggles(); | |
185 </script> | |
186 <div class="g-unit" id="gc-pagecontent"> | |
187 <div id="pageTitle"> | |
188 <h1 class="page_title">chrome.debugger</h1> | |
189 </div> | |
190 <!-- TABLE OF CONTENTS --> | |
191 <div id="toc"> | |
192 <h2>Contents</h2> | |
193 <ol> | |
194 <li> | |
195 <a href="#manifest">Notes</a> | |
196 <ol> | |
197 </ol> | |
198 </li><li> | |
199 <a href="#manifest">Manifest</a> | |
200 <ol> | |
201 </ol> | |
202 </li><li> | |
203 <a href="#examples">Examples</a> | |
204 <ol> | |
205 </ol> | |
206 </li> | |
207 <li> | |
208 <a href="#apiReference">API reference: chrome.debugger</a> | |
209 <ol> | |
210 <li> | |
211 <a href="#global-methods">Methods</a> | |
212 <ol> | |
213 <li> | |
214 <a href="#method-attach">attach</a> | |
215 </li><li> | |
216 <a href="#method-detach">detach</a> | |
217 </li><li> | |
218 <a href="#method-sendCommand">sendCommand</a> | |
219 </li> | |
220 </ol> | |
221 </li> | |
222 <li> | |
223 <a href="#global-events">Events</a> | |
224 <ol> | |
225 <li> | |
226 <a href="#event-onDetach">onDetach</a> | |
227 </li><li> | |
228 <a href="#event-onEvent">onEvent</a> | |
229 </li> | |
230 </ol> | |
231 </li> | |
232 <li> | |
233 <a href="#types">Types</a> | |
234 <ol> | |
235 <li> | |
236 <a href="#type-Debuggee">Debuggee</a> | |
237 <ol> | |
238 </ol> | |
239 </li> | |
240 </ol> | |
241 </li> | |
242 </ol> | |
243 </li> | |
244 </ol> | |
245 </div> | |
246 <!-- /TABLE OF CONTENTS --> | |
247 <!-- Standard content lead-in for experimental API pages --> | |
248 <!-- STATIC CONTENT PLACEHOLDER --> | |
249 <div id="static"><!-- BEGIN AUTHORED CONTENT --> | |
250 <h2 id="manifest">Notes</h2> | |
251 <p> | |
252 Debugger API serves as an alternate transport for Chrome's | |
253 <a href="http://code.google.com/chrome/devtools/docs/remote-debugging.html"> | |
254 remote debugging protocol</a>. Use <code>chrome.debugger</code> | |
255 to attach to one or more tabs to instrument network interaction, debug | |
256 JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs | |
257 with sendCommand and route events by <code>tabId</code> from onEvent callbacks. | |
258 </p> | |
259 <p> | |
260 As of today, attaching to the tab by means of the debugger API | |
261 and using embedded Chrome DevTools with that tab are mutually exclusive. | |
262 If user invokes Chrome DevTools while extension is attached to the tab, | |
263 debugging session is terminated. Extension can re-establish it later. | |
264 </p> | |
265 <h2 id="manifest">Manifest</h2> | |
266 <p> | |
267 You must declare the "debugger" permission in your extension's manifest | |
268 to use this API. | |
269 </p> | |
270 <pre>{ | |
271 "name": "My extension", | |
272 ... | |
273 <b> "permissions": [ | |
274 "debugger", | |
275 ]</b>, | |
276 ... | |
277 }</pre> | |
278 <h2 id="examples">Examples</h2> | |
279 <p> | |
280 You can find samples of this API in | |
281 <a href="samples.html#debugger">Samples</a>. | |
282 </p> | |
283 <!-- END AUTHORED CONTENT --> | |
284 </div> | |
285 <!-- API PAGE --> | |
286 <div class="apiPage"> | |
287 <a name="apiReference"></a> | |
288 <h2>API reference: chrome.debugger</h2> | |
289 <!-- PROPERTIES --> | |
290 <!-- /apiGroup --> | |
291 <!-- METHODS --> | |
292 <div id="methodsTemplate" class="apiGroup"> | |
293 <a name="global-methods"></a> | |
294 <h3>Methods</h3> | |
295 <!-- iterates over all functions --> | |
296 <div class="apiItem"> | |
297 <a name="method-attach"></a> <!-- method-anchor --> | |
298 <h4>attach</h4> | |
299 <div class="summary"> | |
300 <!-- Note: intentionally longer 80 columns --> | |
301 <span>chrome.debugger.attach</span>(<span class="null"><span>D
ebuggee</span> | |
302 <var><span>target</span></var></span><span class="null"><s
pan>, </span><span>string</span> | |
303 <var><span>requiredVersion</span></var></span><span class=
"optional"><span>, </span><span>function</span> | |
304 <var><span>callback</span></var></span>)</div> | |
305 <div class="description"> | |
306 <p>Attaches debugger to the given target.</p> | |
307 <!-- PARAMETERS --> | |
308 <h4>Parameters</h4> | |
309 <dl> | |
310 <div> | |
311 <div> | |
312 <dt> | |
313 <var>target</var> | |
314 <em> | |
315 <!-- TYPE --> | |
316 <div style="display:inline"> | |
317 ( | |
318 <span id="typeTemplate"> | |
319 <span> | |
320 <a href="debugger.html#type-Debuggee">Debuggee</a> | |
321 </span> | |
322 </span> | |
323 ) | |
324 </div> | |
325 </em> | |
326 </dt> | |
327 <dd>Debugging target to which you want to attach.</dd> | |
328 <!-- OBJECT PROPERTIES --> | |
329 <!-- OBJECT METHODS --> | |
330 <!-- OBJECT EVENT FIELDS --> | |
331 <!-- FUNCTION PARAMETERS --> | |
332 </div> | |
333 </div><div> | |
334 <div> | |
335 <dt> | |
336 <var>requiredVersion</var> | |
337 <em> | |
338 <!-- TYPE --> | |
339 <div style="display:inline"> | |
340 ( | |
341 <span id="typeTemplate"> | |
342 <span> | |
343 <span>string</span> | |
344 </span> | |
345 </span> | |
346 ) | |
347 </div> | |
348 </em> | |
349 </dt> | |
350 <dd>Required debugging protocol version ("0.1"). One can only attach t
o the debuggee with matching major version and greater or equal minor version. L
ist of the protocol versions can be obtained <a href="http://code.google.com/chr
ome/devtools/docs/remote-debugging.html">here</a>.</dd> | |
351 <!-- OBJECT PROPERTIES --> | |
352 <!-- OBJECT METHODS --> | |
353 <!-- OBJECT EVENT FIELDS --> | |
354 <!-- FUNCTION PARAMETERS --> | |
355 </div> | |
356 </div><div> | |
357 <div> | |
358 <dt> | |
359 <var>callback</var> | |
360 <em> | |
361 <!-- TYPE --> | |
362 <div style="display:inline"> | |
363 ( | |
364 <span class="optional">optional</span> | |
365 <span id="typeTemplate"> | |
366 <span> | |
367 <span>function</span> | |
368 </span> | |
369 </span> | |
370 ) | |
371 </div> | |
372 </em> | |
373 </dt> | |
374 <dd>Called once the attach operation succeeds or fails. Callback recei
ves no arguments. If the attach fails, <a href="extension.html#property-lastErro
r">chrome.extension.lastError</a> will be set to the error message.</dd> | |
375 <!-- OBJECT PROPERTIES --> | |
376 <!-- OBJECT METHODS --> | |
377 <!-- OBJECT EVENT FIELDS --> | |
378 <!-- FUNCTION PARAMETERS --> | |
379 </div> | |
380 </div> | |
381 </dl> | |
382 <!-- RETURNS --> | |
383 <dl> | |
384 </dl> | |
385 <!-- CALLBACK --> | |
386 <div> | |
387 <div> | |
388 <h4>Callback function</h4> | |
389 <p> | |
390 If you specify the <em>callback</em> parameter, it should | |
391 specify a function that looks like this: | |
392 </p> | |
393 <!-- Note: intentionally longer 80 columns --> | |
394 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
395 <dl> | |
396 </dl> | |
397 </div> | |
398 </div> | |
399 <!-- MIN_VERSION --> | |
400 </div> <!-- /description --> | |
401 </div><div class="apiItem"> | |
402 <a name="method-detach"></a> <!-- method-anchor --> | |
403 <h4>detach</h4> | |
404 <div class="summary"> | |
405 <!-- Note: intentionally longer 80 columns --> | |
406 <span>chrome.debugger.detach</span>(<span class="null"><span>D
ebuggee</span> | |
407 <var><span>target</span></var></span><span class="optional
"><span>, </span><span>function</span> | |
408 <var><span>callback</span></var></span>)</div> | |
409 <div class="description"> | |
410 <p>Detaches debugger from the given target.</p> | |
411 <!-- PARAMETERS --> | |
412 <h4>Parameters</h4> | |
413 <dl> | |
414 <div> | |
415 <div> | |
416 <dt> | |
417 <var>target</var> | |
418 <em> | |
419 <!-- TYPE --> | |
420 <div style="display:inline"> | |
421 ( | |
422 <span id="typeTemplate"> | |
423 <span> | |
424 <a href="debugger.html#type-Debuggee">Debuggee</a> | |
425 </span> | |
426 </span> | |
427 ) | |
428 </div> | |
429 </em> | |
430 </dt> | |
431 <dd>Debugging target from which you want to detach.</dd> | |
432 <!-- OBJECT PROPERTIES --> | |
433 <!-- OBJECT METHODS --> | |
434 <!-- OBJECT EVENT FIELDS --> | |
435 <!-- FUNCTION PARAMETERS --> | |
436 </div> | |
437 </div><div> | |
438 <div> | |
439 <dt> | |
440 <var>callback</var> | |
441 <em> | |
442 <!-- TYPE --> | |
443 <div style="display:inline"> | |
444 ( | |
445 <span class="optional">optional</span> | |
446 <span id="typeTemplate"> | |
447 <span> | |
448 <span>function</span> | |
449 </span> | |
450 </span> | |
451 ) | |
452 </div> | |
453 </em> | |
454 </dt> | |
455 <dd>Called once the detach operation succeeds or fails. Callback recei
ves no arguments. If the detach fails, <a href="extension.html#property-lastErro
r">chrome.extension.lastError</a> will be set to the error message.</dd> | |
456 <!-- OBJECT PROPERTIES --> | |
457 <!-- OBJECT METHODS --> | |
458 <!-- OBJECT EVENT FIELDS --> | |
459 <!-- FUNCTION PARAMETERS --> | |
460 </div> | |
461 </div> | |
462 </dl> | |
463 <!-- RETURNS --> | |
464 <dl> | |
465 </dl> | |
466 <!-- CALLBACK --> | |
467 <div> | |
468 <div> | |
469 <h4>Callback function</h4> | |
470 <p> | |
471 If you specify the <em>callback</em> parameter, it should | |
472 specify a function that looks like this: | |
473 </p> | |
474 <!-- Note: intentionally longer 80 columns --> | |
475 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
476 <dl> | |
477 </dl> | |
478 </div> | |
479 </div> | |
480 <!-- MIN_VERSION --> | |
481 </div> <!-- /description --> | |
482 </div><div class="apiItem"> | |
483 <a name="method-sendCommand"></a> <!-- method-anchor --> | |
484 <h4>sendCommand</h4> | |
485 <div class="summary"> | |
486 <!-- Note: intentionally longer 80 columns --> | |
487 <span>chrome.debugger.sendCommand</span>(<span class="null"><s
pan>Debuggee</span> | |
488 <var><span>target</span></var></span><span class="null"><s
pan>, </span><span>string</span> | |
489 <var><span>method</span></var></span><span class="optional
"><span>, </span><span>object</span> | |
490 <var><span>params</span></var></span><span class="optional
"><span>, </span><span>function</span> | |
491 <var><span>callback</span></var></span>)</div> | |
492 <div class="description"> | |
493 <p>Sends given command to the debugging target.</p> | |
494 <!-- PARAMETERS --> | |
495 <h4>Parameters</h4> | |
496 <dl> | |
497 <div> | |
498 <div> | |
499 <dt> | |
500 <var>target</var> | |
501 <em> | |
502 <!-- TYPE --> | |
503 <div style="display:inline"> | |
504 ( | |
505 <span id="typeTemplate"> | |
506 <span> | |
507 <a href="debugger.html#type-Debuggee">Debuggee</a> | |
508 </span> | |
509 </span> | |
510 ) | |
511 </div> | |
512 </em> | |
513 </dt> | |
514 <dd>Debugging target to which you want to send the command.</dd> | |
515 <!-- OBJECT PROPERTIES --> | |
516 <!-- OBJECT METHODS --> | |
517 <!-- OBJECT EVENT FIELDS --> | |
518 <!-- FUNCTION PARAMETERS --> | |
519 </div> | |
520 </div><div> | |
521 <div> | |
522 <dt> | |
523 <var>method</var> | |
524 <em> | |
525 <!-- TYPE --> | |
526 <div style="display:inline"> | |
527 ( | |
528 <span id="typeTemplate"> | |
529 <span> | |
530 <span>string</span> | |
531 </span> | |
532 </span> | |
533 ) | |
534 </div> | |
535 </em> | |
536 </dt> | |
537 <dd>Method name. Should be one of the methods defined by the <a href="
http://code.google.com/chrome/devtools/docs/remote-debugging.html">remote debugg
ing protocol</a>.</dd> | |
538 <!-- OBJECT PROPERTIES --> | |
539 <!-- OBJECT METHODS --> | |
540 <!-- OBJECT EVENT FIELDS --> | |
541 <!-- FUNCTION PARAMETERS --> | |
542 </div> | |
543 </div><div> | |
544 <div> | |
545 <dt> | |
546 <var>params</var> | |
547 <em> | |
548 <!-- TYPE --> | |
549 <div style="display:inline"> | |
550 ( | |
551 <span class="optional">optional</span> | |
552 <span id="typeTemplate"> | |
553 <span> | |
554 <span>object</span> | |
555 </span> | |
556 </span> | |
557 ) | |
558 </div> | |
559 </em> | |
560 </dt> | |
561 <dd>JSON object with request parameters. This object must conform to t
he remote debugging params scheme for given method.</dd> | |
562 <!-- OBJECT PROPERTIES --> | |
563 <!-- OBJECT METHODS --> | |
564 <!-- OBJECT EVENT FIELDS --> | |
565 <!-- FUNCTION PARAMETERS --> | |
566 </div> | |
567 </div><div> | |
568 <div> | |
569 <dt> | |
570 <var>callback</var> | |
571 <em> | |
572 <!-- TYPE --> | |
573 <div style="display:inline"> | |
574 ( | |
575 <span class="optional">optional</span> | |
576 <span id="typeTemplate"> | |
577 <span> | |
578 <span>function</span> | |
579 </span> | |
580 </span> | |
581 ) | |
582 </div> | |
583 </em> | |
584 </dt> | |
585 <dd>Response body. If an error occurs while posting the message, the c
allback will be called with no arguments and <a href="extension.html#property-la
stError">chrome.extension.lastError</a> will be set to the error message.</dd> | |
586 <!-- OBJECT PROPERTIES --> | |
587 <!-- OBJECT METHODS --> | |
588 <!-- OBJECT EVENT FIELDS --> | |
589 <!-- FUNCTION PARAMETERS --> | |
590 </div> | |
591 </div> | |
592 </dl> | |
593 <!-- RETURNS --> | |
594 <dl> | |
595 </dl> | |
596 <!-- CALLBACK --> | |
597 <div> | |
598 <div> | |
599 <h4>Callback function</h4> | |
600 <p> | |
601 If you specify the <em>callback</em> parameter, it should | |
602 specify a function that looks like this: | |
603 </p> | |
604 <!-- Note: intentionally longer 80 columns --> | |
605 <pre>function(<span>object result</span>) <span class="subdued
">{...}</span>;</pre> | |
606 <dl> | |
607 <div> | |
608 <div> | |
609 <dt> | |
610 <var>result</var> | |
611 <em> | |
612 <!-- TYPE --> | |
613 <div style="display:inline"> | |
614 ( | |
615 <span class="optional">optional</span> | |
616 <span id="typeTemplate"> | |
617 <span> | |
618 <span>object</span> | |
619 </span> | |
620 </span> | |
621 ) | |
622 </div> | |
623 </em> | |
624 </dt> | |
625 <dd>JSON object with the response. Structure of the response varies de
pending on the method and is defined by the remote debugging protocol.</dd> | |
626 <!-- OBJECT PROPERTIES --> | |
627 <!-- OBJECT METHODS --> | |
628 <!-- OBJECT EVENT FIELDS --> | |
629 <!-- FUNCTION PARAMETERS --> | |
630 </div> | |
631 </div> | |
632 </dl> | |
633 </div> | |
634 </div> | |
635 <!-- MIN_VERSION --> | |
636 </div> <!-- /description --> | |
637 </div> <!-- /apiItem --> | |
638 </div> <!-- /apiGroup --> | |
639 <!-- EVENTS --> | |
640 <div id="eventsTemplate" class="apiGroup"> | |
641 <a name="global-events"></a> | |
642 <h3>Events</h3> | |
643 <!-- iterates over all events --> | |
644 <div class="apiItem"> | |
645 <a name="event-onDetach"></a> | |
646 <h4>onDetach</h4> | |
647 <div class="summary"> | |
648 <!-- Note: intentionally longer 80 columns --> | |
649 <span class="subdued">chrome.debugger.</span><span>onDetach</spa
n><span class="subdued">.addListener</span>(function(<span>Debuggee source</span
>) <span class="subdued">{...}</span><span></span>); | |
650 </div> | |
651 <div class="description"> | |
652 <p>Fired when browser terminates debugging session for the tab.
This happens when either the tab is being closed or Chrome DevTools is being inv
oked for the attached tab.</p> | |
653 <!-- LISTENER PARAMETERS --> | |
654 <div> | |
655 <h4>Listener parameters</h4> | |
656 <dl> | |
657 <div> | |
658 <div> | |
659 <dt> | |
660 <var>source</var> | |
661 <em> | |
662 <!-- TYPE --> | |
663 <div style="display:inline"> | |
664 ( | |
665 <span id="typeTemplate"> | |
666 <span> | |
667 <a href="debugger.html#type-Debuggee">Debuggee</a> | |
668 </span> | |
669 </span> | |
670 ) | |
671 </div> | |
672 </em> | |
673 </dt> | |
674 <dd>The debuggee that was detached.</dd> | |
675 <!-- OBJECT PROPERTIES --> | |
676 <!-- OBJECT METHODS --> | |
677 <!-- OBJECT EVENT FIELDS --> | |
678 <!-- FUNCTION PARAMETERS --> | |
679 </div> | |
680 </div> | |
681 </dl> | |
682 </div> | |
683 <!-- EXTRA PARAMETERS --> | |
684 <!-- LISTENER RETURN VALUE --> | |
685 <dl> | |
686 </dl> | |
687 </div> <!-- /description --> | |
688 <!-- /description --> | |
689 </div><div class="apiItem"> | |
690 <a name="event-onEvent"></a> | |
691 <h4>onEvent</h4> | |
692 <div class="summary"> | |
693 <!-- Note: intentionally longer 80 columns --> | |
694 <span class="subdued">chrome.debugger.</span><span>onEvent</span
><span class="subdued">.addListener</span>(function(<span>Debuggee source, strin
g method, object params</span>) <span class="subdued">{...}</span><span></span>)
; | |
695 </div> | |
696 <div class="description"> | |
697 <p>Fired whenever debugging target issues instrumentation event.
</p> | |
698 <!-- LISTENER PARAMETERS --> | |
699 <div> | |
700 <h4>Listener parameters</h4> | |
701 <dl> | |
702 <div> | |
703 <div> | |
704 <dt> | |
705 <var>source</var> | |
706 <em> | |
707 <!-- TYPE --> | |
708 <div style="display:inline"> | |
709 ( | |
710 <span id="typeTemplate"> | |
711 <span> | |
712 <a href="debugger.html#type-Debuggee">Debuggee</a> | |
713 </span> | |
714 </span> | |
715 ) | |
716 </div> | |
717 </em> | |
718 </dt> | |
719 <dd>The debuggee that generated this event.</dd> | |
720 <!-- OBJECT PROPERTIES --> | |
721 <!-- OBJECT METHODS --> | |
722 <!-- OBJECT EVENT FIELDS --> | |
723 <!-- FUNCTION PARAMETERS --> | |
724 </div> | |
725 </div><div> | |
726 <div> | |
727 <dt> | |
728 <var>method</var> | |
729 <em> | |
730 <!-- TYPE --> | |
731 <div style="display:inline"> | |
732 ( | |
733 <span id="typeTemplate"> | |
734 <span> | |
735 <span>string</span> | |
736 </span> | |
737 </span> | |
738 ) | |
739 </div> | |
740 </em> | |
741 </dt> | |
742 <dd>Method name. Should be one of the notifications defined by the <a
href="http://code.google.com/chrome/devtools/docs/remote-debugging.html">remote
debugging protocol</a>.</dd> | |
743 <!-- OBJECT PROPERTIES --> | |
744 <!-- OBJECT METHODS --> | |
745 <!-- OBJECT EVENT FIELDS --> | |
746 <!-- FUNCTION PARAMETERS --> | |
747 </div> | |
748 </div><div> | |
749 <div> | |
750 <dt> | |
751 <var>params</var> | |
752 <em> | |
753 <!-- TYPE --> | |
754 <div style="display:inline"> | |
755 ( | |
756 <span class="optional">optional</span> | |
757 <span id="typeTemplate"> | |
758 <span> | |
759 <span>object</span> | |
760 </span> | |
761 </span> | |
762 ) | |
763 </div> | |
764 </em> | |
765 </dt> | |
766 <dd>JSON object with the response. Structure of the response varies de
pending on the method and is defined by the remote debugging protocol.</dd> | |
767 <!-- OBJECT PROPERTIES --> | |
768 <!-- OBJECT METHODS --> | |
769 <!-- OBJECT EVENT FIELDS --> | |
770 <!-- FUNCTION PARAMETERS --> | |
771 </div> | |
772 </div> | |
773 </dl> | |
774 </div> | |
775 <!-- EXTRA PARAMETERS --> | |
776 <!-- LISTENER RETURN VALUE --> | |
777 <dl> | |
778 </dl> | |
779 </div> <!-- /description --> | |
780 <!-- /description --> | |
781 </div> <!-- /apiItem --> | |
782 </div> <!-- /apiGroup --> | |
783 <!-- TYPES --> | |
784 <div class="apiGroup"> | |
785 <a name="types"></a> | |
786 <h3 id="types">Types</h3> | |
787 <!-- iterates over all types --> | |
788 <div class="apiItem"> | |
789 <a name="type-Debuggee"></a> | |
790 <h4>Debuggee</h4> | |
791 <div> | |
792 <dt> | |
793 <em> | |
794 <!-- TYPE --> | |
795 <div style="display:inline"> | |
796 ( | |
797 <span id="typeTemplate"> | |
798 <span> | |
799 <span>object</span> | |
800 </span> | |
801 </span> | |
802 ) | |
803 </div> | |
804 </em> | |
805 </dt> | |
806 <dd>Debuggee identifier.</dd> | |
807 <!-- OBJECT PROPERTIES --> | |
808 <dd> | |
809 <dl> | |
810 <div> | |
811 <div> | |
812 <dt> | |
813 <var>tabId</var> | |
814 <em> | |
815 <!-- TYPE --> | |
816 <div style="display:inline"> | |
817 ( | |
818 <span id="typeTemplate"> | |
819 <span> | |
820 <span>integer</span> | |
821 </span> | |
822 </span> | |
823 ) | |
824 </div> | |
825 </em> | |
826 </dt> | |
827 <dd>The id of the tab which you intend to debug.</dd> | |
828 <!-- OBJECT PROPERTIES --> | |
829 <!-- OBJECT METHODS --> | |
830 <!-- OBJECT EVENT FIELDS --> | |
831 <!-- FUNCTION PARAMETERS --> | |
832 </div> | |
833 </div> | |
834 </dl> | |
835 </dd> | |
836 <!-- OBJECT METHODS --> | |
837 <!-- OBJECT EVENT FIELDS --> | |
838 <!-- FUNCTION PARAMETERS --> | |
839 </div> | |
840 </div> <!-- /apiItem --> | |
841 </div> <!-- /apiGroup --> | |
842 </div> <!-- /apiPage --> | |
843 </div> <!-- /gc-pagecontent --> | |
844 </div> <!-- /g-section --> | |
845 </div> <!-- /codesiteContent --> | |
846 <div id="gc-footer" --=""> | |
847 <div class="text"> | |
848 <p> | |
849 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
850 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
851 Attribution 3.0 License</a>, and code samples are licensed under the | |
852 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
853 </p> | |
854 <p> | |
855 ©2011 Google | |
856 </p> | |
857 <!-- begin analytics --> | |
858 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
859 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
860 <script type="text/javascript"> | |
861 // chrome doc tracking | |
862 try { | |
863 var engdocs = _gat._getTracker("YT-10763712-2"); | |
864 engdocs._trackPageview(); | |
865 } catch(err) {} | |
866 // code.google.com site-wide tracking | |
867 try { | |
868 _uacct="UA-18071-1"; | |
869 _uanchor=1; | |
870 _uff=0; | |
871 urchinTracker(); | |
872 } | |
873 catch(e) {/* urchinTracker not available. */} | |
874 </script> | |
875 <!-- end analytics --> | |
876 </div> | |
877 </div> <!-- /gc-footer --> | |
878 </div> <!-- /gc-container --> | |
879 </body></html> | |
OLD | NEW |