简体   繁体   English

如果安装了带有 TWA(受信任的 Web 活动)的本机应用程序,则禁用“添加到主屏幕”

[英]Disable “Add to home screen” if native App with TWA (Trusted Web Activities) is installed

Initial situation: I installed a native app with a TWA on my Android phone that opens lets say "www.example.com" and I was able to turn off the app installation prompt with the instructions here.初始情况:我在我的 Android 手机上安装了一个带有 TWA 的本机应用程序,打开时可以说“www.example.com”,我可以按照此处的说明关闭应用程序安装提示。 https://web.dev/get-installed-related-apps/#check-android (Add related_application to manifest) https://web.dev/get-installed-related-apps/#check-android (将related_application添加到清单中)

Now when I open the Google Chrome browser on Android and enter the URL "www.example.com", then there is no more installation prompt popup but when I go to the three dots its still possible to click “Add to Home screen” and then the PWA is installed as webapk.现在,当我在 Android 上打开 Google Chrome 浏览器并输入 URL “www.example.com”时,不再弹出安装提示,但是当我将 Z34D1F91FB2E514B8576 添加到主屏幕时,仍然可以单击“三个点”和“B”然后将 PWA 安装为 webapk。 Add to homescreen添加到主屏幕

Now my question is it possible to disable this option or have the same behaviour as for an installed PWA (as described below)?现在我的问题是可以禁用此选项或具有与已安装 PWA 相同的行为(如下所述)?

PWA behaviour: PWA 行为:

  1. Go to "www.example.com" Go 到“www.example.com”
  2. 3 dots, Install app Install app 3 点,安装应用安装应用
  3. If webapk is installed on the device, again go to www.example.com如果设备上安装了 webapk,再次 go 到www.example.com
  4. Go to the three dots, then you see open PWA, and it is not possible to install the PWA again. Go 到三个点,然后你看到打开的 PWA,并且无法再次安装 PWA。 Open PWA打开 PWA

Can I have this behaviour when I install the PWA as a native app with TWA?当我将 PWA 安装为带有 TWA 的本机应用程序时,我可以有这种行为吗? TWA generation happens with bubblewrap ( https://github.com/GoogleChromeLabs/bubblewrap ) TWA 生成发生在气泡包装上 ( https://github.com/GoogleChromeLabs/bubblewrap )

It's not possible to prevent the user from trying to install from the 3-dot menu.无法阻止用户尝试从 3 点菜单进行安装。 If you'd like, head over to https://new.crbug.com to file a feature request and we can take a look at it.如果您愿意,请前往https://new.crbug.com提交功能请求,我们可以查看它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM