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

feat: warn when remote is used without enableRemoteModule: true #21546

Merged
merged 2 commits into from Jan 13, 2020

Conversation

nornagon
Copy link
Member

@nornagon nornagon commented Dec 16, 2019

Description of Change

This is the first step of #21408, issuing a warning when using the 'remote' module without enableRemoteModule: true.

Checklist

Release Notes

Notes: Began issuing a deprecation warning when the 'remote' module is used when enableRemoteModule: true isn't explicitly specified. See #21408 for more details.

@nornagon nornagon requested a review from miniak December 16, 2019 21:17
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Dec 16, 2019
@felixrieseberg
Copy link
Member

Looks solid to me, but I wonder if we should add a link. That can happen in a later PR though, I'd first have to write said document.

@nornagon
Copy link
Member Author

@felixrieseberg where should we link to?

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Dec 17, 2019
@@ -321,7 +321,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont

const isRemoteModuleEnabledImpl = function (contents: electron.WebContents) {
const webPreferences = (contents as any).getLastWebPreferences() || {}
return !!webPreferences.enableRemoteModule
return webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : true
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the reason why the default was false is that devtools webContents don’t have webPreferences and the remote module should be disabled there

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, do you have suggestions for how we can detect devtools webcontents but also know whether remote module was explicitly enabled?

Copy link
Contributor

Choose a reason for hiding this comment

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

I can do this in a follow-up PR if I don’t forget

Copy link
Member

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

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

I'm good with this PR, improvements can be continued in other PRs.

@zcbenz zcbenz merged commit 2e1531a into master Jan 13, 2020
@release-clerk
Copy link

release-clerk bot commented Jan 13, 2020

Release Notes Persisted

Began issuing a deprecation warning when the 'remote' module is used when enableRemoteModule: true isn't explicitly specified. See #21408 for more details.

@zcbenz zcbenz deleted the deprecate-remote branch January 13, 2020 06:23
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.

None yet

4 participants