有没有办法检测 Javascript 的(Android\iOS)设备上是否安装了特定应用程序?

Is there a way to detect if a specific app is installed on (Android\iOS) device from Javascript?

我想 运行 Safari (iOS) 或 Chrome (Android) 上的 JS 代码来检测,例如,如果 WhatsApp 已安装在设备上。

我玩过:

How to check if an app is installed from a web-page on an iPhone?

https://github.com/hampusohlsson/browser-deeplink

但问题是,如果该应用程序安装在设备上 - 浏览器会重定向到该应用程序。我想留在 "detection stage" 之后的页面上,可以吗?

经过几个小时的研究 + 咨询了顶级专家,我得出的结论是 没有合法的方法 可以实现检测是否安装了特定应用程序的目标如果安装了应用程序,则无需浏览器重定向到设备。

以iOS为例,有一款应用因为违规刚刚被App Store下架:SysSecInfo。例如,该应用设法提取所有 运行 个进程的列表。

发件人:https://www.sektioneins.de/en/blog/16-05-09-system-and-security-info.html

See https://developer.apple.com/videos/play/wwdc2015/703/ "App Detection" starting at 08:34

During this talk they discuss several APIs used to gather information about processes currently running on your system (around 12:12 in the video) and claimed to have fixed them. However as so often Apple has only partially fixed the problems they claim to have fixed. Therefore they have actually never stopped malicious applications from gathering information about what other applications run currently on your device, but only removed access to detail information that is only relevant for harmless system information tools anyway.

System and Security Info is therefore still able to show the list of running processes and enriches this list with information from the codesigning information including the list of entitlements running processes have.