WICG / performance-measure-memory

performance.measureMemory API
Other
78 stars 13 forks source link

Should measureMemory work on iframes? #16

Closed npm1 closed 3 years ago

npm1 commented 3 years ago

I'm curious what you think about calling performance.measureMemory() from an iframe to get the full page memory - it seems unsafe from a security perspective. Should this API just work on top-level browsing contexts or are there use-cases for calling this on iframes?

ulan commented 3 years ago

The API is available only in the same-origin iframes: https://wicg.github.io/performance-measure-memory/#memory-measurement-allowed-predicate

Calling the API in a cross-origin iframe would throw an exception.