3 <title>Inspectable pages
</title>
6 background-color: rgb(
245,
245,
245);
7 font-family: Helvetica, Arial, sans-serif;
8 text-shadow: rgba(
255,
255,
255,
0.496094)
0px
1px
0px;
25 -webkit-box-orient: horizontal;
26 -webkit-box-lines: multiple;
31 text-decoration: initial;
35 background-attachment: scroll;
36 background-origin: padding-box;
37 background-repeat: no-repeat;
38 border:
4px solid rgba(
184,
184,
184,
1);
42 -webkit-transition-property: background-color, border-color;
43 -webkit-transition: background-color
0.15s,
0.15s;
44 -webkit-transition-delay:
0,
0;
48 background-color: rgba(
242,
242,
242,
1);
49 border-color: rgba(
110,
116,
128,
1);
53 .thumbnail.connected {
57 .thumbnail.connected:hover {
58 border-color: rgba(
184,
184,
184,
1);
59 color: rgb(
110,
116,
128);
63 display: inline-block;
72 background: no-repeat
0;
73 background-size:
16px;
75 margin:
4px
0px
0px
4px;
77 padding:
2px
0px
0px
20px;
79 text-overflow: ellipsis;
87 var tabsListRequest
= new XMLHttpRequest();
88 tabsListRequest
.open('GET', '/json/list', true);
89 tabsListRequest
.onreadystatechange
= onReady
;
90 tabsListRequest
.send();
94 if(this.readyState
== 4 && this.status
== 200) {
95 if(this.response
!= null)
96 var responseJSON
= JSON
.parse(this.response
);
97 for (var i
= 0; i
< responseJSON
.length
; ++i
)
98 appendItem(responseJSON
[i
]);
102 function overrideFrontendUrl(item
) {
103 if (window
.location
.hash
) {
104 var overridden_url
= window
.location
.hash
.substr(1);
105 var ws_suffix
= item
.webSocketDebuggerUrl
.replace('ws://', 'ws=');
106 if (overridden_url
.indexOf('?') == -1)
107 return overridden_url
+ '?' + ws_suffix
;
109 return overridden_url
+ '&' + ws_suffix
;
111 return item
.devtoolsFrontendUrl
;
114 function appendItem(item_object
) {
116 if (item_object
.devtoolsFrontendUrl
) {
117 frontend_ref
= document
.createElement('a');
118 frontend_ref
.href
= overrideFrontendUrl(item_object
);
119 frontend_ref
.title
= item_object
.title
;
121 frontend_ref
= document
.createElement('div');
122 frontend_ref
.title
= 'The tab already has an active debug session';
124 frontend_ref
.className
= 'frontend_ref';
126 var thumbnail
= document
.createElement('div');
127 thumbnail
.className
= item_object
.devtoolsFrontendUrl
?
128 'thumbnail' : 'thumbnail connected';
129 thumbnail
.style
.cssText
= 'background-image:url(' +
130 item_object
.thumbnailUrl
+
132 frontend_ref
.appendChild(thumbnail
);
134 var text
= document
.createElement('div');
135 text
.className
= 'text';
136 text
.innerText
= item_object
.description
|| item_object
.title
;
137 text
.style
.cssText
= 'background-image:url(' +
138 item_object
.faviconUrl
+ ')';
139 frontend_ref
.appendChild(text
);
141 var item
= document
.createElement('p');
142 item
.className
= 'item';
143 item
.appendChild(frontend_ref
);
145 document
.getElementById('items').appendChild(item
);
149 <body onload='onLoad()'
>
150 <div id='caption'
>Inspectable pages
</div>