12345678910111213141516171819202122232425262728293031323334353637 |
- // ==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, document.title);
- save();
- setInterval(() => {
- if (localStorage.getItem(t_href) !== document.title) {
- localStorage.setItem(t_href, document.title);
- save();
- }
- }, 5000)
- }, 5000)
- })();
|