Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chromecast / shell / browser / resources / shell_devtools_discovery_page.html
blob00c937473ba1a8a34d744c34a7850724de1ac1bf
1 <html>
2 <head>
3 <title>Cast shell remote debugging</title>
4 <style>
5 </style>
7 <script>
8 function onLoad() {
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();
15 function onReady() {
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) {
27 var frontend_ref;
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;
32 } else {
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;
40 else
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);
50 </script>
51 </head>
52 <body onload='onLoad()'>
53 <div id='caption'>Inspectable WebContents</div>
54 <div id='items'></div>
55 </body>
56 </html>