Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow moving a webcontents to a different webview #7157
This adds a guestinstance attribute to webviews. When the webview first loads it updates its guestinstance with the instance ID for the webcontents. Setting the attribute to an existing guestinstance moves the webcontents to the new webview and sends a destroy event on the original webview. This fixes #1871.
This also adds the did-attach event since it is useful for detecting when the move is complete and I think that that fixes #6972 as did-attach is sent for the first navigation too.
Sep 20, 2016
@TimNZ The tests show some examples but basically if you take the value of the guestinstance attribute from an active webview and set it on a different webview, even in a different BrowserWindow, then the content will move to the new webview and the old will receive a destroy event.
Could it be possible to duplicate/clone the webcontents? i.e., not 'destroy' the existing window?
I created an issue for this a few months ago at #6063. Is something like this definitely not feasible? It could be a game-changer for multi-window electron apps if something like this was possible.