Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: chrome/browser/resources/workers/index.html

Issue 7250004: Expose list of all running shared workers at chrome://workers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed blank line Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/workers_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <title>Workers</title>
3 <style>
4 thead {
5 background: #E0ECFF;
6 }
7 td {
8 padding: 0 15px 0 15px;
9 }
10
11 </style>
12 <script>
13 function requestData() {
14 var xhr = new XMLHttpRequest();
15 xhr.open('GET', 'workers_data.json', false);
16 xhr.send(null);
17 if (xhr.status === 200)
18 return JSON.parse(xhr.responseText);
19 return [];
20 }
21
22 function addColumn(row, value) {
23 var column = document.createElement("td");
24 column.textContent = value;
25 row.appendChild(column);
26 }
27
28 function populateWorkerList() {
29 var data = requestData();
30
31 var worker_properties = ["id", "url", "name", "pid"];
32
33 var list = document.getElementById("workers-table");
34 for (var i = 0; i < data.length; i++) {
35 var workerData = data[i];
36 var row = document.createElement("tr");
37 for (var j = 0; j < worker_properties.length; j++) {
pfeldman 2011/07/04 10:17:57 no need for {
yurys 2011/07/04 10:23:22 Done.
38 addColumn(row, workerData[worker_properties[j]]);
39 }
40
41 var column = document.createElement("td");
42 var link = document.createElement("a");
43 link.setAttribute("href", workerData.url);
44 link.textContent = "inspect";
45 column.appendChild(link);
46 row.appendChild(column);
47
48 list.appendChild(row);
49 }
50 }
51 </script>
52 <body onload="populateWorkerList()">
53 <h2>Shared workers:</h2>
54 <table>
55 <thead>
56 <tr>
57 <th>Id</th>
58 <th>URL</th>
59 <th>Name</th>
60 <th>Process id</th>
61 </tr>
62 </thead>
63 <tbody id="workers-table">
64 </tbody>
65 </table>
66 </body>
67 </html>
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/workers_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698