* Turn off node integration in the electron renderer process
* Enable the chromium sandbox to put the renderer into its own process
* Expose just the ipc module with a preload script
* Introduce a little IPC call wrapper so we can call into the
renderer process and await on the result.
* Use this in a bunch of places we previously used direct calls
to electron modules.
* Convert other uses of node, eg. use of process to derive the
platform (just look at the user agent)
* Strip out the desktopCapturer integration which doesn't appear
to have ever worked (probably best to just wait until
getDisplayMedia() is available in chrome at this point:
https://github.com/vector-im/riot-web/issues/4880).
Some of the js-sdk logging was going missing due to js-sdk's
loglevel library being initialised before the rageshake logging.
Fix by doing the rageshake setup within an import, as commented.
I seemingly need babel-eslint version 8 for VectorHomePage.js but might as well just upgrade to version 10
Signed-off-by: Aaron Raimist <aaron@raim.ist>
Now that Olm needs to be inited asynchronously anyway, we can just
pass the options to Olm.init(), and as long as we do that before we
start the js-sdk, we're all good.
This will means the olm js is now part of the main bundle but since
it's now just a wrapper around the wasm, this is probably faster.
Also add the directwatch flag to olm.wasm because otherwise it
doesn't seem to copy the file in watch mode...
Non-functional changes (before I start messing with it).
Switch to import, move code out of the top level, switch to one
consistent way of declaring functions, keep imports at the top.
This if checks if we got a Firefox using a variable that is undefined everywhere except in Firefox. In Firefox because of how it renders the DOM ensure that css is always loaded before it loads/runs the js code. Therefor onload 1. never triggers and 2. we can just call setTheme.
Add add direct dependencies on the packages they come from, because
referring to them by path like this doesn't work in a frash
checkout / npm install because of how npm lays out the packages.
A bug in firefox means "disabled" isn't honoured when set in the
HTML. Doing `a.disabled = false` does work however, and Chrome
also appears to honour this.