gpt4 book ai didi

javascript - 如果已添加到主屏幕,则隐藏工具提示

转载 作者:行者123 更新时间:2023-11-28 20:30:06 26 4
gpt4 key购买 nike

我正在使用 this plugin显示用于将网站添加到主屏幕的工具提示,但一旦添加,我不希望工具提示再次出现。文档说我应该只添加一个元标记:

<meta name="apple-mobile-web-app-capable" content="yes">

我做到了,但我仍然每次都能看到工具提示。我做错了什么?

最佳答案

您可以通过在包含插件的 JS 文件之前设置 addToHomeConfig 来禁用插件的自动启动。

var addToHomeConfig = {
autostart : false
//add your other options here
};
//use script tag to include the plugin.

然后,通过插入下面的代码来检测应用程序是否在“Web App Mode”下运行

if (("standalone" in window.navigator) && !window.navigator.standalone){
//show fullscreen tooltip
addToHome.show(); //this shows the tooltip
}

关于javascript - 如果已添加到主屏幕,则隐藏工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12488475/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com