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

Fixed dynamic retrieval of nonce attribute #223

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

MathiasWP
Copy link
Contributor

I got this error:
Screenshot 2021-11-16 at 11 22 24

Which was thrown here:
Screenshot 2021-11-16 at 11 23 52

So i tried to check how the nonce value was retrieved:

nonce = nonceElement.getAttribute('nonce');

Which violates the rules for accessing nonce: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce#accessing_nonces_and_nonce_hiding

Changing the line from

nonce = nonceElement.getAttribute('nonce');

to

nonce = nonceElement.nonce

seems to fix the issue.

Copy link
Owner

@guybedford guybedford left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and pointing out the issue! Unfortunately it seems to be failing in older Firefox versions. I'm landing a possible correction now, let's see if that fixes the CI.

src/options.js Outdated Show resolved Hide resolved
@guybedford guybedford merged commit cf6cd44 into guybedford:main Nov 16, 2021
@MathiasWP MathiasWP deleted the nonce-access-fix branch November 16, 2021 11:44
@guybedford
Copy link
Owner

Released in 1.3.2.

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.

2 participants