-
Notifications
You must be signed in to change notification settings - Fork 821
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
ENH prevent default type in script tag #11446
base: 6
Are you sure you want to change the base?
Conversation
Thanks for submitting this! I've linked an open issue that seems relevant. We don't track PRs attached to closed issues, because closed issues can't go through the columns in our issue tracker. While looking around for information (since the issues just state HTML5 doesn't need it, but don't provide any source), almost everything I found points to rfc9239 and say we should be using Can you please either update this to Please also update the commit prefix to If you'd be willing to update other current references to |
Thank you for the feedback. In HTML5 the <script> element's type attribute defaults to "text/javascript" if it's omitted or an empty string is used.
I am open to update other instances of |
I'll remove it if the new value is the same as the default when omitted, less bytes transferred. |
I don't think there's enough bytes there to make a meaningful difference 😅 but if best practice is to omit the value, we should follow that practice. |
It's like saving a dollar on a million dollar car. One instance is insignificant, over a million cars it's a million. Less burnt coal and oil in the world.. you can definitely see the impact of this 😄 |
…with text/javascript
Description
For 6
application/javascript
should be gone in script tags. A refactoredRequirements_Backend
, that allows nonce (CSP) or flat attributes[], as suggested #9910 (comment) would be preferable. Simply removing it is a minimal change, but improves the current situation.Manual testing steps
Check the HTML source; the type attribute should no longer be present on the <script> tags.
instead of
Issues
type
attribute is unnecessary for JavaScript resources. #8221Pull request checklist