Skip to content

IframeWindow Close function optimize #2192

@xplloveyxl

Description

@xplloveyxl
Image

close() { var _a; if (this._frame) { if (this._frame.parentNode) { this._frame.addEventListener("load", (ev) => { var _a2; const frame = ev.target; // Give the browser a moment to complete the load before removing the frame setTimeout(() => { (_a2 = frame.parentNode) == null ? void 0 : _a2.removeChild(frame); void this._abort.raise(new Error("IFrame removed from DOM")); }) // (_a2 = frame.parentNode) == null ? void 0 : _a2.removeChild(frame); // void this._abort.raise(new Error("IFrame removed from DOM")); }, true); (_a = this._frame.contentWindow) == null ? void 0 : _a.location.replace("about:blank"); } this._frame = null; } this._window = null; }

In some webviews, not using setTimeout can lead to out-of-memory (OOM) issues. I hope you can optimize it.
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions