3 <title>Cast shell remote debugging
</title>
12 <div id='caption'
>Inspectable WebContents
</div>
13 <div id='items'
></div>
16 window
.addEventListener('load', function() {
17 var tabs_list_request
= new XMLHttpRequest();
18 tabs_list_request
.open("GET", "/json/list?t=" + new Date().getTime(), true);
19 tabs_list_request
.onreadystatechange = function() {
20 if (this.readyState
== 4 && this.status
== 200 && this.response
) {
21 var responseJSON
= JSON
.parse(this.response
);
22 for (var i
= 0; i
< responseJSON
.length
; ++i
) {
23 appendItem(responseJSON
[i
]);
27 tabs_list_request
.send();
30 function appendItem(metadata
) {
31 var item_container
= document
.createElement('div');
32 var frontend_header
= document
.createElement('h3');
33 frontend_header
.textContent
= metadata
.title
|| "(untitled tab)";
34 item_container
.appendChild(frontend_header
);
36 if (metadata
.devtoolsFrontendUrl
) {
37 var frontend_link
= document
.createElement('a');
38 frontend_link
.textContent
= 'Remote Debugging (AppEngine)'
39 frontend_link
.href
= metadata
.devtoolsFrontendUrl
;
40 item_container
.appendChild(frontend_link
);
42 frontend_header
.textContent
+= " (already has active debugging session)";
45 document
.getElementById("items").appendChild(item_container
);
51 You may have to select the shield icon in the address bar to establish a connection.
52 See the
<a href=
"https://support.google.com/chrome/answer/1342714?hl=en">help
53 center
</a> for more information.