// ==UserScript== // @name T-All-历史记录 // @author tianyunperfect // @description 简介 // @version 1.0.0 // @update 2021-07-08 16:16:14 // @match *://*/* // @require https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/tmp/monkey/util.js?a=2022年05月15日 // @require https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js // ==/UserScript== (async () => { function save() { if (window.top.location.href == window.location.href) { axios.post(`https://web_history.tianyunperfect.cn/history/insert`, { "title": document.title, "url": location.href, "user_id": 1 }).then(res => { console.log(res.data); }); } } setTimeout(() => { let t_href = "t_href" localStorage.setItem(t_href, location.href); save(); setInterval(() => { if (localStorage.getItem(t_href) !== location.href) { localStorage.setItem(t_href, location.href); save(); } }, 5000) }, 3000) })();