简体   繁体   English

通过HTML和DIAL链接到电话

[英]Link to phone by HTML and DIAL

I'm using <a href="tel:050444444">Click to call</a> code, it's working fine in Android, When the user click on "click to call" it's open the Dialer and what the user left to di is just to click on the phone icon (of the dialer) for do the call. 我使用的是<a href="tel:050444444">Click to call</a>代码,在Android中运行正常,当用户点击“点击通话”时,它会打开Dialer,并向用户显示以下内容只是单击(拨号器的)电话图标进行通话。 Is there a way to make the dial auto? 有没有办法使表盘自动? So when the user click on "Click to call" it's do the dial auto without need to click on the phone icon? 因此,当用户单击“单击通话”时 ,是否不需要单击电话图标即可进行自动拨号?

It's intentional for browser to request for user confirmation before initiating a phone call, for security reasons: if there was no request for user confirmation, a malicious web page could programmatically initiate a phone call by triggering a click event on a tel: link, with all the security harm that derives from it (for instance, disclosing the user's telephone number, or possibly draining his/her phone credit). 出于安全原因,浏览器有意在启动电话之前请求用户确认:如果没有用户确认请求,则恶意网页可以通过触发tel:链接上的click事件,以编程方式启动电话随之而来的所有安全危害(例如,泄露用户的电话号码,或可能耗尽其电话信用额)。

This Google tutorial explicitly states that 该Google教程明确指出:

On most devices with telephone capabilities, the user receives a confirmation before the number is dialed, to ensure that the user isn't being tricked into calling an expensive long distance or premium phone number. 在大多数具有电话功能的设备上,用户会在拨打该号码之前收到确认,以确保不会诱骗该用户拨打昂贵的长途电话或高级电话号码。

So even if practically every modern (and not-so modern) browser supports tel: links, the behavior you are attempting to obtain is simply not possible, and with some good reason. 因此,即使几乎每个现代(但不是很现代)的浏览器都支持 tel:链接,您尝试获得的行为也是完全不可能的,并且有充分的理由。

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

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