notion-字体修改.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. // ==UserScript==
  2. // @name T-notion-字体修改
  3. // @author tianyunperfect
  4. // @description 简介
  5. // @version 1.0.0
  6. // @update 2021-07-08 16:16:14
  7. // @include https://*.notion.so/*
  8. // @require https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/monkey/util.js?a=1
  9. // @require https://cdn.bootcdn.net/ajax/libs/js-cookie/3.0.1/js.cookie.min.js
  10. // @require https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js
  11. // ==/UserScript==
  12. (async () => {
  13. if (window.top !== window.self) {
  14. return;
  15. }
  16. if (location.href.indexOf("?v") > 0) {
  17. return;
  18. }
  19. axios.post(`https://web_history.tianyunperfect.cn/notion/insert`, {
  20. "notion_url": location.href.split("?")[0].split("/").pop().split("-").pop(),
  21. }).then(async res => {
  22. console.log(res.data)
  23. if (res.data.statusCode == 200) {
  24. (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();
  25. 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)"));
  26. if (font) {
  27. font.click();
  28. }
  29. }
  30. }).catch(function (error) {
  31. console.log(error);
  32. });
  33. })();