Google Chrome’s Portals: like iframes, but better, and worse.

Google just released support for Portals in Chrome Canary:

What about iframes?

The Chrome team explains that promotable iframes were considered for this job, but passed over. I would argue that’s a mistake; especially if the main reason is implementation effort.

  • Render privileged data that is protected and sandboxed from the parent page
  • Communicate and share data and events in real-time with the parent page

What changes with Portals?

Portals make transitioning to a new page far smoother, using an iframe-like mechanism. But they also take away a lot of the features that make iframes great:

  • Once the new page is activated, the old page apparently ceases to be able to run any code, or communicate with the new portal page
  • Once the portal page has served its purpose, there doesn’t seem to be a way to close it and return control to the parent, without redirecting back or using another portal.

So why not just stick to iframes?

If portals were built out as an extension to iframes, they would have the potential to solve one huge problem for iframe based components: the URL bar.

works for PayPal, as a lead engineer in Checkout. Opinions expressed herein belong to him and not his employer.