Assigns a URL to the iframe of a <sci-router-outlet>
.
Iframe for which to set the URL.
Current navigation.
Previous navigation, if any.
Patches the URL to force Chrome to load the content of the given URL into an iframe.
Chrome browser does not load the content of a nested iframe if already loaded a document from the same origin and path in a parent iframe. The problem does not occur if the URL contains query parameters. Also, the hash fragment of the URL does not matter.
This problem could not be observed in Firefox and Edge.
If using hash-based routing, the microfrontends of an application are served under the same origin and path, and routing is based on the URL hash fragment only. This Chrome issue would prevent a microfrontend from embedding other microfrontends of its application.
If the URL does not contain a query parameter, an arbitrary query parameter is appended to the URL to force Chrome to load the content. The name and value of the query param do not matter. However, it is crucial always to use the same param to allow the browser to cache the request.
The only exception to appending a query param is when replacing an outlet's content with content from the same app. Then, the browser already loaded the application. Otherwise, if appending a query param, the application would load anew.
An alternative (but partial) fix would be to initialize the iframe with a null
source. This fix is partial because only working when setting the initial URL
of the iframe and not when changing it. Also, it has the drawback of temporarily loading the main entry point of the outlet host.
Specifies the URL to be patched.
Specifies the previous URL, if any.
Generated using TypeDoc
Assigns a URL to the iframe of a
<sci-router-outlet>
.