3 <title>Content 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
]);
24 function appendItem(item_object
) {
26 if (item_object
.devtoolsFrontendUrl
) {
27 frontend_ref
= document
.createElement("a");
28 frontend_ref
.href
= item_object
.devtoolsFrontendUrl
;
29 frontend_ref
.title
= item_object
.title
;
31 frontend_ref
= document
.createElement("div");
32 frontend_ref
.title
= "The tab already has active debugging session";
35 var text
= document
.createElement("div");
36 if (item_object
.title
)
37 text
.innerText
= item_object
.title
;
39 text
.innerText
= "(untitled tab)";
40 text
.style
.cssText
= "background-image:url(" + item_object
.faviconUrl
+ ")";
41 frontend_ref
.appendChild(text
);
43 var item
= document
.createElement("p");
44 item
.appendChild(frontend_ref
);
46 document
.getElementById("items").appendChild(item
);
50 <body onload='onLoad()'
>
51 <div id='caption'
>Inspectable WebContents
</div>
52 <div id='items'
></div>