Created
October 24, 2019 07:38
-
-
Save iepsen/14374a02f5742cd633a85b0f6f5b184a to your computer and use it in GitHub Desktop.
Helper code to debug on Smart TVs or devices we don't have access do logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.console-wrapper { | |
position: absolute; | |
bottom: 0; | |
right: 0; | |
z-index: 99999; | |
padding: 20px; | |
width: 100%; | |
height: 100%; | |
background-color: black; | |
opacity: 0.6; | |
} | |
#console { | |
width: 100%; | |
height: 100%; | |
color: rgb(205, 255, 105); | |
font-size: 30px; | |
font-family: 'Courier New', Courier, monospace; | |
overflow: hidden; | |
} | |
#console p { | |
margin: 0; | |
padding: 0; | |
} | |
</style> | |
<div class="console-wrapper"> | |
<div id="console"></div> | |
</div> | |
<script> | |
var consoleBox = document.getElementById("console"); | |
var content = ""; | |
function printConsole(message) { | |
content += "<p>" + getTime() + message + "</p>"; | |
consoleBox.innerHTML = content; | |
consoleBox.scrollTop = consoleBox.scrollHeight; | |
} | |
function getTime() { | |
return "[" + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1") + "] > "; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment