// ==UserScript== // @name Edpuzzle useful menus! // @namespace http://tampermonkey.net/ // @version 2.0 // @description No pause when in another tab, laziness=100 // @author J // @match https://edpuzzle.com/* // @run-at document-end // @grant none // @downloadURL none // ==/UserScript== //(function() { var h=document.createElement("audio"); var muted = false; h.id="beep"; h.src="https://www.soundjay.com/button/sounds/beep-01a.mp3"; h.type="audio/mpeg"; window.played = false; setTimeout(function(){ window.bx=document.createElement("input"); bx.type="checkbox"; window.mt=document.createElement("input"); mt.type="checkbox"; window.np=document.createElement("input"); np.type="checkbox"; document.getElementsByClassName("PNsDTVSfY4")[0].prepend(bx) document.getElementsByClassName("PNsDTVSfY4")[0].prepend("Beep on question? ") mt.onclick = function(){togglemuted()}; document.getElementsByClassName("PNsDTVSfY4")[0].prepend(mt); document.getElementsByClassName("PNsDTVSfY4")[0].prepend("Mute video? "); document.getElementsByClassName("PNsDTVSfY4")[0].prepend(np); document.getElementsByClassName("PNsDTVSfY4")[0].prepend("No pause? "); }, 1500) var bbc; setInterval(function(){ bbc=document.getElementsByClassName("_3YDzzvzzXC _2TT-CHq6hp")[0]; try{ if(bbc.attributes["aria-label"].value=="Play"&&np.checked){ if(!document.getElementsByClassName("FvwrNg_alY")[0]||document.getElementsByClassName("FvwrNg_alY")[0].textContent=="Show results"){ bbc.click()} } } catch(e){ console.log("hmm..?") }; try{ if(document.getElementsByClassName("gZkgDqcOdE")[0].children[0].textContent=="MULTIPLE CHOICE QUESTION"&&!played&&bx.checked){ h.play(); played=true; }; } catch(e){} if(!document.getElementsByClassName("gZkgDqcOdE")[0]){played=false;} },500) function togglemuted(){ if(muted){ document.getElementsByTagName("video")[0].volume=1; muted=false; } else { document.getElementsByTagName("video")[0].volume=0; muted=true; } } //})();