阅读:2077回复:0
[求助]关于调用阿里旺旺的GM脚本
// ==UserScript==
// @name Taobao WangWang // @namespace <!-- w --><a class="postlink" href="http://www.firefox.net.cn">www.firefox.net.cn</a><!-- w --> // @description Focus to use WangWang IM Client // @include http://*.taobao.com/* // ==/UserScript== function main(){ var es = document.evaluate("//span[@class='ww:token']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < es.snapshotLength; i++) { thisItem = es.snapshotItem(i); if (thisItem.firstChild.href && !thisItem.wwtoken) { o = thisItem.getAttribute("ww:params"); href = "wangwang:SendIM?"; pattern = /nick=(.*?)&/; if (pattern.test(o)) { match = pattern.exec(o); nick = match[1]; href += nick; } pattern = /item=(.*?)&/; if (pattern.test(o)) { match = pattern.exec(o); item = match[1]; href += "&gid=" + item; } //GM_log(href); //console.log(href); thisItem.firstChild.href = href; thisItem.firstChild.setAttribute("onclick", "location=this.href;"); thisItem.wwtoken = true; } } } addEventListener("load", main, true); ==================================== 这个脚本不知道是坛子里的那个大大写的,不过不支持旺旺2008啊, 为了个旺旺多装个插件实在太不值... 希望原作者或者其他高手能修改一下,感激不禁!! 额,复制过来怎么缩进都没了.... 传上附件~ |
|
|