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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js

Issue 2888263002: DevTools: Roll Lighthouse binary to 2.0.1-alpha.0 (Closed)
Patch Set: include exception message in dialog prompt Created 3 years, 7 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 | third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Audits2.Audits2Panel = class extends UI.PanelWithSidebar { 8 Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
9 constructor() { 9 constructor() {
10 super('audits2'); 10 super('audits2');
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 this._hideDialog(); 253 this._hideDialog();
254 } 254 }
255 255
256 /** 256 /**
257 * @param {!Error} err 257 * @param {!Error} err
258 */ 258 */
259 _renderBugReport(err) { 259 _renderBugReport(err) {
260 console.error(err); 260 console.error(err);
261 this._statusElement.textContent = ''; 261 this._statusElement.textContent = '';
262 this._statusIcon.classList.add('error'); 262 this._statusIcon.classList.add('error');
263 this._statusElement.createTextChild(Common.UIString('We ran into an error. ' )); 263 this._statusElement.createTextChild(Common.UIString('Ah, sorry! We ran into an error: '));
264 this._statusElement.createChild('em').createTextChild(err.message);
264 this._createBugReportLink(err, this._statusElement); 265 this._createBugReportLink(err, this._statusElement);
265 } 266 }
266 267
267 /** 268 /**
268 * @param {!Error} err 269 * @param {!Error} err
269 * @param {!Element} parentElem 270 * @param {!Element} parentElem
270 */ 271 */
271 _createBugReportLink(err, parentElem) { 272 _createBugReportLink(err, parentElem) {
272 var baseURI = 'https://github.com/GoogleChrome/lighthouse/issues/new?'; 273 var baseURI = 'https://github.com/GoogleChrome/lighthouse/issues/new?';
273 var title = encodeURI('title=DevTools Error: ' + err.message.substring(0, 60 )); 274 var title = encodeURI('title=DevTools Error: ' + err.message.substring(0, 60 ));
274 275
275 var qsBody = ''; 276 var issueBody = `
276 qsBody += '**Initial URL**: ' + this._inspectedURL + '\n'; 277 **Initial URL**: ${this._inspectedURL}
277 qsBody += '**Chrome Version**: ' + navigator.userAgent.match(/Chrome\/(\S+)/ )[1] + '\n'; 278 **Chrome Version**: ${navigator.userAgent.match(/Chrome\/(\S+)/)[1]}
278 qsBody += '**Error Message**: ' + err.message + '\n'; 279 **Error Message**: ${err.message}
279 qsBody += '**Stack Trace**:\n ```' + err.stack + '```'; 280 **Stack Trace**:
280 var body = '&body=' + encodeURI(qsBody); 281 \`\`\`
282 ${err.stack}
283 \`\`\`
284 `;
285 var body = '&body=' + encodeURI(issueBody.trim());
phulce 2017/05/18 04:33:01 we should use `encodeURIComponent`, just ran into
281 286
282 var reportErrorEl = parentElem.createChild('a', 'audits2-link audits2-report -error'); 287 var reportErrorEl = parentElem.createChild('a', 'audits2-link audits2-report -error');
283 reportErrorEl.href = baseURI + title + body; 288 reportErrorEl.href = baseURI + title + body;
284 reportErrorEl.textContent = Common.UIString('Report this bug'); 289 reportErrorEl.textContent = Common.UIString('Report this bug');
285 reportErrorEl.target = '_blank'; 290 reportErrorEl.target = '_blank';
286 } 291 }
287 292
288 /** 293 /**
289 * @param {!DataTransfer} dataTransfer 294 * @param {!DataTransfer} dataTransfer
290 */ 295 */
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 return; 647 return;
643 648
644 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, undefined, detailsItem.snippet); 649 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, undefined, detailsItem.snippet);
645 origElement.title = ''; 650 origElement.title = '';
646 origElement.textContent = ''; 651 origElement.textContent = '';
647 origElement.appendChild(element); 652 origElement.appendChild(element);
648 }); 653 });
649 }); 654 });
650 } 655 }
651 }; 656 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698