const log_prefix = "[TeaSpeak::Preview] "; const object = "
" + "
" + "
You're in TeaWeb website preview mode. Click here to open the website in the browser
" + "
" + "
" + "" + "✖" + "" + "
" + "
"; const element = document.createElement("div"); element.id = "TeaClient-Overlay-Container"; document.body.append(element); element.innerHTML = object; { const buttons = element.getElementsByClassName("button-close"); if(buttons.length < 1) { console.warn(log_prefix + "Failed to find close button for preview notice!"); } else { for(const button of buttons) { (button).onclick = event => { console.trace(log_prefix + "Closing preview notice"); element.remove(); }; } } } { const buttons = element.getElementsByClassName("button-open"); if(buttons.length < 1) { console.warn(log_prefix + "Failed to find open button for preview notice!"); } else { for(const element of buttons) { (element).onclick = event => { console.info(log_prefix + "Opening URL with default browser"); require("electron").ipcRenderer.send('preview-action', { action: 'open-url', url: document.documentURI }); }; } } }