Skip to content

Commit

Permalink
Add description to extension error reporting issue title (GoogleChrom…
Browse files Browse the repository at this point in the history
  • Loading branch information
olingern authored and andrewrota committed Jan 13, 2017
1 parent de9d0d7 commit 89ebd9e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lighthouse-extension/app/src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ document.addEventListener('DOMContentLoaded', _ => {
const optionsList = document.body.querySelector('.options__list');
const okButton = document.getElementById('ok');

const MAX_ISSUE_ERROR_LENGTH = 60;

function getLighthouseVersion() {
return chrome.runtime.getManifest().version;
}
Expand All @@ -53,7 +55,11 @@ document.addEventListener('DOMContentLoaded', _ => {
qsBody += '**Stack Trace**:\n ```' + err.stack + '```';

const base = 'https://github.com/googlechrome/lighthouse/issues/new?';
const title = encodeURI('title=Lighthouse Extension Error');
let titleError = err.message;
if (titleError.length > MAX_ISSUE_ERROR_LENGTH) {
titleError = `${titleError.substring(0, MAX_ISSUE_ERROR_LENGTH - 3)}...`;
}
const title = encodeURI('title=Extension Error: ' + titleError);
const body = '&body=' + encodeURI(qsBody);

reportErrorEl.href = base + title + body;
Expand Down

0 comments on commit 89ebd9e

Please sign in to comment.