3 ms·
Note that postMessage is only allowed same-origin, for privacy reasons (to avoid cross-site tracking). Portals are entirely new browsing contexts, so just as "
by domenicd 6y ago
Note that postMessage is only allowed same-origin, for privacy reasons (to avoid cross-site tracking).
Portals are entirely new browsing contexts, so just as "heavy" as iframes. Iframes are generally not that heavy though (especially compared to modern JS frameworks); I'd encourage you to experiment to see how well portals might work for your use cases.
Allowing hosts to inform the styling of portaled pages is a communications channel, so we don't want to allow that directly (since it makes cross-site tracking easier). That said, a page can tell via JavaScript (by testing `window.portalHost`) whether it's being portaled, and we think it's probably a good idea to extend this to CSS. See https://github.com/WICG/portals/issues/3 https://github.com/WICG/portals/issues/3 . This is one noisy bit, so it shouldn't cause tracking concerns.