PWA调试Chrome浏览器“添加到主屏幕"按钮什么都不做 [英] PWA debug chrome "add to homescreen" button not doing anything

查看:872
本文介绍了PWA调试Chrome浏览器“添加到主屏幕"按钮什么都不做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将添加到主屏幕"提示功能添加到我的网站.现在,我已经阅读了Google开发人员的文章,并已完成所有设置.

I am trying to add the "add to Homescreen" prompt function to my website. Now I've read the google developer articles and I have everything set up.

现在,如果我尝试通过Chrome devtools>应用程序>清单中的添加到首页"按钮手动将页面添加到主屏幕,则没有任何反应.几次控制台显示错误,但修复后什么也没有发生.我没有得到添加到书架横幅,但控制台没有显示错误. Lighthouse也没有显示任何错误.实际上,灯塔的pwa得分为92.

Now, If I try to manually add my page to the homescreen with the button "Add to homecreen" in the Chrome devtools > Application > Manifest , nothing is happening. A few times the console showed an error, but after fixing it nothing happens. I don't get the Add to shelf banner, but I don't get an error displayed in the console. Lighthouse doesn't show any error either. In fact, lighthouse shows a score of 92 in pwa.

这是现在意味着一切正常吗?我监督过其他调试功能吗?

Is this now meaning that everything is working? Is there an other debug function I've overseen?

如果我按按钮而不是重新加载页面,则在按reload并且页面已正确加载后,控制台将显示:

If I press the button and than reload the page, after I press reload and the page is acctually loaded, the console displays:

无法安装站点:页面已要求取消横幅提示

Site cannot be installed: the page has requested the banner prompt be cancelled

推荐答案

我遇到了同样的问题:Chrome开发工具添加到主屏幕无法在任何PWA上使用.经过数天的努力来找出问题的根源,我终于发现Chrome主菜单有一个用于安装应用程序的选项,并且该选项运行良好.因此,您无需使用Chrome开发工具选项.

I was having this same issue: Chrome Dev Tools Add to Homescreen was not working on ANY PWA. After days struggling trying to figure out where the problem was I finally found that Chrome main menu has an option to install the app, and that option is working fine. So you don't need to use Chrome Dev Tools option.

这篇关于PWA调试Chrome浏览器“添加到主屏幕"按钮什么都不做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆