Skip to content

Commit

Permalink
Made iFrame unload when WebView url is reset to null
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed Dec 7, 2023
1 parent 073addd commit 8b2559f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import dev.webfx.kit.mapper.peers.javafxgraphics.gwt.html.HtmlNodePeer;
import dev.webfx.kit.mapper.peers.javafxgraphics.gwt.util.HtmlUtil;
import dev.webfx.platform.util.Strings;
import elemental2.dom.CSSProperties;
import elemental2.dom.DomGlobal;
import elemental2.dom.HTMLIFrameElement;
Expand Down Expand Up @@ -72,7 +73,10 @@ public void updateHeight(Number height) {

@Override
public void updateUrl(String url) {
if (url != null) {
if (url == null) {
if (!Strings.isEmpty(iFrame.src))
iFrame.src = "";
} else {
// WebFX proposes different loading mode for the iFrame:
Object webfxLoadingMode = getNode().getProperties().get("webfx-loadingMode");
if ("prefetch".equals(webfxLoadingMode)) { // prefetch mode
Expand Down

0 comments on commit 8b2559f

Please sign in to comment.