NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name mpAutoX // @namespace http://tampermonkey.net/ // @version 0.3 // @description mpAutoX! // @author yeahMao // @match http://mp.weixin.qq.com/* // @match https://mp.weixin.qq.com/* // @icon https://www.google.com/s2/favicons?domain=tampermonkey.net // @require https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js // @require http://code.jquery.com/jquery-1.11.0.min.js // @grant GM_setValue // @grant GM_getValue // @grant GM_listValues // @grant GM_deleteValue // @grant GM_cookie // @grant unsafeWindow // @grant window // @copyright 2021, yeahmiao (https://openuserjs.org/users/yeahmiao) // @license MIT // ==/UserScript== /* chrome控制台引入第三方包 var importJs=document.createElement('script') //在页面新建一个script标签 importJs.setAttribute("type","text/javascript") //给script标签增加type属性 importJs.setAttribute("src", 'https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js') //给script标签增加src属性, url地址为cdn公共库里的 document.getElementsByTagName("head")[0].appendChild(importJs) //把importJs标签添加在页面 data:text/html,<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js"></script> */ (function() { 'use strict'; function test(fn, day) { // console.log('Enter ...'); axios({ url:"http://localhost:8089/WeChat/yeahmao/doc/%E5%89%8D%E7%AB%AF-%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91/src/first_chrome_plugin/" + fn, method:"GET", headers: { 'Cache-Control': 'no-cache' } }) .then(res=> { // console.log(res.data); let js = res.data + '\r\n main('+day+')'; eval(js); // eval(res.data); // eval(';main('+day+');'); }) .catch(reason => { console.log(reason) }) // console.log('Leave ...'); } document.body.onkeyup = function (e) { e = e || window.event; //标准化事件处理 var s = e.type + " " + e.keyCode; //获取键盘事件类型和按下的值 console.log(s, e); switch(e.keyCode){ // 获取当前按下键盘键的编码 case 37 : // 按下左箭头键,向左移动5个像素 // location.href = location.href; // $('.mh_prevbook')[0].click() test('test_session.js') break; case 39 : // 按下右箭头键,向右移动5个像素 //$('.mh_prevbook')[1].click() test('test.js'); break; case 38 : // 按下上箭头键,向上移动5个像素 //box.style.top = box.offsetTop - 5 + "px"; break; case 40 : // 按下下箭头键,向下移动5个像素 //box.style.top = box.offsetTop + 5 + "px"; break; case 0x31 : // 1 case 0x61 : // 小键盘 1 console.log('发布今天的') test('tampermonkey_mpauto.js', 1) break; case 0x32 : // 2 case 0x62 : // 小键盘 2 console.log('发布明天的') test('tampermonkey_mpauto.js', 2) break; } return false } return; // Your code here... console.log("NewFoo.........", jQuery, axios); console.log(GM); GM_cookie("list", { path: "/" }, function(c) { console.log(c); for(let i = 0; i < c.length; i++){ // console.log(c[i]); } }); })();