Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Discussion: access to globals from components #33

Open
dvoytenko opened this issue Jul 23, 2020 · 0 comments
Open

Discussion: access to globals from components #33

dvoytenko opened this issue Jul 23, 2020 · 0 comments

Comments

@dvoytenko
Copy link
Contributor

Some globals are ok, such as IntersectionObserver, etc. But many could be harmful for components running inside friendly iframes. For instance window.location.href could be different from component.baseElement.ownerDocument.defaultView.location.href. Some specific points:

  • A component running inside a friendly iframe could have a completely different baseURI and thus could be resolving URLs incorrectly.
  • Use of global setTimeout, setInterval, and event listeners (e.g. window.onresize) could cause memory leaks when a friendly iframe is removed.
  • Rare, but if a component needs to call document.querySelector() and would do it on a wrong document, it won't find what's it looking for.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant