diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..2e01351 Binary files /dev/null and b/icon.png differ diff --git a/loading.gif b/loading.gif new file mode 100644 index 0000000..1448c29 Binary files /dev/null and b/loading.gif differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..f9d28fb --- /dev/null +++ b/manifest.json @@ -0,0 +1,19 @@ +{ + "name": "BigBlueButton Echo Test Skipper", + "version": "0.0.0.1", + "manifest_version": 2, + "description": "An extension to skip the echo test in BigBlueButton video conferences.", + "content_scripts": [{ + "matches": ["*://*.blindsidenetworks.com/*", "*://*.bigbluebutton.org/*"], + "js": ["skipper.js"] + }], + "icons": { + "128": "icon.png" + }, + "browser_action": { + "default_popup": "popup.html" + }, + "permissions": [ + "storage" + ] +} diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..16e5a21 --- /dev/null +++ b/popup.html @@ -0,0 +1,75 @@ + + + + + BBB Echo Skip + + + +
+

Echo Test Skipper is Always Enabled

+ +
+

Stealth Mode:

+ +

Background Color:

+ + + + + + diff --git a/popup.js b/popup.js new file mode 100644 index 0000000..e9f106f --- /dev/null +++ b/popup.js @@ -0,0 +1,66 @@ +var enabled; +chrome.storage.local.get(['skipEnabled', 'stealthEnabled', 'background'], function (result) { + console.log(result.skipEnabled); + console.log(result.stealthEnabled); + enabled = result.skipEnabled; + stealth = result.stealthEnabled; + document.getElementById("backgroundInput").value = result.background; + if (enabled == true) { + document.getElementById("active").innerText = "Echo Test Skip is Enabled"; + document.getElementById("toggle").innerText = "Disable"; + document.getElementById("toggle").style.background = "#cc2929"; + document.getElementById("toggle").style.borderColor = "#a62323"; + document.getElementById("colorBar").style.background = "#29cc41"; + } else { + document.getElementById("active").innerText = "Echo Test Skip is Disabled"; + document.getElementById("toggle").innerText = "Enable"; + document.getElementById("toggle").style.background = "#29cc41"; + document.getElementById("toggle").style.borderColor = "#23a636"; + document.getElementById("colorBar").style.background = "#cc2929"; + } + if(stealth){ + document.getElementById("stealth").innerText = "Disable Stealth Mode"; + } else { + document.getElementById("stealth").innerText = "Enable Stealth Mode"; + } +}); + +document.getElementById("toggle").addEventListener("click", toggleActive); +document.getElementById("stealth").addEventListener("click", stealthActive); +document.getElementById("backgroundInput").addEventListener("input", updateBackground); + +function toggleActive() { + if (enabled == true) { + chrome.storage.local.set({ + 'skipEnabled': false + }, function () { + window.location.reload(); + }); + } else { + chrome.storage.local.set({ + 'skipEnabled': true + }, function () { + window.location.reload(); + }); + } +} + +function stealthActive() { + if (stealth == true) { + chrome.storage.local.set({ + 'stealthEnabled': false + }, function () { + window.location.reload(); + }); + } else { + chrome.storage.local.set({ + 'stealthEnabled': true + }, function () { + window.location.reload(); + }); + } +} + +function updateBackground(){ + chrome.storage.local.set({'background': document.getElementById("backgroundInput").value}, function () {}); +} \ No newline at end of file diff --git a/skipper.js b/skipper.js new file mode 100644 index 0000000..2d047ba --- /dev/null +++ b/skipper.js @@ -0,0 +1,61 @@ +chrome.storage.local.get(['skipEnabled', 'stealthEnabled', 'background'], function (result) { + console.log(result.skipEnabled); + console.log(result.stealthEnabled); + console.log(result.background); + enabled = result.skipEnabled; + stealth = result.stealthEnabled; + background = result.background; + if(result.background == undefined){ + background = "#06172A"; + } + document.body.style.background = background; + if (enabled == true) { + if (!stealth) { + var loadingScreen = document.createElement("div"); + loadingScreen.innerHTML = "
"; + document.body.appendChild(loadingScreen); + document.getElementById("app").style.opacity = "0"; + } + + function eventFire(el, etype) { + if (el.fireEvent) { + el.fireEvent('on' + etype); + } else { + var evObj = document.createEvent('Events'); + evObj.initEvent(etype, true, false); + el.dispatchEvent(evObj); + } + } + + var loadInterval = setInterval(isLoaded, 100); + + function isLoaded() { + if (document.getElementsByClassName('jumbo--Z12Rgj4')[0] !== undefined) { /* The buttons have loaded, click them */ + console.log("Loaded!"); + eventFire(document.getElementsByClassName('jumbo--Z12Rgj4')[0], 'click'); + if (!stealth) { + document.getElementsByClassName("portal--27FHYi")[0].style.opacity = "0"; + } + clearInterval(loadInterval); + setTimeout(function () { //Give the first prompt 500ms to close, then start checking the buttons again + var loadInterval = setInterval(isEchoLoaded, 100); + }, 500); + } else { + console.log("Not Loaded!") + } + } + + function isEchoLoaded() { + if (document.getElementsByClassName('jumbo--Z12Rgj4')[0] !== undefined) { /* The buttons have loaded, click them */ + eventFire(document.getElementsByClassName('jumbo--Z12Rgj4')[0], 'click'); + if (!stealth) { + document.getElementById('skipper-loading-popup').style.display = 'none'; + document.getElementById("app").style.opacity = "1"; + document.getElementsByClassName("portal--27FHYi")[0].style.opacity = "1"; + } + clearInterval(loadInterval); + } + } + + } +});