Reputation: 309
I use GoldenLayout library with Electron's WebView elements. GoldenLayout manipulates the DOM moving WebView elements around, it is effectively cutting them from one place and pasting them in the other. That makes the Webviews (as well as IFrames) to reload the pages they are presenting. Is there a way to prevent that reload?
Upvotes: 2
Views: 1309
Reputation: 65263
No, I don't think there is. We faced the same problem in VS Code and none of the previously documented iframe reparenting workarounds seem to work any more.
Our solution: replace the webview with a placeholder element and move the webview itself to the root. Then absolute position the webview over the placeholder element, with the webview picking up position and size from the placeholder. Depending on what sort of layout you need, this workaround may or may not be suitable.
Upvotes: 1