手机通话或mailto根本不起作用

艾奥尼尔·卢普

我有一个非常小的应用程序:

<!DOCTYPE html>
<html>
<head>
   <title></title>
</head>

<body>
    <a href="mailto:[email protected]">Send Mail</a>
    <a href="tel: +18543458975">Call</a>

    <button onclick="document.location.href = 'tel:+1-800-555-1234'">Click me</button>
    <button onclick="document.location.href = 'tel:+18543458975'">Click again</button>
</body>
</html>

当我构建并运行它时,链接根本不起作用。

两周前(在另一个应用程序上),此功能运行良好,但现在在我的旧应用程序上均无法运行。

我没主意了!

发生什么事了?

马尔塞克

现在将使用http / https以外的协议列入白名单,并且默认情况下被阻止。

http://cordova.apache.org/announcements/2014/08/04/android-351.html http://cordova.apache.org/announcements/2014/09/08/cordova-361.html

您只需要将mailto和tel协议添加到白名单。

请参阅http://cordova.apache.org/docs/en/edge/guide_appdev_whitelist_index.md.html的“外部应用程序白名单”部分,以获取有关从3.6.0开始要添加到白名单中的内容的说明。

由于围绕此问题的安全漏洞已在3.5.1中修复,因此您不想使用3.5.0,否则您将很容易受到攻击,并会从Google Play商店获取警告。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章