Path: blob/main/public/games/files/webretro/uauth/uauth.js
1034 views
var uauth = {};12uauth.url = "https://binbashbanana.github.io/webretro/uauth/"; // Must have cross-domain support!!!3uauth.origins = ["http://localhost:8000", "https://binbashbanana.github.io"];45uauth.frame = document.createElement("iframe");6uauth.frame.style.display = "none";78uauth.pickerOpen = false;9uauth.callback = function(data) {}1011uauth.open = function(type, exts, callback) {12if (!uauth.pickerOpen) {13uauth.pickerOpen = true;14uauth.callback = callback;15uauth.frame.src = uauth.url + "?type=" + type + "&exts=" + exts.join(",");16document.body.appendChild(uauth.frame);17}18}1920window.addEventListener("message", function(e) {21if (uauth.origins.includes(e.origin) && e.data.webretro) {22uauth.pickerOpen = false;23uauth.frame.removeAttribute("src");24document.body.removeChild(uauth.frame);25uauth.callback(e.data.webretro);26}27}, false);2829