A1.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // ==UserScript==
  2. // @name T-网站-目的
  3. // @author tianyunperfect
  4. // @description 简介
  5. // @version 1.0.0
  6. // @update 2021-07-08 16:16:14
  7. // @include *www.baidu.com*
  8. // @include *tieba.baidu.com*
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js
  10. // ==/UserScript==
  11. function sleep(time) {
  12. return new Promise((resolve) => setTimeout(resolve, time));
  13. }
  14. async function getDom(sel) {
  15. for (let i = 0; i < 100; i++) {
  16. let dom = document.querySelector(sel);
  17. console.log(dom);
  18. if (dom) {
  19. return dom;
  20. } else {
  21. await sleep(100);
  22. }
  23. }
  24. }
  25. (async () => {
  26. let a_href = (await getDom("#notion-app")).href;
  27. (await getDom("#notion-app ")).click();
  28. let sel = "#notion-app";
  29. let a_input = await getDom(sel);
  30. a_input.value = a_href;
  31. })();
  32. // =========添加css
  33. // ==UserScript==
  34. // @name T-Notion-样式
  35. // @namespace Violentmonkey Scripts
  36. // @match https://www.notion.so/tianyunperfect/*
  37. // @grant none
  38. // @version 1.0
  39. // @author -
  40. // @description 2021/9/30 下午3:02:18
  41. // @require https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.slim.min.js
  42. // ==/UserScript==
  43. (function(){
  44. $('head').append($(`
  45. <!-- CSS部分 -->
  46. <style>
  47. #notion-app > div > div.notion-cursor-listener.showHoverText > div:nth-child(2) > div.notion-frame.notionX-notionCenter > div.notion-scroller.vertical.horizontal > div:nth-child(2) > div{
  48. width: 100% !important;
  49. }
  50. #notion-app > div > div.notion-cursor-listener.showHoverText > div:nth-child(2) > div.notion-frame.notionX-notionCenter > div.notion-scroller.vertical.horizontal > div:nth-child(2) > div > div:nth-child(1) > div > div:nth-child(1) > div.notion-record-icon.notranslate.notion-focusable{
  51. margin-top: 0 !important;
  52. }
  53. .notion-page-controls{
  54. margin-top: 0 !important;
  55. }
  56. </style>`));
  57. })();