You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement a node.js-free, sandboxed, context isolated renderer Β #92164
We want to explore a model where the workbench in Electron does not access node.js APIs. In that model the Electron renderer process runs in sandboxed mode, much like any browser tab would do. Privileged code has to either move into a backend process and be accessible via IPC communication or into a preload script that exposes certain methods to the page.
common/browser: run in BrowserWindow with sandbox: true
node.js/electron-browser: run in ELECTRON_RUN_AS_NODE
Architecture
Reacted by Leo Antunes, Soheil Alizadeh, Nils K, Wang Zishi, Martin Olsansky, Snir Broshi, Mohamed AbouGendy, ztluo, parcelcat, Jonathan Berrisch and 36 more
Reacted by James May, Pine, Mohamed AbouGendy, Yukai Huang, Daniel Jackson, Chayim Refael Friedman, Zero King, Leo Antunes, Soheil Alizadeh, Jonathan Berrisch and 9 more
Reacted by Snir Broshi, Mohamed AbouGendy, a11delavar, Virgiel, TomΓ‘Ε‘ HΓΌbelbauer, Anit Nilay and Gesugao-san
Reacted by Mohamed AbouGendy, a11delavar, Virgiel, TomΓ‘Ε‘ HΓΌbelbauer, Garnet and Gesugao-san
Reacted by Michal Δaplygin, Soheil Alizadeh, Snir Broshi, Mohamed AbouGendy, a11delavar, Virgiel, Daniel Tamkin, Gesugao-san, Vishu, wen and 2 more
An "implict" node-dependency that's not listed here is code loading. Today, the loader uses the fs and vm-modules which allows for v8 cached data usage.
load something like a workbench-sandboxed.html from doGetUrl
this will likely fail early on because of our AMD loader requiring node.js for cached data etc. and some other things we depend on from window.js so we need something like workbench-sandboxed.js and possibly workbench-preload.js that work properly in this mode
instead of vs/workbench/workbench.desktop.main load a vs/workbench/workbench.desktop-sandboxed.mainhere with those things commented out that are not yet adopted
instead of vs/workbench/electron-browser/desktop.main, require a vs/workbench/browser/desktop-sandboxed.mainhere that brings up the workbench without depending on node.js
Benjamin Pasero (@bpasero) we shouldn't mix localization support in the Web with support for Node free renderer. We need a very different story for the Web whereas for a node free renderer we can still install the LP on the local disk. We can simply not access them from the renderer. So I will change the item (I have discussed it that way with Erich Gamma (@egamma) as well)
368f44e enables iframe based webviews on desktop when search functionality is not required. We'll get testing of the iframe based webviews during 1.56 insiders
FYI following up on #116337, I believe the slowness I sometimes see with terminals is a result of the multiple process jumps since we can't communicate directly between the renderer and pty host yet. Was there an issue tracking this direct channel between renderer to arbitrary node process?
I think it is about time to close this one, insider builds are out on all platforms that allow to enable the sandbox via "window.experimental.useSandbox": true and #155827 is a test plan item to verify it works.
Remaining issues are tracked with sandbox label:
sandboxRunning VSCode in a node-free environment
Thinking on the timeline:
enable sandbox by default in insiders in August
enable sandbox by default in stable in September/October pending issues found
π₯
Reacted by Robo, Gulshan, Alexandru Dima, Raymond Zhao and Wenzhao Hu
Activity
jrieken commentedon Mar 9, 2020
An "implict" node-dependency that's not listed here is code loading. Today, the loader uses the
fsandvm-modules which allows for v8 cached data usage.bpasero commentedon Mar 12, 2020
Bootstrap sandboxed workbench code pointers:
sandbox&contextIsolationinwindow.tsworkbench-sandboxed.htmlfromdoGetUrlwindow.jsso we need something likeworkbench-sandboxed.jsand possiblyworkbench-preload.jsthat work properly in this modevs/workbench/workbench.desktop.mainload avs/workbench/workbench.desktop-sandboxed.mainhere with those things commented out that are not yet adoptedvs/workbench/electron-browser/desktop.main, require avs/workbench/browser/desktop-sandboxed.mainhere that brings up the workbench without depending on node.jsdbaeumer commentedon Apr 15, 2020
Benjamin Pasero (@bpasero) we shouldn't mix localization support in the Web with support for Node free renderer. We need a very different story for the Web whereas for a node free renderer we can still install the LP on the local disk. We can simply not access them from the renderer. So I will change the item (I have discussed it that way with Erich Gamma (@egamma) as well)
[-]Exploration: node.js-free, sandboxed renderer [/-][+]node.js-free, sandboxed renderer [/+]12 remaining items
mjbvz commentedon Mar 30, 2021
368f44e enables iframe based webviews on desktop when search functionality is not required. We'll get testing of the iframe based webviews during 1.56 insiders
Switch entirely to iframe based webviews on desktop
Tyriar commentedon Aug 27, 2021
FYI following up on #116337, I believe the slowness I sometimes see with terminals is a result of the multiple process jumps since we can't communicate directly between the renderer and pty host yet. Was there an issue tracking this direct channel between renderer to arbitrary node process?
bpasero commentedon Aug 27, 2021
Daniel Imms (@Tyriar) we had it on our project board, but not as issue. I converted it to one and suggest you ping Deepak about status: #131798
metmeylmz commentedon Oct 31, 2021
sandy081 commentedon Jan 4, 2022
CachedExtensionScanneris owned by Alexandru Dima (@alexdima) and hence removing my name.wzhudev commentedon Feb 18, 2022
Will floating window get supported (or easier to implement) under this new architecture?
bpasero commentedon Feb 18, 2022
No, it should not have any impact on that.
bpasero commentedon Jul 22, 2022
I think it is about time to close this one, insider builds are out on all platforms that allow to enable the sandbox via
"window.experimental.useSandbox": trueand #155827 is a test plan item to verify it works.Remaining issues are tracked withRunning VSCode in a node-free environment
sandboxlabel: sandboxThinking on the timeline:
π₯