oidc-client-ts icon indicating copy to clipboard operation
oidc-client-ts copied to clipboard

IframeWindow Close function optimize

Open xplloveyxl opened this issue 2 months ago • 3 comments

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

xplloveyxl avatar Sep 30 '25 09:09 xplloveyxl

This appears to be a modification of the close() function of IFrameWindow, not PopupWindow. https://github.com/authts/oidc-client-ts/blob/c7765577862f9f4ed337f29cd37b448214dc48ca/src/navigators/IFrameWindow.ts#L58-L71

jcphill avatar Sep 30 '25 10:09 jcphill

Sorry, I made a mistake. It was indeed the close of IframeWindow

xplloveyxl avatar Oct 09 '25 02:10 xplloveyxl

I checked the information and found that the white screen is caused by some lower versions of webviews not being able to enable OOPIF. All that needs to be compatible here, thank you

xplloveyxl avatar Oct 09 '25 04:10 xplloveyxl