Repository navigation
Support window.open() #5043
Description
Activity
I'm not sure it's possible to intercept the webview's
openfunction. Have you tried?- addedawaiting feedbackMore information is required from the requestorMore information is required from the requestor
on Mar 15, 2026 Hi.
In my case, this is the closest I've come to intercepting
window.open()in Go. It's a small proof of concept using WebView2, where the main window interceptswindow.open()and binds it to_blank, opening the child windows as separate processes. This keeps the main window active while still allowing some control over the new windows.You can see it here: https://github.com/yusnelgg/window-open-intercept-go
This is mostly for reference and experimentation.
Reacted by z3db0yThis issue has been automatically marked as stale because it has not had recent activity.
It will be closed if no further activity occurs within the next 10 days.If this issue is still relevant, please add a comment to keep it open.
Thank you for your contributions.- addedstaleIssue has not had recent activity or appears to be solved. Stale issues will be automatically closedIssue has not had recent activity or appears to be solved. Stale issues will be automatically closed
on Aug 3, 2026 Measured data for this issue on macOS, v3.0.0-beta.15 (three runs, consistent), from a minimal
application.New+ oneWebviewWindowapp whose page reports back over a loopback HTTP channel:window.open('https://example.com')returns null- a programmatic click on
<a target="_blank">leaveslocationunchanged 3s later; the page stays alive - in-app window count stays at 1 (200ms poll over
appwindows) - no system-browser reaction: browser process sets unchanged, and with the target swapped for a loopback tripwire server, zero requests arrived — so not even a tab in an already-running browser
- caveat: the click/
window.openhad no user gesture; but the mechanism is source-level — at master9d49e8e,webview_window_darwin.m:993-994implements exactly oneWKUIDelegatemethod (runOpenPanelWithParameters);createWebViewWithConfigurationappears nowhere in the module, and without it WKWebView drops the request silently. On Windows theNewWindowRequestedCOM event exists only as generated interop (internal/webview2/.../corewebview2.go), never subscribed inpkg/application; Linux registers nocreatehandler.
So the three platforms currently do three different things with the same click: macOS silently nothing, Windows a default-chrome WebView2 popup (as described above), Linux nothing.
Production context: our app (gadak) works around this with an HTTP endpoint the frontend calls to open URLs in the system browser — exactly the kind of interception a
Window.OnCreate(url)-style hook (or anOnNewWindow(url) NewWindowActionoption with anOpenInSystemBrowserdefault) would replace.If the shape proposed in this issue is acceptable to the maintainers, I'd be glad to contribute the darwin implementation (delegate method + hook plumbing), in the vein of #6008.
- added a commit that references this issue
on Aug 29, 2026
Is your feature request related to a problem? Please describe.
Wails v3 is coming with multi-window support, however if a window is opened by the frontend using a web API such as
window.open(), it doesn't seem to propagate to the backend.Describe the solution you'd like
Handle windows opened by the webkit context and allow setting their options and size prior to them being displayed, similar to
application.Window.NewWithOptions; something like:Describe alternatives you've considered
The only alternative to this is sending a request to open a window to the backend, and in my case the windows would like to communicate using
postMessage(), so that is not a solution for me.Additional context
Currently,
window.open()seems to simply open a default webview2 window (with the URL bar and default menu key mappings).