Commit Graph

9 Commits

Author SHA1 Message Date
R Midhun Suresh
2d6e087fb0
Merge commit from fork
* Check url with homeserver

* Move check to where access-token is added

* Do IPC comm sparingly

Before, the code would fetch the hs for every request.
Since this needs the whole event-handler dance, it's best we do it only
for the requests that match the media endpoints.

Also added some try..catch since we create URL objects that could
potentially throw

* Check origin instead of just hostname
2024-10-15 12:51:06 +01:00
David Langley
c15014e7a8 Updated Copyright headers 2024-09-06 17:56:18 +01:00
Travis Ralston
8754fa5fa2
Support authenticated media downloads in Desktop too (#1757)
* Support authenticated media downloads in Desktop too

We can't use service workers for a variety of reasons/errors, so we instead intercept HTTP(S) requests from the renderer process. With a bit of help from the IPC channels, we're able to emulate what the Element Web ServiceWorker does.

The IPC channel is considered "safe" for transmitting sensitive details like the user access token: if we can't trust the IPC, we can't trust much of anything. This is unlike the `postMessage` API in a web browser where browser extensions may be listening: we don't have extensions in this environment.

* Remove unused import

* Appease the linter
2024-07-10 07:41:27 -06:00
Šimon Brandner
a21e5afb84
Switch to the new session API for screen-sharing
See https://github.com/electron/electron/pull/30702 - this has the benefit of the js-sdk and LiveKit not having to add custom logic for Electron

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2023-07-14 12:09:12 +02:00
Andy Balaam
0faac52dae Format all files with prettier 2022-12-15 11:52:12 +00:00
Šimon Brandner
634c5c66a6
Switch to IPC channel for getDesktopCapturerSources (#320) 2022-02-11 10:38:19 +00:00
Michael Telatynski
531dde8bff
Fix open button for downloads not working due to ipc filtering (#295) 2022-01-10 11:35:23 +00:00
Michael Telatynski
4db0a0ac0c Make eslint happy 2021-07-01 09:16:49 +01:00
Michael Telatynski
d353c68a75 Convert preload.js to Typescript so that it gets copied to lib where we expect it 2021-07-01 09:11:42 +01:00