Game doesn't work on webbrowser and especially safari

Hi, I was also having some problems with my game in apple devices, one of the issues was that I was using some JS new functionalities, like default parameters on the functions, which is not supported on IOs browsers.
Because there is no console in mobile browsers, is very useful to have a message log in the top of the webpage, I used this code :

HTML:
< div id=“prompt” style=“position: absolute;color:red; font-size: large;”> < /div >

JS:
window.onerror = function (e) {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
document.getElementById(‘prompt’).innerHTML = e.toString();
}

Hope that helps you a little