v0.1.5
This commit is contained in:
1 parent
61ef2aa2bd
commit
e8da07179a
32 files changed
+3633
-161
No files matched your search
+21
-4
@@ -30,6 +30,11 @@ body { font-family: -apple-system, sans-serif; background: #1a1a1a; color: #e0e0
|
||||
<button class="btn-home" onclick="goHome()">Home</button>
|
||||
<button class="btn-vk" onclick="loadURL('https://vk.com/im')">VK Call</button>
|
||||
<button class="btn-telemost" onclick="loadURL('https://telemost.yandex.ru/')">Telemost</button>
|
||||
<span style="margin-left:auto;font-size:11px;color:#888">Tunnel:</span>
|
||||
<select id="modeSelect" style="padding:3px 6px;border:1px solid #555;border-radius:6px;font-size:11px;cursor:pointer;font-weight:500;background:#333;color:#e0e0e0;outline:none" onchange="onModeChange(this.value)">
|
||||
<option value="dc" selected>DC</option>
|
||||
<option value="pion-video">Pion Video</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="content" id="content">
|
||||
<div class="welcome" id="welcome">
|
||||
@@ -49,6 +54,22 @@ body { font-family: -apple-system, sans-serif; background: #1a1a1a; color: #e0e0
|
||||
</div>
|
||||
<script>
|
||||
var wv = null;
|
||||
var currentMode = 'dc';
|
||||
|
||||
function onModeChange(mode) {
|
||||
currentMode = mode;
|
||||
var sel = document.getElementById('modeSelect');
|
||||
sel.disabled = true;
|
||||
window.bridge.setTunnelMode(mode).then(function() {
|
||||
if (wv) {
|
||||
var url = wv.getURL();
|
||||
if (url && url !== 'about:blank') {
|
||||
wv.reload();
|
||||
}
|
||||
}
|
||||
setTimeout(function() { sel.disabled = false; }, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
function copyLog(id) {
|
||||
navigator.clipboard.writeText(document.getElementById(id).textContent);
|
||||
@@ -102,10 +123,6 @@ function loadURL(url) {
|
||||
document.getElementById('content').appendChild(wv);
|
||||
wv.addEventListener('dom-ready', function() { wv.setAudioMuted(true); });
|
||||
|
||||
// Inject hook on first load
|
||||
wv.addEventListener('did-finish-load', function() {
|
||||
injectHook();
|
||||
}, { once: true });
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user