简体   繁体   中英

Instantly call a phone number with javascript code

I want to instantly call a phone number using javascript code. So far i have used window.open('tel: '), but the user still has to press the call button. 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. (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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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