[英]detect if user clicked on add to home screen
with javascript or jQuery, is there a way to detect if the user added my site to his home screen in mobile browsers? 使用javascript或jQuery,是否可以检测用户是否将我的网站添加到了移动浏览器的主屏幕中?
i want to detect it at the second he hit on 'add to home screen' 我想在他点击“添加到主屏幕”的第二秒钟检测到它
You can try this 你可以试试这个
if(isMobile.any()) {
alert("This is a Mobile Device");
}
And then 接着
$("#btn-id").on('click',function(){
//Write code to get msg
)};
Mmm this should be part of the browser's functionality and is not likely to be exposed to the js on a particular page. 嗯,这应该是浏览器功能的一部分,并且不太可能暴露给特定页面上的js。
So ... I think you cannot do in within the page. 所以...我想你不能在页面内做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.