Redirect from the SoloLearn application to the browser. How to do it in the right way?
My Android System Webview does not support ES6 and WebGL and the sandbox in the application cannot display the results. I would like to redirect to the default browser or any browser installed on the system in case of an error, such as the inability to get the webgl context from the canvas. Now my solution is to set the window.location.href attribute to the url value (obtained by clicking the share button in the sandbox) and change the document body by writing a string informing about the lack of webgl support and then stop executing the script. But if the document body is changed immediately Before the completion of the script, the redirect will not occur, so the body needs to be changed after a while. I am doing this workaround: setTimeout (function () {document.write("webgl is unsupported!");}, 1000); Below you can see how it works. https://code.sololearn.com/W8zPB0KdcBl9/?ref=app Maybe I am doing the redirect wrong. What is the best way to do this?