Skip to content

Commit

Permalink
add wx.js
Browse files Browse the repository at this point in the history
  • Loading branch information
maplebeats committed Jun 8, 2015
1 parent 3cabd6c commit d9e46d2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions wx.js
@@ -0,0 +1,19 @@
// ==UserScript==
// // @name wx
// // @namespace wx
// // @description wx自动跳转
// // @include http://*support.weixin.qq.com/cgi-bin/*
// // @version 0.0.1
// // @Author: maplebeats
// // @mail: maplebeats@gmail.com
// // @run-at document-end
// // ==/UserScript==

var url_div = document.getElementsByClassName("url");
var url = url_div[0].innerHTML;
console.log(url);
document.getElementsByClassName("url")[0].innerHTML='<a id="target" href="'+url+'">'+url+'</a>';
var a = document.getElementById("target");
var evt = document.createEvent("MouseEvents");
evt.initEvent("click", true, true);
a.dispatchEvent(evt);

0 comments on commit d9e46d2

Please sign in to comment.