简体   繁体   English

立即使用 JavaScript 代码拨打电话号码

[英]Instantly call a phone number with javascript code

I want to instantly call a phone number using javascript code.我想立即使用 javascript 代码拨打电话号码。 So far i have used window.open('tel: '), but the user still has to press the call button.到目前为止,我已经使用了 window.open('tel: '),但用户仍然必须按下通话按钮。 Is there a way to bypass this security mesure, and as soon as the user presses the button, the call is made, without the need to confirm it?有没有办法绕过这个安全措施,只要用户按下按钮,就可以拨打电话,而无需确认?

No. Security measures are security measures.不可以。安全措施就是安全措施。 If you want probably illegal code, this is not the place to look.如果您想要可能的非法代码,这不是查看的地方。 As ADyson said, this would be probably the world's biggest security flaw.正如阿迪森所说,这可能是世界上最大的安全漏洞。 If this even happened accidentally, this would be a major problem that would cost people millions to billions of dollars.如果这甚至是意外发生,这将是一个重大问题,将花费人们数百万至数十亿美元。 (No research to back this up, but would definitely be a huge cost) (没有研究来支持这一点,但肯定会付出巨大的代价)

As long as you have like facetime or something else that opens these types of links, this works like a charm for me without having to press any window buttons.只要你喜欢 facetime 或其他可以打开这些类型链接的东西,这对我来说就像一个魅力,而不必按任何窗口按钮。 (DISCLAIMER: This assumes that you have already setup phone numbers to auto open an application on your computer.) (免责声明:这假设您已经设置了电话号码以在您的计算机上自动打开应用程序。)

<table>
  <tr onclick="window.open('tel:18007776541');">
    <td>Phone: 1-800-777-6541</td>
  </tr>
</table>

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

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