惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
Recent Announcements
Recent Announcements
C
Check Point Blog
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
爱范儿
爱范儿
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
月光博客
月光博客
AI
AI
美团技术团队
SecWiki News
SecWiki News
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cybersecurity and Infrastructure Security Agency CISA
M
MIT News - Artificial intelligence
PCI Perspectives
PCI Perspectives
aimingoo的专栏
aimingoo的专栏
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Visual Studio Blog
T
The Exploit Database - CXSecurity.com
小众软件
小众软件
N
News | PayPal Newsroom
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
NISL@THU
NISL@THU
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
MongoDB | Blog
MongoDB | Blog
H
Heimdal Security Blog
Schneier on Security
Schneier on Security
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog RSS Feed
D
Docker
Spread Privacy
Spread Privacy
Cloudbric
Cloudbric
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
Intezer
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog

博客园 - 王大湿

2026年抖音、小红书、快手、微信小程序流量玩法差异拆解:适合中小商家的平台选择指南 2026年中小商家打通抖音小红书快手私域流程:微信小程序怎么实现多平台用户统一沉淀变现 改性/生物基尼龙新材料优质公司怎么选?2026年各细分领域头部企业盘点 源于现实的启发性算法:模拟退火与混合策略 AI时代的品牌监测技术发展趋势 append2 给append 添加回调方法 ISO in CSS content 阿里云OSS多图上传 无法将 DROP TABLE 用于 ,因为 是 未知类型。 Entity Framework 多字段排序 阿里巴巴全部行业分类 ServerVariables Levenshtein Distance 字符串的距离 Response.Status Entity Framework linq 分割DataTable MSN OAuth 2.0 API HTTP 状态代码 正则表达式常用字符、代码 导出扣扣漫游聊天记录
Tencent://Message/协议的实现原理
王大湿 · 2012-01-29 · via 博客园 - 王大湿

腾讯官方通过 Tencent://Message/协议可以让QQ用户显示QQ/TM的在线状态发布在互联网上;并且点击 ,不用加好友也可以聊天:

官方链接: http://is.qq.com/webpresence/code.shtml

具体代码:

<a href="tencent://message/?uin=215555521&Site=JooIT.com&Menu=yes">
<img border="0" SRC='http://wpa.qq.com/pa?p=1:215555521:3' alt="点击这里给我发消息">
</a>

但它是如何实现的呢?下面文章以及微软官方说明详细解释了其工作原理:


微软官方说明:http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/pluggable/overview/appendix_a.asp

Register protocol,此文中对于 Windows、Linux 和 OS X 操作系统如何注册协议都有说明。比如说 Windows,其实只需写入注册表,即可实现协议与执行程序的关联。例如腾讯的Tencent://Message协议注册表如下:

[HKEY_CLASSES_ROOT\TENCENT]
@=”TencentProtocol”
“URL Protocol”=”D:\\Program Files\\Tencent\\QQ\\Timwp.exe”

[HKEY_CLASSES_ROOT\TENCENT\DefaultIcon]
@=”D:\\Program Files\\Tencent\\QQ\\Timwp.exe,1″

[HKEY_CLASSES_ROOT\TENCENT\shell]

[HKEY_CLASSES_ROOT\TENCENT\shell\open]

[HKEY_CLASSES_ROOT\TENCENT\shell\open\command]
@=”\”D:\\Program Files\\Tencent\\QQ\\Timwp.exe\” \”%1\”"

此注册表所实现的就是当浏览器(或其它)碰到 tencent://… 时,自动调用 Timwp.exe,并把 tencent://… 地址作为第一个参数传递给 Timwp.exe。

更多参见:Registering an Application to a URL Protocol。 

原文链接: hi.baidu.com/kmiaoer/blog/item/799fd388ec403691a5c2723b.html

腾讯启动方式

var userAgent = navigator.userAgent.toLowerCase();

var ie=/msie/.test( userAgent ) && !/opera/.test( userAgent );

var g = {

closeWindow:function(){

if ((ie&&window.history.length>0) || (!ie&&window.history.length>1)){

window.history.back(1);

return;

}

if (ie) {

window.opener = null;

window.open('','_top');

window.top.close();

}

}

,report:function(id,sigt){

var img = document.createElement("img");

img.src = "http://wp.qq.com/cgi-bin/api_attr?id="+id+"&SigT="+sigt;

}

,checkActiveX:function(){

var kXmlHttp = null;

try{

if(typeof XMLHttpRequest != "undefined"){

kXmlHttp = new XMLHttpRequest();

return true;

}

}

catch(e){}        var aVersionhs = ["MSXML2.XMLHttp.3.0","MSXML2.XMLHttp.6.0","MSXML2.XMLHttp","Microsoft.XMLHttp","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0"];

for(var i=0;i<aVersionhs.length;i++){

try{

kXmlHttp = new ActiveXObject(aVersionhs[i]);

return true;

}

catch(e){}        

}

return false;

}

};

window.onload=function(){

var location = "tencent://message/?Menu=yes&uin=173251213&Site=&Service=201&sigT=afb8bca7ae5c962750b1ff8aa52d89d4a45faae2295dc6c297628ca3f1657abd7f3318ccf77de13bdd57fa0181a2223c&sigU=4dae486d846243a13ad46281d67cf0864a9bbcda250cf9e93168989602bee02d55bfcad34f2ad62c";

var sigt = location.replace(/^\S+sigT=/g,"").replace(/&\S+$/g,"");

if(!ie){

g.report(2,sigt);

window.location=location;

window.setTimeout(function(){

g.closeWindow()

}

,200);

}

else{

if (!g.checkActiveX()) {

window.location=location;

return;

}

try{

var cpTimwp = new ActiveXObject("TimwpDll.TimwpCheck");

if(cpTimwp){

window.location=location;

window.setTimeout(g.closeWindow,200);

return;

}

}

catch(e){

if(ie){

g.report(1,sigt);

window.location="http://wp.qq.com/check_qq.html?urltencent=" + encodeURIComponent(location) +                   "&sigt=" + encodeURIComponent(sigt);

}

}

}

};