Files
arcanechat-android/res/raw/sandboxed_iframe_rtcpeerconnection_check.html
T
bjoern 563c0296fa Combined webxdc patches (#2465)
* 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>
2023-02-05 14:45:45 +01:00

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>