Skip to content
Snippets Groups Projects
Commit a1bacc48 authored by Daniel Müller's avatar Daniel Müller :speech_balloon:
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
# BBB Echotest Autojoin - Userscript
## What does it do?
This userscript automatically accepts the BBB Echotest and also ensures that the microphone is muted
when joining. This helps with the microphone often being unmuted when joining breakout rooms.
While the abomination commonly refered to as "echotest" can't be fully bypassed (yet), this at least
removes the need to manually press the accept button.
## How can I use it?
This project is implemented as a userscript which means a userscript manager is needed to use it. The code was
tested with [Tampermonkey](https://www.tampermonkey.net) on firefox but should work on every browser with any
userscript plugin.
### Install and use with tampermonkey
1. Install tampermonkey from [tampermonkey.net](https://www.tampermonkey.net)
2. Install the userscript by clicking [echotest autojoin userscript](https://code.fbi.h-da.de/istddmue2/bbb-echotest-autojoin-userscript/-/raw/master/bbb-echotest-autojoin.user.js). This should prompt the installation.
3. __Make sure to always look at the code before installing userscripts__
4. Profit
// ==UserScript==
// @name BBB Echotest Autojoin
// @version 0.1
// @website https://code.fbi.h-da.de/istddmue2/bbb-echotest-autojoin-userscript
// @downloadURL https://code.fbi.h-da.de/istddmue2/bbb-echotest-autojoin-userscript/-/raw/master/bbb-echotest-autojoin.user.js
// @updateURL https://code.fbi.h-da.de/istddmue2/bbb-echotest-autojoin-userscript/-/raw/master/bbb-echotest-autojoin.user.js
// @description Automatically accept the echotest and automatically mute after connect
// @author Daniel Müller
// @match https://*.h-da.de/html5client/join*
// @grant none
// ==/UserScript==
async function sleep(ms) {
await new Promise(r => setTimeout(r, ms));
}
function getEchotestAcceptButton() {
let selector = "span[class^=echoTest] > button > span[class*=success]";
return document.querySelector(selector)?.parentElement;
}
function getMuteButton() {
return document.querySelector("button > span > i[class*=icon-bbb-unmute]")?.parentElement?.parentElement;
}
function getUnmuteButton() {
return document.querySelector("button > span > i[class*=icon-bbb-mute]")?.parentElement?.parentElement;
}
function isMuted() {
if (getMuteButton() != null) return false;
if (getUnmuteButton() != null) return true;
return null;
}
(async function() {
'use strict';
let waitTime = 100;
// Loop to catch reconnects without reloading the page
while (true) {
// Wait until the echotest accept button shows up
while (getEchotestAcceptButton() == null) {
await sleep(waitTime);
}
getEchotestAcceptButton().click();
// Ensure that the microphone is muted after joining
while (isMuted() != true) {
getMuteButton().click();
await sleep(100);
}
// Increase the waitTime after the initial connection
waitTime = 500;
await sleep(waitTime);
}
})();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment