index: fix webOS 3.x syntax support

pull/4/head
Piotr Dobrowolski 2021-05-26 20:38:48 +02:00
rodzic 7adc12bc58
commit 582d6010c7
1 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -297,9 +297,9 @@ window.requestAnimationFrame(animate_tick);
document.querySelector("#main-article").innerHTML = "<pre id='log'></pre>";
var is_local = window.location.protocol === 'file:';
var is_webos = navigator.userAgent.toLowerCase().includes("webos") ||
navigator.userAgent.toLowerCase().includes("netcast") ||
navigator.userAgent.toLowerCase().includes("smarttv");
var is_webos = navigator.userAgent.toLowerCase().indexOf("webos") !== -1 ||
navigator.userAgent.toLowerCase().indexOf("netcast") !== -1 ||
navigator.userAgent.toLowerCase().indexOf("smarttv") !== -1;
if (!is_local && !is_webos) {
log("[Warning] You should be visiting this page from a webOS device, not your desktop web browser!");
@ -312,7 +312,7 @@ window.requestAnimationFrame(animate_tick);
}
// listen for "5" key to be pressed
document.addEventListener("keydown", event => {
document.addEventListener("keydown", function(event) {
if (event.keyCode === 53) {
begin_exploit();
}