Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Make sure to CSPify main document first, load platform.js first in th…
Browse files Browse the repository at this point in the history
…e output js file.
  • Loading branch information
dfreedm committed Jan 27, 2014
1 parent 1580715 commit c433e0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/vulcan.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ function handleMainDocument() {
}
};

// CSPify main page
$('script').each(fn).remove();

// CSPify imports
var tempoutput = cheerio.load(output);
tempoutput('script').each(fn).remove();
output = tempoutput.html();

// CSPify main page
$('script').each(fn).remove();

// join scripts with ';' to prevent breakages due to EOF semicolon insertion
var script_name = path.basename(options.output, '.html') + '.js';
fs.writeFileSync(path.resolve(options.outputDir, script_name), scripts.join(';' + EOL), 'utf8');
Expand Down

0 comments on commit c433e0e

Please sign in to comment.