-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Defaulting sandboxing to false #13045
Conversation
@MonilBhavsar Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@Luke9389 @Santhosh-Sellavel assigning you as reviewers as you have context about issue and proposed fix |
@smrutiparida mWeb safari should be taken from iOS Simulator & Mweb chrome should be taken from android. Please follow that in future PRs thanks! |
@smrutiparida Can you update the PR Description and test steps, to verify that the console error mentioned in this issue #12492 no longer occurs? Because we are addressing only that console error here! Include a screenshot of the error message. |
Reviewer Checklist
Screenshots/VideosOnly added desktop screenshots only desktop configs are updated, the common app code is untouched! WebMobile Web - ChromeMobile Web - SafariiOSAndroid |
bump @smrutiparida |
Done in the PR description
|
Done @Santhosh-Sellavel . Thanks! |
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.
LGMT, all you @Luke9389!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @chiragsalian in version: 1.2.38-6 🚀
|
Details
Starting from Electron 20, the sandbox is enabled by default for renderer processes. When we run mainWindow as a separate process, the process is sandboxed. The sandbox limits the harm that malicious code can cause by limiting access to most system resources — sandboxed processes can only freely use CPU cycles and memory.
The APIs available in sandbox option to the preload script are limited. However running a preload script contextBridge.js require access to nodeJS modules from the javascript code. This was not a concern since sandbox used to be false by default for Electron <= 20.
We shall hence set sandbox: false in this change. sandbox:false shall enable the Node.js engine and make NodeJS's features such as NodeJS's implementation of module, exports, and require to be accessible directly from the HTML/Javascript page's script context.
The Electron FAQ here explains it https://www.electronjs.org/docs/latest/faq#i-can-not-use-jqueryrequirejsmeteorangularjs-in-electron
More - https://www.electronjs.org/docs/latest/tutorial/sandbox#disabling-the-sandbox-for-a-single-process
https://www.electronjs.org/docs/latest/api/browser-window
electron/forge@6e0a6248
Fixed Issues
$ #12492
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
Verified npm run desktop starting up
Verified all the jest test cases passed successfully
Verify that no errors appear in the JS console
Offline tests
Verified that no JS console errors present.
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android