Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

nornagon
Copy link
Contributor

@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 recently 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
Contributor Author

@felixrieseberg where should we link to?

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Dec 17, 2019
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
Contributor 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
Contributor

@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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.