8000 fix: make screen wrapper remote-friendly again by andersk · Pull Request #26620 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: make screen wrapper remote-friendly again #26620

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

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

andersk
Copy link
Contributor
@andersk andersk commented Nov 21, 2020

Description of Change

This restores accessibility of screen methods via remote.screen.

Fixes #26610.

Cc @nornagon.

Checklist

Release Notes

Notes: Fixed screen methods not being accessible via remote.screen.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Nov 21, 2020
Copy link
Member
@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of manually listing all APIs / keys of the screen module, can we just implement the ownKeys method of the ES6 proxy.

This restores accessibility of screen methods via remote.screen.

Fixes electron#26610.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@andersk
Copy link
Contributor Author
andersk commented Nov 21, 2020

Only if it doesn’t need to be lazy when used via remote. Given the use case documented in the comment, I guess that’s probably okay.

I had to also implement getOwnPropertyDescriptor for this to work, and implemented has for completeness.

if (_screen === undefined) {
_screen = createScreen();
}
return prop in _screen;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness should this be Reflect.has?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s identical.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Nov 22, 2020
@jkleinsc jkleinsc merged commit b1b2560 into electron:master Nov 23, 2020
@release-clerk
Copy link
release-clerk bot commented Nov 23, 2020

Release Notes Persisted

Fixed screen methods not being accessible via remote.screen.

@trop
Copy link
Contributor
trop bot commented Nov 23, 2020

I have automatically backported this PR to "11-x-y", please check out #26660

@trop
Copy link
Contributor
trop bot commented Nov 23, 2020

I have automatically backported this PR to "12-x-y", please check out #26661

@andersk andersk deleted the screen-remote branch November 24, 2020 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Methods on remote.screen are not defined
5 participants
0