← Back to release summary

Persistent Widgets

Category
DOM
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

Persistent widgets are embedded browsing contexts, like iframes, but they can persist across same-origin navigations without reloading. Persistent widgets can be used via the <persistentwidget> HTML element. The <persistentwidget> HTML element takes a src attribute, like an iframe. In order to make the <persistentwidget> survive a navigation, all of these conditions must be met: 1. The navigation must be to a same-origin document. 2. The <persistentwidget> element must have the same src and id HTML attributes in both documents. 3. The <persistentwidget> element must be attached to the new document before its first render.

Motivation

Hard navigations of top-level documents result in the destruction of all the child iframes of those documents. In cases of same-origin navigations, there's high likelihood that at least some of those iframes would need to be recreated on the new document. For iframes maintaining complex client-side state (e.g. chat widgets, media players, collaborative editing sessions, payment flows, embedded third-party apps), that results in loss of state and user-visible performance implications. This significantly disadvantages MPA architectures (that rely on hard same-origin navigations) compared to SPA architectures, that can soft-navigate parts of the document while leaving the iframes intact. That is particularly problematic for the use-case of in-page agents, and runs a risk of causing web developers to prefer SPAs due to that, despite potential performance and maintenance costs related to that preference.

Standards & signals

Ecosystem

Explainers: https://github.com/WICG/persistent-iframes

View on chromestatus.com