油猴脚本写法
- 添加插件tampermonkey,360极速浏览器应用商店里就有
- 点击插件 - 添加新脚本
- 编写脚本
// ==UserScript==
// @name 文件名
// @namespace 命名空间
// @version 版本号
// @description 描述
// @author 作者
// @match 应用网站1
// @match 应用网站2
// @grant none
// ==/UserScript==
// Your code here… 处填入代码
e.g.
// ==UserScript==
// @name test_code
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 重载测试脚本
// @author CSDN 叶志豪2020
// @match *://www.baidu.com/*
// @match *://www.jd.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
//从此开始编写JS代码
//自动重载页面
// 测试代码
setInterval(function(){fun();},5000);
function fun(){
location.reload()
}
// *://localhost:8080/*
})();
- ctrl-s 保存脚本