It actually depends on the browser. For example, mobile browsers are less likely to put different embedded iframes in separate threads/processes due to the compute overhead.
But as of early 2021, there is now the (weirdly named) Origin-Agent-Cluster
header which allows you to explicitely request dedicated resources for an iframe. It is currently supported on Chrome (88+) with positive reception from Mozilla and Safari.
Origin-Agent-Cluster is a new HTTP response header that instructs the browser to prevent synchronous scripting access between same-site cross-origin pages. Browsers may also use Origin-Agent-Cluster as a hint that your origin should get its own, separate resources, such as a dedicated process.
[...] For example, if https://customerservicewidget.example.com
expects to use lots of resources for video chat, and will be embedded on various origins throughout https://*.example.com
, the team maintaining that widget could use the Origin-Agent-Cluster header to try to decrease their performance impact on embedders.
To use the Origin-Agent-Cluster header, configure your web server to send the following HTTP response header: Origin-Agent-Cluster: ?1
The value of ?1
is the structured header syntax for a boolean true value.
More details here: https://web.dev/origin-agent-cluster/