tianyunperfect 3 năm trước cách đây
mục cha
commit
a16da55671

+ 3 - 1
tmp/monkey/A1.js

@@ -11,9 +11,11 @@
 
 // ==/UserScript==
 (async () => {
+    if (window.top !== window.self) {
+        return;
+    }
 
     (await getDom("#notion-app ")).click();
-
     addNewStyle('.box {height: 100px !important;}');
 })();
 

+ 2 - 0
tmp/monkey/js.cookie.min.js

@@ -0,0 +1,2 @@
+/*! js-cookie v3.0.1 | MIT */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}return function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}));

+ 16 - 8
tmp/monkey/notion-字体修改.js

@@ -7,17 +7,25 @@
 // @include           https://*.notion.so/*
 // @require           https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/tmp/monkey/util.js?a=1
 // @require           https://cdn.bootcdn.net/ajax/libs/js-cookie/3.0.1/js.cookie.min.js
+// @require           https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js
 
 // ==/UserScript==
 (async () => {
-    if (localStorage.getItem(location.href)) {
+    if (window.top !== window.self) {
         return;
-    } else {
-        localStorage.setItem(location.href, "true")
-    }
-    (await getDom("#notion-app > div > div.notion-cursor-listener.showHoverText > div:nth-child(2) > div:nth-child(1) > div.notion-topbar > div:nth-child(1) > div.notion-topbar-action-buttons > div:nth-child(2) > div.notion-topbar-more-button.notion-focusable")).click();
-    let font = (await getDom("#notion-app > div > div.notion-overlay-container.notion-default-overlay-container > div:nth-child(2) > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2)"));
-    if (font) {
-        font.click();
     }
+    axios.post(`https://web_history.tianyunperfect.cn/notion/insert`, {
+        "notion_url": location.href,
+    }).then(async res => {
+        console.log(res.data)
+        if (res.data.statusCode == 200) {
+            (await getDom("#notion-app > div > div.notion-cursor-listener.showHoverText > div:nth-child(2) > div:nth-child(1) > div.notion-topbar > div:nth-child(1) > div.notion-topbar-action-buttons > div:nth-child(2) > div.notion-topbar-more-button.notion-focusable")).click();
+            let font = (await getDom("#notion-app > div > div.notion-overlay-container.notion-default-overlay-container > div:nth-child(2) > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2)"));
+            if (font) {
+                font.click();
+            }
+        }
+    }).catch(function (error) {
+        console.log(error);
+    });
 })();

+ 4 - 0
tmp/monkey/web-history.js

@@ -11,6 +11,10 @@
 
 // ==/UserScript==
 (async () => {
+    if (window.top !== window.self) {
+        return;
+    }
+
     function save() {
         if (window.top.location.href == window.location.href) {
             axios.post(`https://web_history.tianyunperfect.cn/history/insert`, {