我有一个非常简单的“添加到主屏”移动浏览器的工具,所以他们可以添加一个网站到那里的移动主屏。
manifest.json
{
"short_name": "Voetbal",
"name": "Voetbalpoule",
"icons": [
{
"src": "/voetbal/icon-192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/voetbal/icon-512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "/voetbal/?source=app2homescreen",
"background_color": "#ED008C",
"display": "standalone",
"orientation": "portrait",
"scope": "/voetbal/",
"theme_color": "#3367D6"
}service-worker.js
/*
window.addEventListener("beforeinstallprompt", ev => {
// Stop Chrome from asking _now_
ev.preventDefault();
// Create your custom "add to home screen" button here if needed.
// Keep in mind that this event may be called multiple times,
// so avoid creating multiple buttons!
myCustomButton.onclick = () => ev.prompt();
});
*/
self.addEventListener('fetch', function(event) {});这几个月来一直运行良好,但最近几天,我从用户那里听到,在点击主屏幕上的图标后,他们会看到一个白屏。
我自己重现了这一点,事实上,当我从我的主屏幕上删除这个按钮,并使用Chrome进入网站时,我在屏幕底部得到了“添加到主屏幕”按钮。我添加了这个,然后我转到我的主屏幕,点击这个按钮,然后我得到一个白色屏幕.
直到最近几天,这都运行得很好,那么谷歌有没有更新呢?
知道为什么我会看到白屏吗?
致以亲切的问候,
发布于 2019-10-14 16:18:45
问题解决了!
我发现是PHP脚本错误造成了这个白屏,所以问题不是由WebAPK造成的,而是PHP类型错误。
https://stackoverflow.com/questions/58340743
复制相似问题