Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<script src="js/media-access.js"></script>

<iframe id="iframe-regular" style="display: none"></iframe>
<div id="iframe-container" style="display: none"></div>
<iframe
id="iframe-allow-same-origin"
sandbox="allow-same-origin"
Expand Down
17 changes: 17 additions & 0 deletions js/webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ window.addEventListener("load", () => {
/** @type {HTMLIFrameElement} */
const iframeAllowSameOrigin = document.getElementById('iframe-allow-same-origin');
const iframeAllowSameOriginWindow = iframeAllowSameOrigin?.contentWindow;
// This test is specifically designed to get the RTCPeerConnection object
// before the injected script on android is run.
// The script injected into Android's WebView from Tauri
// only runs once the page is loaded, compared to other targets
// where the injected script is run immediately
// after the iframe is constructed, before yeilding back to the JS
// on the parent page which created the iframe.
const iframeContainer = document.getElementById("iframe-container");
/** @type {Window | undefined} */
let iframeNotInitedWindow
if (iframeContainer) {
iframeContainer.innerHTML += "<iframe id=uninitiframe></iframe>"
iframeNotInitedWindow = uninitiframe.contentWindow;
}
const tests = [
["RTCPeerConnection", window.RTCPeerConnection],
["mozRTCPeerConnection", window.mozRTCPeerConnection],
Expand All @@ -108,6 +122,9 @@ window.addEventListener("load", () => {
["iframe regular RTCPeerConnection", iframeRegularWindow?.RTCPeerConnection],
["iframe regular mozRTCPeerConnection", iframeRegularWindow?.mozRTCPeerConnection],
["iframe regular webkitRTCPeerConnection", iframeRegularWindow?.webkitRTCPeerConnection],
["iframe regular uninitialized RTCPeerConnection", iframeNotInitedWindow?.RTCPeerConnection],
["iframe regular uninitialized mozRTCPeerConnection", iframeNotInitedWindow?.mozRTCPeerConnection],
["iframe regular uninitialized webkitRTCPeerConnection", iframeNotInitedWindow?.webkitRTCPeerConnection],
];
const elements = [];
const testPromises = [];
Expand Down