gpt4 book ai didi

progressive-web-apps - 安装 PWA 后关闭浏览器窗口并打开 PWA

转载 作者:行者123 更新时间:2023-12-04 18:00:55 40 4
gpt4 key购买 nike

我让 Chrome 在 Android 上安装了我的 PWA - 一旦安装,我想自动关闭安装它的浏览器窗口,并打开 PWA(因此用户不会在浏览器窗口中继续,认为他们正在使用PWA) - 这可能吗?

最佳答案

我一直在寻找类似的解决方案,但还没有找到一种方法来做到这一点。到目前为止,我尝试描述我的发现:

关闭浏览器窗口 :

如本 answer 中所述window.close() 只能在脚本自己打开的窗口/选项卡上调用。那里正在讨论一些可能的解决方法。

安装后立即打开 PWA:

谷歌在他们的 WebApk Fundamentals Article 中描述如下:

When a Progressive Web App is installed on Android, it will register a set of intent filters for all URLs within the scope of the app. When a user clicks on a link that is within the scope of the app, the app will be opened, rather than opening within a browser tab.



我希望在从仍然打开的浏览器窗口安装/添加到主屏幕后也能正常工作。

基于对两台 Android 设备的测试,目前似乎 用户必须手动打开 PWA 从主屏幕 一次 chrome/android 将网络应用程序 manifest.json 的范围解释为打算独立打开页面。

这对于甚至 iOS 似乎处理这种不同的情况来说都是可悲的。

也许我忽略了 Google 文章中的某些内容?我也不完全理解 androids 意图 API - 所以也许有一些方法仍然可以实现(?)

关于progressive-web-apps - 安装 PWA 后关闭浏览器窗口并打开 PWA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53800194/

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