Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(csp-xss): csp evaluator npm module #12221

Merged
merged 6 commits into from
Mar 16, 2021
Merged

core(csp-xss): csp evaluator npm module #12221

merged 6 commits into from
Mar 16, 2021

Conversation

adamraine
Copy link
Member

npm module is published #12044 (comment)

We can get rid of the google3 binary and the irregular method of importing.

Reduces devtools bundle size by ~45KB.

@adamraine adamraine requested a review from a team as a code owner March 8, 2021 21:04
@adamraine adamraine requested review from paulirish and removed request for a team March 8, 2021 21:04
@google-cla google-cla bot added the cla: yes label Mar 8, 2021
@adamraine adamraine changed the title core(csp-xss): use the csp evaluator npm module core(csp-xss): csp evaluator npm module Mar 8, 2021
@@ -16,63 +15,6 @@ const {

/* eslint-env jest */

describe('Evaluator compatibility', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just a sanity check since the previous method of importing CSP evaluator was irregular. We shouldn't need it now.

Comment on lines -135 to -137
const results = [
...findings.map(this.findingToTableItem),
];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

/**
* @param {string[]} rawCsps
*/
function evaluateRawCspForFailures(rawCsps) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helper functions added so i didn't need to change every single test case.

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two minor things but otherwise lgtm

lighthouse-core/audits/csp-xss.js Show resolved Hide resolved
lighthouse-core/audits/csp-xss.js Show resolved Hide resolved
@devtools-bot devtools-bot merged commit 8d38cb5 into master Mar 16, 2021
@devtools-bot devtools-bot deleted the csp-eval-npm branch March 16, 2021 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants