PWA debug chrome “add to homescreen” button not doing anything

ⅰ亾dé卋堺 提交于 2019-12-11 03:05:09

问题


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.

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?

Edit: 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


回答1:


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.




回答2:


If you are testing in localhost, try http://localhost instead of 127.0.0.1.

I don't know why, but I have the same issue when using 127.0.0.1. After changing to localhost, it works correctly.



来源:https://stackoverflow.com/questions/53338302/pwa-debug-chrome-add-to-homescreen-button-not-doing-anything

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!