3 <title>Cast shell remote debugging
</title>
9 var tabs_list_request
= new XMLHttpRequest();
10 tabs_list_request
.open("GET", "/json/list?t=" + new Date().getTime(), true);
11 tabs_list_request
.onreadystatechange
= onReady
;
12 tabs_list_request
.send();
16 if(this.readyState
== 4 && this.status
== 200) {
17 if(this.response
!= null) {
18 var responseJSON
= JSON
.parse(this.response
);
19 for (var i
= 0; i
< responseJSON
.length
; ++i
) {
20 appendItem(responseJSON
[i
]);
26 function appendItem(item_object
) {
28 if (item_object
.devtoolsFrontendUrl
) {
29 frontend_ref
= document
.createElement("a");
30 frontend_ref
.href
= item_object
.devtoolsFrontendUrl
;
31 frontend_ref
.title
= item_object
.title
;
33 frontend_ref
= document
.createElement("div");
34 frontend_ref
.title
= "The tab already has active debugging session";
37 var text
= document
.createElement("div");
38 if (item_object
.title
)
39 text
.innerText
= item_object
.title
;
41 text
.innerText
= "(untitled tab)";
42 text
.style
.cssText
= "background-image:url(" + item_object
.faviconUrl
+ ")";
43 frontend_ref
.appendChild(text
);
45 var item
= document
.createElement("p");
46 item
.appendChild(frontend_ref
);
48 document
.getElementById("items").appendChild(item
);
52 <body onload='onLoad()'
>
53 <div id='caption'
>Inspectable WebContents
</div>
54 <div id='items'
></div>