question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: support adding 'crossorigin' attribute

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
clydincommented, 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”.

1reaction
axelboccommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML attribute: crossorigin - MDN Web Docs
The crossorigin content attribute on media elements is a CORS settings attribute. These attributes are enumerated, and have the following ...
Read more >
Cross-Browser support with Cross-Origin isolation
Adding cross-browser support for WebContainers is not as easy as you might think. Let's explore the journey of cross-origin isolation ...
Read more >
ECMAScript modules in browsers
If you hit this issue, you can add the crossorigin attribute, which will add credentials to same-origin requests, but not cross-origin ...
Read more >
Cross-Origin Resource Sharing | Can I use... Support ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
CORS Permission Requirement - Amazon SageMaker
If you do not add a CORS configuration to the Amazon S3 buckets that contain your ... sharing with CORS? in the Amazon...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found