element-hq / element-desktop

A glossy Matrix collaboration client for desktop.
https://element.io
Apache License 2.0
1.13k stars 257 forks source link

Disable field trials #744

Open gerroon opened 4 years ago

gerroon commented 4 years ago

Hi

I am using Riot on Debian and I see that the Riot p[rocesses run with the field trial flags, like the regular Chrome ones. It would be nice if these field trials are disabled since one does not know when Google will turn you into their personal lab hardware.

riot-web --type=gpu-process --field-trial-handle=XXXXXXXX --disable-features=SpareRendererForSitePerProcess

I also use Joplin(another electron app). It does not seem to run with field trials , so this must be doable with an electron app.

turt2live commented 4 years ago

I'm not able to find any information about disabling the flag for electron apps, nor can I find any information on what Jolin is to see if they're doing anything differently. Are you able to provide a bit more information on what we would need to do to fix this?

gerroon commented 4 years ago

Hi

I am not a developer so I cant be any help regarding how to disable this but I know that field trials is something Google run on all Chrome related apps at their own will.

I brought this up because Riot clearly runs with the --field-trial flag. Maybe this is something the Electron developers know about?I assumed that anyone using Electron can disable this during building it.

https://github.com/laurent22/joplin/releases

Here what they about about this "experiment" tool which I say it is a form of spyware

" In Chrome, things are more interesting. Where possible, Chrome rolls out new features dynamically using the Field Trials platform. You can think of Field Trials as a set of server-controlled flags that allow Google to change Chrome’s behavior dynamically, at runtime, without shipping a new version.

We use Field Trials for two major purposes– for experimentation, and for feature rollouts.

Experimentally, we run many experiments where we create one or more experimental groups and then compare telemetry from those clients against a control group. If a feature isn’t performing as expected (e.g. its usage declines vs. the feature it replaces, or browser crashes increase, or memory usage increases or page load slows, etc), the feature is tuned or removed before it officially “ships.” Experiments are often conducted on the pre-release channels (e.g. Canary, Dev, and Beta) before deciding whether or not a feature should be rolled out to the Stable channel. "

turt2live commented 4 years ago

ah, Joplin, not Jolin.

I'm not sure how they do it either - it looks like it could be a build step, but neither of our projects appear to be setting it. Maybe someone who knows what's going on can help.

bpcurse commented 4 years ago

Same issue with the Manjaro Linux build v1.6.2 The Riot desktop client is running with electron field-trial-handles. This shouldn't be, please investigate the cause.

matrix      1333    1307  0 19:09 ?        00:00:19 /usr/lib/electron/electron --type=gpu-process --field-trial-handle=xxx,xxx,xxx --enable-features=WebComponentsV0Enabled --disable-features=SpareRendererForSitePerProcess --gpu-preferences=xxx --shared-files
matrix      1339    1307  0 19:09 ?        00:00:20 /usr/lib/electron/electron --type=utility --field-trial-handle=xxx,xxx,xxx --enable-features=WebComponentsV0Enabled --disable-features=SpareRendererForSitePerProcess --lang=de --service-sandbox-type=network --standard-schemes=vector --secure-schemes=vector --bypasscsp-schemes --cors-schemes --fetch-schemes=vector --service-worker-schemes --shared-files=v8_snapshot_data:100
matrix      1348    1312  0 19:09 ?        00:01:10 /usr/lib/electron/electron --type=renderer --field-trial-handle=xxx,xxx,xxx --enable-features=WebComponentsV0Enabled --disable-features=SpareRendererForSitePerProcess --lang=de --standard-schemes=vector --secure-schemes=vector --bypasscsp-schemes --cors-schemes --fetch-schemes=vector --service-worker-schemes --app-path=/usr/lib/riot/app.asar --enable-sandbox --native-window-open --preload=/usr/lib/riot/app.asar/src/preload.js --background-color=#fff --enable-spellcheck --num-raster-threads=2 --enable-main-frame-before-activation --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files=v8_snapshot_data:100
jryans commented 4 years ago

I believe this is default Chromium behaviour, and is not controlled by Riot or Electron directly. If there's an Electron API or option to disable, we'd be happy to do so, but at the moment I haven't noticed one.

redxef commented 3 years ago

This looks like the relevant switch: https://www.electronjs.org/docs/api/command-line-switches#--force-fieldtrialstrials and should probably be appended after the following location: https://github.com/vector-im/element-desktop/blob/develop/src/electron-main.js#L780