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

Side by Side Diff: chrome/browser/devtools/frontend/devtools_discovery_page.html

Issue 2109243003: Introduce --remote-debugging-frontend switch for custom remote debugging front-end (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: support absolute path instead of HTTP endpoint Created 4 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
« no previous file with comments | « no previous file | chrome/browser/devtools/remote_debugging_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <title>Inspectable pages</title> 3 <title>Inspectable pages</title>
4 <style> 4 <style>
5 body { 5 body {
6 color: #222; 6 color: #222;
7 font-family: Helvetica, Arial, sans-serif; 7 font-family: Helvetica, Arial, sans-serif;
8 margin: 0; 8 margin: 0;
9 text-shadow: rgba(255, 255, 255, 0.496094) 0px 1px 0px; 9 text-shadow: rgba(255, 255, 255, 0.496094) 0px 1px 0px;
10 } 10 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 function onReady() { 92 function onReady() {
93 if(this.readyState == 4 && this.status == 200) { 93 if(this.readyState == 4 && this.status == 200) {
94 if(this.response != null) 94 if(this.response != null)
95 var responseJSON = JSON.parse(this.response); 95 var responseJSON = JSON.parse(this.response);
96 for (var i = 0; i < responseJSON.length; ++i) 96 for (var i = 0; i < responseJSON.length; ++i)
97 appendItem(responseJSON[i]); 97 appendItem(responseJSON[i]);
98 } 98 }
99 } 99 }
100 100
101 function overrideFrontendUrl(item) {
102 if (window.location.hash) {
103 var overridden_url = window.location.hash.substr(1);
104 var ws_suffix = item.webSocketDebuggerUrl.replace('ws://', 'ws=');
105 if (overridden_url.indexOf('?') == -1)
106 return overridden_url + '?' + ws_suffix;
107 else
108 return overridden_url + '&' + ws_suffix;
109 }
110 return item.devtoolsFrontendUrl;
111 }
112
113 function appendItem(item_object) { 101 function appendItem(item_object) {
114 var item_element; 102 var item_element;
115 if (item_object.devtoolsFrontendUrl) { 103 if (item_object.devtoolsFrontendUrl) {
116 item_element = document.createElement('a'); 104 item_element = document.createElement('a');
117 item_element.href = overrideFrontendUrl(item_object); 105 item_element.href = item_object.devtoolsFrontendUrl;
118 item_element.title = item_object.title; 106 item_element.title = item_object.title;
107 item_element.addEventListener('click', onItemClicked.bind(null, item_element .href));
119 } else { 108 } else {
120 item_element = document.createElement('div'); 109 item_element = document.createElement('div');
121 item_element.className = 'connected'; 110 item_element.className = 'connected';
122 item_element.title = 'The tab already has an active debug session'; 111 item_element.title = 'The tab already has an active debug session';
123 } 112 }
124 item_element.classList.add('item'); 113 item_element.classList.add('item');
125 114
126 var thumbnail = document.createElement('div'); 115 var thumbnail = document.createElement('div');
127 thumbnail.className = 'thumbnail'; 116 thumbnail.className = 'thumbnail';
128 thumbnail.style.cssText = 'background-image:url(' + 117 thumbnail.style.cssText = 'background-image:url(' +
(...skipping 12 matching lines...) Expand all
141 130
142 var subtitle = document.createElement('div'); 131 var subtitle = document.createElement('div');
143 subtitle.className = 'subtitle'; 132 subtitle.className = 'subtitle';
144 subtitle.textContent = (item_object.url || '').substring(0, 300); 133 subtitle.textContent = (item_object.url || '').substring(0, 300);
145 description.appendChild(subtitle); 134 description.appendChild(subtitle);
146 135
147 item_element.appendChild(description); 136 item_element.appendChild(description);
148 137
149 document.getElementById('items').appendChild(item_element); 138 document.getElementById('items').appendChild(item_element);
150 } 139 }
140
141 function onItemClicked(url, event) {
142 fetch("/json/new?" + url);
143 event.preventDefault();
144 event.stopPropagation();
145 }
146
151 </script> 147 </script>
152 </head> 148 </head>
153 <body onload='onLoad()'> 149 <body onload='onLoad()'>
154 <div id='caption'>Inspectable pages</div> 150 <div id='caption'>Inspectable pages</div>
155 <hr> 151 <hr>
156 <div id='items'> 152 <div id='items'>
157 </div> 153 </div>
158 </body> 154 </body>
159 </html> 155 </html>
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/remote_debugging_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698