You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
When a window is opened, I would like to know what window opened it.
For example if the window with ID 1 triggered a window.open call, I'd like to know that the window with ID 2 was opened by window 1.
Currently, the referrer information passed to the new-window handler only contains a URL property (which in my case is always '' for some reason).
Proposed Solution
Can the referrer argument get an additional property that tells us the ID of the window that's making the window.open call?
(I'm not sure how this will fit into the new setWindowOpenOverride mechanism)
Alternatively, maybe the BrowserWindow class can have an openerWindowId type of property that gives us this information. That would maybe be preferable.
Alternatives Considered
I can work around it by passing in the window ID like so:
// ... inside of the browser-window-created handler
window.webContents.addListener("new-window", function (): void {
[].push.call(arguments, window.id);
newWindowHandler.apply(null, arguments);
});
The text was updated successfully, but these errors were encountered:
@Plastikmensch Yes, that's solution I proposed at the end. But I would prefer a simple property that would tell me the opener window rather than doing what I did.
In my situation, I do want to allow windows to open windows by default.
Preflight Checklist
Problem Description
When a window is opened, I would like to know what window opened it.
For example if the window with ID 1 triggered a
window.open
call, I'd like to know that the window with ID 2 was opened by window 1.Currently, the
referrer
information passed to thenew-window
handler only contains a URL property (which in my case is always''
for some reason).Proposed Solution
Can the
referrer
argument get an additional property that tells us the ID of the window that's making thewindow.open
call?(I'm not sure how this will fit into the new
setWindowOpenOverride
mechanism)Alternatively, maybe the
BrowserWindow
class can have anopenerWindowId
type of property that gives us this information. That would maybe be preferable.Alternatives Considered
I can work around it by passing in the window ID like so:
The text was updated successfully, but these errors were encountered: