The docs (https://www.atom.pe/docs/api/sandbox-option/) say we should be using the browser-native `window.open` implementation, but in practice that appears very much false. Electron, no matter our set of options, appears to always make a hit to the ipcRenderer with `window.open` calls, causing the calling code to explode due to the sandbox making that impossible.
By using `app.enableSandbox()`, it puts the sandbox in place over all BrowserWindow objects, including the temporary ones which empirically are being created for `window.open`. We do not need to specify `sandbox: true` to the BrowserWindow with this approach, though uncommenting and therefore reintroducing the flag causes our lovely ipcRenderer error again.
As far as I can tell, the sandbox does actually get applied to the window though the fact that `sandbox: true` still does things despite the docs saying otherwise leaves me a bit uncomfortable.
Fixes https://github.com/vector-im/riot-web/issues/13719
This does two things related to search paths:
- also search for webapp symlink in the case of packaged applications
(e.g. Archlinux used to provide a symlink this way, linking to a
riot-web copy installed elsewhere, instead of creating an asar of it)
- also take dirname(asarPath) as a valid resources path, as this is how
riot-desktop currently is packaged. Fixesvector-im/riot-web#13190.
The react-sdk doesn't await the closing of the event index, this is done
so because of limitations in the lifecycle module. This wasn't a problem
since we used to just set the eventIndex variable to null. Nowadays we
wait for Tantivy to shutdown using a close() method on the index.
To avoid this being called multiple times while we're already closing the
index set the eventIndex variable to null before awaiting.
This fixes https://github.com/vector-im/riot-web/issues/12838.
A couple of changes to properties rather than functions and the
register*Protocol functionsd are now synchronous and so don't need
a completion callback.
None of this will work as it will need tweaking (at the very least
I've not copied the origin migrator because that's had long enough)
but these are files which already existed in their current state and
so don't need re-reviewing.