-
Notifications
You must be signed in to change notification settings - Fork 16.2k
feat: add property support for remainder of BrowserWindow #22771
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
Conversation
2d554df
to
5d45bf3
Compare
Should the properties be put in |
I think we should probably write a helper to automatically generate the setter/getters, since the pattern is fixed. |
And we should define the property on the prototype instead of |
@zcbenz the problem is that it's fixed but not quite fixed enough, for example:
seems like it should be
Results in this error: which is why i took the approach i did |
This is reasonable.
The correct way should be: Object.defineProperty(BrowserWindow.prototype, 'title', {
get: function () { return this.getTitle() },
set: function (title) { this.setTitle(title) }
}) The point is to use |
5d45bf3
to
6052a74
Compare
6052a74
to
f8bbf5f
Compare
f8bbf5f
to
444ff17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Release Notes Persisted
|
…2771) Adds property-based support for the remainder of primitive gette/setter pairs on `BrowserWindow`. Namely: - `win.simpleFullScreen` - `win.title` - `win.visibleOnAllWorkspaces` - `win.documentEdited` - `win.representedFilename` - `win.shadow` - `win.kiosk` - `win.menuBarVisible`
/trop run backport-to 9-x-y |
The backport process for this PR has been manually initiated - |
I was unable to backport this PR to "9-x-y" cleanly; |
@codebytere has manually backported this PR to "9-x-y", please check out #23208 |
Description of Change
Adds property-based support for the remainder of primitive gette/setter pairs on
BrowserWindow
.Namely:
win.simpleFullScreen
win.title
win.visibleOnAllWorkspaces
win.documentEdited
win.representedFilename
win.shadow
win.kiosk
win.menuBarVisible
cc @electron/wg-api
Checklist
npm test
passesRelease Notes
Notes: Added support for property access to some getter/setter pairs on
BrowserWindow
.