angular / universal

Server-side rendering and Prerendering for Angular
MIT License
4.04k stars 483 forks source link

feat(common): add missing globals #992

Closed CaerusKaru closed 1 year ago

CaerusKaru commented 6 years ago

I'm submitting a ...

- [ ] bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
- [x] feature request
- [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question

What modules are related to this Issue?

- [ ] aspnetcore-engine
- [x] common
- [ ] express-engine
- [ ] hapi-engine
- [ ] module-map-ngfactory-loader

Current behavior?

Globals like document and window are available in Domino, but are not patched before app render

Expected behavior?

These globals should be available to applications and libraries during render, via a proxy patch (so that each request gets its own document and window)

Minimal reproduction with instructions

Access document.body in any part of the application

Environment:

@nguniversal versions

friday commented 6 years ago

We (mostly me) talked about this issue in: https://github.com/video-dev/hls.js/pull/1841#issuecomment-408563367

This information could be relevant to you as well (the caveats part). Or if you disagree with them, you could tell me why I'm wrong 😉

Also see

alan-agius4 commented 1 year ago

Closing as accessing document and window directly is not recommended and should not be encouraged.

angular-automatic-lock-bot[bot] commented 1 year ago

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.