Skip to content

Add disposition field to SecurityPolicyViolationEvent #1031

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

Conversation

bsafwen
Copy link

@bsafwen bsafwen commented Jun 28, 2021

lib Update Request

Configuration Check

My compilation target is ES2015 and my lib is ["esnext", "dom"].

Missing / Incorrect Definition

the interface SecurityPolicyViolationEvent is missing the disposition field.

Sample Code

private checkSecPolicyViolation(event: SecurityPolicyViolationEvent) {
    if (event.disposition === 'report') return "not important";
    else if (event.disposition === 'enforce') return "something needs to be done";
}

Documentation Link

According to https://www.w3.org/TR/CSP3/#violation-events, the interface SecurityPolicyViolationEvent has a field called disposition. This field is present in Chrome, Firefox, Safari.

@bsafwen bsafwen requested a review from sandersn as a code owner June 28, 2021 16:55
"name": "disposition",
"default": "\"\"",
"type": "DOMString",
"type-original": "DOMString"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this manually added to the JSON? It might get removed by the next update

Copy link
Author

Choose a reason for hiding this comment

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

Hello @orta, yes I manually added otherwise npm run test fails. I am totally new to this, if you can tell me what is the correct way to do it I will be grateful.

Copy link
Author

Choose a reason for hiding this comment

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

This is the error I get:
image

Copy link
Contributor

Choose a reason for hiding this comment

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

There's some good docs in the README on how to update an IDL: https://github.com/microsoft/TypeScript-DOM-lib-generator#contribution-guidelines

Copy link
Author

Choose a reason for hiding this comment

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

Fixed it, thanks.

@bsafwen bsafwen force-pushed the add_dispostion_SecurityPolicyViolationEvent branch 2 times, most recently from 6df7c71 to ed9be74 Compare June 29, 2021 13:18
@bsafwen bsafwen force-pushed the add_dispostion_SecurityPolicyViolationEvent branch from ed9be74 to d2d4439 Compare June 29, 2021 13:19
@saschanaz
Copy link
Contributor

The old BCD filter implementation of the current master branch can't filter the types from Reporting.widl. I'd wait for #1034 instead.

@saschanaz
Copy link
Contributor

Fixed by #1034

@github-actions close

@github-actions github-actions bot closed this Aug 25, 2021
@github-actions
Copy link
Contributor

Closing because @saschanaz is a code-owner of all the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants