如何使网页 link 直接在 Google Play 商店中打开

How to make a web link open directly on Google Play Store

我有一个使用模板的博主网站,www.aplitechstore.com.br, 我们添加了许多应用 link 以在 Google Play 上下载,但它们不会在 Google Play 商店应用中打开,而是在网站上打开。 我想改变这一点,我想要我们的应用程序和网站(在 Webview 模式下)点击 link,在 Google Play Store 应用程序中打开它。

As explained here, Google Play 提供 url 协议

market://details?id=<package_name>

正在申请 Blogger :

将以下 javascript 代码放在底部 </body> 之前。这将更改 Google 仅在 Android 上播放链接。

<script>
if (/(android)/i.test(navigator.userAgent)) {
  document.querySelectorAll('a[href]').forEach(function (link) {
    link.href = link.href.replace('https://play.google.com/store/apps/','market://');
  });
}
</script>