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

feat: support adding 'crossorigin' attribute #7301

Closed
tzachov opened this issue Aug 8, 2017 · 5 comments
Closed

feat: support adding 'crossorigin' attribute #7301

tzachov opened this issue Aug 8, 2017 · 5 comments
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@tzachov
Copy link

tzachov commented Aug 8, 2017

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

@angular/cli: 1.3.0-rc.5
node: 6.11.0
os: win32 x64

Desired functionality.

Add a build/serve option that adds crossorigin="anonymous" to generated script and style tags.
Adding this attribute will make the request without cookies which are probably an unnecessary overhead on these requests.

This feature can be used if there's no option to use a cookie-less domain.

@Brocco Brocco added the P5 The team acknowledges the request but does not plan to address it, it remains open for discussion label Aug 18, 2017
@hansl hansl removed their assignment Feb 6, 2018
@axelboc
Copy link

axelboc commented Dec 21, 2018

My app's assets are hosted on a CDN. I pass the CDN's URL with the --deploy-url option.

I think the lack of attribute crossorigin on the generated script tags means that I get a Script error any time an error is thrown in one of the bundles.

https://scotch.io/bar-talk/what-the-heck-is-script-error

@alan-agius4
Copy link
Collaborator

Hi, for this you can use the subresource-integrity flag which also enables the use of subresource integrity validation.

https://angular.io/cli/build

@axelboc
Copy link

axelboc commented Feb 5, 2019

Not sure how this relates to subresource integrity, sorry.

@clydin
Copy link
Member

clydin commented Feb 5, 2019

The crossorigin attributes are added to scripts when the SRI option is enabled. This allows for useful error messaging within the browser console. The attribute controls the presence of error information for "classic" scripts (i.e., not type="module"). No credentials should be sent if the attribute is not present (spec reference) since the "missing default value" is no CORS which would cause a credential mode of "omit".

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests

6 participants