mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
563c0296fa
* re-applying patch from @Hocuri from #2458 * apply sandbox isolation patch from @WofWca * wait for gc as suggested by @WofWca, @Simon-Laux and others * Update res/raw/sandboxed_iframe_rtcpeerconnection_check.html Co-authored-by: WofWca <wofwca@protonmail.com> * Update res/raw/sandboxed_iframe_rtcpeerconnection_check.html Co-authored-by: WofWca <wofwca@protonmail.com> * improve progress bar, inspired by @Simon-Laux and @WofWca * comment about the gist of setNetworkAvailable() * unify url-loading; this cleans up things and makes adding CSP more straight-forward --------- Co-authored-by: WofWca <wofwca@protonmail.com>
34 lines
726 B
HTML
34 lines
726 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<script>
|
|
window.addEventListener("message", e => {
|
|
// Currently this never happens because we don't load other scripts that could `postMessage`
|
|
// until all checks have passed, but let's play it safe.
|
|
if (
|
|
event.origin !== location.origin
|
|
|| event.source !== parent
|
|
) {
|
|
return;
|
|
}
|
|
|
|
if (event.data === "performCheck") {
|
|
let rtcpcCreationFailed = false;
|
|
try {
|
|
new RTCPeerConnection();
|
|
} catch (e) {
|
|
rtcpcCreationFailed = true;
|
|
}
|
|
|
|
parent.postMessage({ msgType: "result", rtcpcCreationFailed }, location.origin);
|
|
}
|
|
});
|
|
|
|
parent.postMessage({ msgType: "ready" }, location.origin);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
</body>
|
|
</html>
|