Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Dec 13, 2016
1 parent af48478 commit f7ce828
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
8 changes: 4 additions & 4 deletions lighthouse-core/report/report-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ class ReportGenerator {
* @return {string}
*/
getReportJS() {
const scriptSrc = fs.readFileSync(path.join(__dirname, './scripts/lighthouse-report.js'), 'utf8');
return `<script>${scriptSrc}</script>`;
return fs.readFileSync(path.join(__dirname, './scripts/lighthouse-report.js'), 'utf8');
}

/**
Expand Down Expand Up @@ -228,10 +227,12 @@ class ReportGenerator {
/**
* Generates the Lighthouse report HTML.
* @param {!Object} results Lighthouse results.
* @param {!string} reportContext Where the report is going
* @param {!string} reportContext What app is requesting the report (eg. devtools, extension)
* @returns {string} HTML of the report page.
*/
generateHTML(results, reportContext) {
reportContext = reportContext || 'extension';

// Ensure the formatter for each extendedInfo is registered.
Object.keys(results.audits).forEach(audit => {
// Use value rather than key for audit.
Expand Down Expand Up @@ -262,7 +263,6 @@ class ReportGenerator {
});

const template = Handlebars.compile(this.getReportTemplate());
reportContext = reportContext || 'extension'; // could be: devtools, extension

return template({
url: results.url,
Expand Down
11 changes: 3 additions & 8 deletions lighthouse-core/report/templates/report-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@
<meta name="viewport" content="width=device-width">
<title>Lighthouse report: {{ url }}</title>
<style>{{{ css }}}</style>
{{{ script }}}
{{#if script }}
<script>{{{ script }}}</script>
{{/if}}
</head>
<body>

<!--
<script>
// the original results
self.lhresults = {{{ lhresults }}};
</script>
-->

<div class="js-report report">
<section class="report-body">
<div class="report-body__header">
Expand Down

0 comments on commit f7ce828

Please sign in to comment.