window.location.href = "myscheme://myhost:8080/index";
window.setTimeout(function(){
window.location.href = "https://xxxx/apk/app.apk";
},2000);
the above is Baidu"s method, which can indeed open app, but wait a few seconds after the opening prompt is displayed, and the download prompt will appear, which does not meet the requirements. So I want to ask the following questions
.solution 1: how can I turn off the timer when prompted to open app, and directly prompt to download app without running the timer when there is no app installed?
solution 2: take bilibili (bilibili"s official website) as an example. In bilibili"s mobile version, when bilibili app is installed on the phone, the button on web says, "Open app"; without app, the button on web shows" download app",. How can this effect be achieved?