Skip to content

Commit

Permalink
Feature/upgrade electron version and add context isolation+sandboxing…
Browse files Browse the repository at this point in the history
… flags (#1333)

* increase electron to 30.1.2 and adding feature flags for contextIsolation and sandboxing

* renaming config option as they did sound odd

* reordering the config readme
  • Loading branch information
IsmaelMartinez committed Jul 8, 2024
1 parent 64eb125 commit 3e58b20
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Here is the list of available arguments and its usage:
| authServerWhitelist | Set auth-server-whitelist value (string) | * |
| awayOnSystemIdle | Boolean to set the user status as away when system goes idle | false |
| chromeUserAgent | Google Chrome User Agent | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${process.versions.chrome} Safari/537.36 |
| disableContextIsolation | Disable context isolation in the renderer process (this will break functionality) | false |
| disableSandbox | Disable sandbox for the renderer process (this will break functionality) | false |
| contextIsolation | Use context isolation in the renderer process (disabling this will break functionality) | false |
| customBGServiceBaseUrl | Base URL of the server which provides custom background images | http://localhost |
| customBGServiceIgnoreMSDefaults | A boolean flag indicates whether to ignore Microsoft provided images or not | false |
| customBGServiceConfigFetchInterval | A numeric value in seconds as poll interval to download background service config download | 0 |
Expand Down Expand Up @@ -57,6 +56,7 @@ Here is the list of available arguments and its usage:
| optInTeamsV2 | Boolean to opt in to use Teams V2 | false |
| partition | BrowserWindow webpreferences partition | persist:teams-4-linux |
| proxyServer | Proxy Server with format address:port (string) | null |
| sandbox | Sandbox for the renderer process (disabling this will break functionality) | false |
| screenLockInhibitionMethod | Screen lock inhibition method to be used (`Electron`/`WakeLockSentinel`) | *Electron*, WakeLockSentinel |
| spellCheckerLanguages | Array of languages to use with Electron's spell checker | [] |
| ssoBasicAuthUser | Login that will be sent for basic_auth SSO login. (string) | |
Expand Down
20 changes: 10 additions & 10 deletions app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ function argv(configPath, appVersion) {
describe: 'Follow system theme',
type: 'boolean'
},
contextIsolation: {
default: false,
describe: 'Use contextIsolation on the main BrowserWindow (WIP - Disabling this will break most functionaly)',
type: 'boolean'
},
customUserDir: {
default: null,
describe: 'Custom User Directory so that you can have multiple profiles',
Expand Down Expand Up @@ -170,16 +175,6 @@ function argv(configPath, appVersion) {
describe: 'A flag indicates whether to disable mic auto gain or not',
type: 'boolean'
},
disableContextIsolation: {
default: false,
describe: 'Disable context isolation on the main BrowserWindow (WIP - this will break most functionaly)',
type: 'boolean'
},
disableSandbox: {
default: false,
describe: 'Disable the sandbox for the BrowserWindow (WIP - this will break most functionaly)',
type: 'boolean'
},
disableGpu: {
default: false,
describe: 'A flag to disable GPU and hardware acceleration (can be useful if the window remains blank)',
Expand Down Expand Up @@ -283,6 +278,11 @@ function argv(configPath, appVersion) {
describe: 'Proxy Server with format address:port',
type: 'string'
},
sandbox: {
default: false,
describe: 'Sandbox for the BrowserWindow (WIP - disabling this will break most functionaly)',
type: 'boolean'
},
screenLockInhibitionMethod: {
default: 'Electron',
describe: 'Screen lock inhibition method to be used (Electron/WakeLockSentinel)',
Expand Down
4 changes: 2 additions & 2 deletions app/mainAppWindow/browserWindowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class BrowserWindowManager {
partition: this.config.partition,
preload: path.join(__dirname, '..', 'browser', 'index.js'),
plugins: true,
contextIsolation: this.config.disableContextIsolation,
sandbox: this.config.disableSandbox,
contextIsolation: this.config.contextIsolation,
sandbox: this.config.sandbox,
spellcheck: true
},
});
Expand Down
2 changes: 1 addition & 1 deletion com.github.IsmaelMartinez.teams_for_linux.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ul>
<li>Increase electron version to 30.1.2</li>
<li>Fix handleOnCallConnected not calling disable screen lock</li>
<li>Adding disableContextIsolation and disableSandbox config options. These will break most functionality but are added as a WIP to help assessing what it would break</li>
<li>Adding contextIsolation and sandbox config options. These will break most functionality but are added as a WIP to help assessing what it would break</li>
</ul>
</description>
</release>
Expand Down

0 comments on commit 3e58b20

Please sign in to comment.