Article From:

Recently, we need to implement a function of clicking buttons to call local applications in PC web pages.

In fact, the principle of implementation is very simple.

First register a local registry file to point to the local application path

Secondly, using JS to point to the registry file in the web page, we can call the local application on the web page.

Windows Registry Editor Version 5.00


@="myprotocol Protocol"

"URL Protocol"=""








@="\"D:\\Tools\\FF\\tencent\\qqmusic\\QQMusic.exe\" "
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
<body style="text-align: center;padding-top: 300px;">
<button onclick="window.location.href='myprotocol://D:\\work\\data\\2018\\08-11\\11-16\\myprotocol.reg'" style="margin: 200px auto;">Open QQ music</button>
<a href="myprotocol://D:\work\data\2018\08-11\11-16\myprotocol.reg" style="margin: 200px auto;">Open QQ music</a>



Leave a Reply

Your email address will not be published. Required fields are marked *