|
@@ -10,12 +10,28 @@
|
|
|
|
|
|
// ==/UserScript==
|
|
// ==/UserScript==
|
|
(async () => {
|
|
(async () => {
|
|
- setTimeout(()=> {
|
|
|
|
|
|
+ function save() {
|
|
if (window.top.location.href == window.location.href) {
|
|
if (window.top.location.href == window.location.href) {
|
|
- axios.get(`https://web_history.tianyunperfect.cn/history/insert?title=${document.title}&url=${location.href}`).then(res => {
|
|
|
|
|
|
+ axios.get(`https://web_history.tianyunperfect.cn/history/insert`, {
|
|
|
|
+ "title": document.title,
|
|
|
|
+ "url": location.href,
|
|
|
|
+ "user_id": 1
|
|
|
|
+ }).then(res => {
|
|
console.log(res.data);
|
|
console.log(res.data);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- },3000)
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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)
|
|
|
|
|
|
})();
|
|
})();
|