Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve BrowserWindowConstructorOptions on BrowserWindow #15802

Closed
burtonator opened this issue Nov 21, 2018 · 3 comments
Closed

Preserve BrowserWindowConstructorOptions on BrowserWindow #15802

burtonator opened this issue Nov 21, 2018 · 3 comments

Comments

@burtonator
Copy link

Ideally the BrowserWindowConstructorOptions would be preserved on the BrowserWindow and possibly returned via a getOptions() method or a options member.

This is necessary to make sure a Window can be re-used and that it has the right options.

For example, you can't load a webapp in a Window that requires node modules if nodeIntegration isn't enabled.

Additionally, there are security implications here. This way you could avoid loading a URL if the security on the Window isn't setup properly.

@miniak
Copy link
Contributor

miniak commented Mar 17, 2019

Sorry, closed by mistake

@miniak
Copy link
Contributor

miniak commented Sep 10, 2021

There was actually webContents.browserWindowOptions, which got removed by #28550

@nornagon
Copy link
Member

I think this isn't a great idea; it's better if those options are GC-able, as they can in some circumstances retain somewhat significant resources (e.g. a reference to an icon).

It's also trivial for an app to implement themselves:

const options = { ... options }
const bw = new BrowserWindow(options)
bw.constructorOptions = options

@nornagon nornagon closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants