Skip to content

fix: do not create node environment in child window if node integration is not enabled - #15076

Merged
zcbenz merged 1 commit into
masterfrom
no-node-integration-in-child-window
Oct 16, 2018
Merged

zcbenz merged 1 commit into
masterfrom
no-node-integration-in-child-window

Conversation

@zcbenz

@zcbenz zcbenz commented Oct 11, 2018 •

Copy link
Copy Markdown
Contributor
Description of Change

Since we don't release Node environments (to avoid crashes), child windows opened with nativeWindowOpen option will have their V8 contexts leaks. This PR avoids creating Node environment in child windows if the node integration is not enabled there.

So this PR serves as a partial fix for #12634, users should make sure node integration is not enabled in the child windows to avoid memory leaks.

As a complete fix for this problem, I propose:

  1. For 4.x, disabling Node integration for child windows opened by nativeWindowOpen.
  2. For 2.x and 3.x, print an error in console notifying users there is leak of memory, and recommend them turning off Node integration.
Checklist
  • PR description included and stakeholders cc'd
  • npm test passes
  • tests are changed or added
  • relevant documentation is changed or added
  • PR title follows semantic commit guidelines
Release Notes

Notes: Partially fix the memory leak when opening child windows with nativeWindowOpen.

@MarshallOfSound

Copy link
Copy Markdown
Member

For 4.x, disabling Node integration for child windows opened by nativeWindowOpen.

We'd have to do that in 5.x to follow semver (deprecate / warn in 4.x)

@zcbenz

zcbenz commented Oct 12, 2018 •

Copy link
Copy Markdown
Contributor Author

Manually backported to 2-0-x and 3-0-x as in above links.

I'll create new PRs that:
for 2.x and 3.x print an warning when users use nativeWindowOpen with node integration enabled in child windows;
for 4.x print a deprecate warning in the same case;
for master disabling Node integration for child windows opened by nativeWindowOpen.

@zcbenz zcbenz changed the title fix: do not enable node integration in child window if not enabled fix: do not create node environment in child window if node integration is not enabled Oct 14, 2018
@zcbenz
zcbenz force-pushed the no-node-integration-in-child-window branch from 486300e to d4c9908 Compare October 16, 2018 00:27

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Conflicting but seems 🆗

@zcbenz
zcbenz force-pushed the no-node-integration-in-child-window branch from d4c9908 to fb36cff Compare October 16, 2018 08:01
@zcbenz
zcbenz merged commit 0252d76 into master Oct 16, 2018
@release-clerk

release-clerk Bot commented Oct 16, 2018

Copy link
Copy Markdown

Release Notes Persisted

Partially fix the memory leak when opening child windows with nativeWindowOpen.

@zcbenz
zcbenz deleted the no-node-integration-in-child-window branch October 16, 2018 09:10
zcbenz added a commit that referenced this pull request Oct 18, 2018
…abled (#15076)"

This reverts commit 0252d76.

This patch is not needed anymore since we are force disabling node integration
for child windows.
zcbenz added a commit that referenced this pull request Oct 25, 2018
…abled (#15076)"

This reverts commit 0252d76.

This patch is not needed anymore since we are force disabling node integration
for child windows.
zcbenz pushed a commit that referenced this pull request Oct 25, 2018
…on (#15213)

* fix: child window with nativeWindowOpen should disable node integration

* Revert "fix: do not enable node integration in child window if not enabled (#15076)"

This reverts commit 0252d76.

This patch is not needed anymore since we are force disabling node integration
for child windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants