-
Notifications
You must be signed in to change notification settings - Fork 0
/
JackboxReminder.min.js
1 lines (1 loc) · 1.75 KB
/
JackboxReminder.min.js
1
!function(){var e,t,n="jackbox.tv"==location.host;function o(){let t=document.querySelector("#roomcode").value,n=new XMLHttpRequest;n.open("GET","https://blobcast.jackboxgames.com/room/"+t),n.responseType="json",n.onreadystatechange=function(){(console.log("e"),n.readyState==XMLHttpRequest.DONE)&&(0==n.response.success&&(GM_notification(`Click to open ${location.host} tab`,`Game ${t} has ended`,"https://www.google.com/s2/favicons?domain=jackbox.fun",c),clearInterval(e),document.querySelector("#chkbx").checked=!1))},n.send()}function c(){GM_openInTab(location.href,{active:!0})}t=n?"Notify me when game ends":"Уведомить меня когда игра закончится",setTimeout(()=>{"use strict";var c=document.createElement("style");c.type="text/css",c.innerText="\n .CGSContainer {\n margin-top:10px;\n }\n .CGSContainer .label {\n user-select:none;\n padding-left:20px !important;\n }\n .CGSContainer .checkbox {\n position:absolute;\n }\n\n ";var a=document.createElement("input");a.type="checkbox",a.className="checkbox",a.id="chkbx";var r=document.createElement("label");r.className="label text-signin jbg",r.innerText=t,r.setAttribute("for",a.id),r.setAttribute("data-v-2ba6adc4","");var s=document.createElement("div");s.className="CGSContainer",s.style.display="none",s.style.marginTop=n?"-5px":"10px",a.onchange=(t=>{t.target.checked?e=setInterval(o,1e3):clearInterval(e)}),document.querySelector("#roomcode").oninput=(t=>{4!=document.querySelector("#roomcode").value.length?s.style.display="none":s.style.display="",document.querySelector("#chkbx").checked=!1,clearInterval(e)}),s.append(a,r),document.head.append(c),document.querySelector("#roomcode").after(s)},500)}();