notion-双击打开.js 860 B

1234567891011121314151617181920212223
  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://www.notion.so/tianyunperfect/*
  8. // @require https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/tmp/monkey/util.js?a=1
  9. // ==/UserScript==
  10. (async () => {
  11. setInterval(() => {
  12. $("div[data-block-id]").off("dblclick").on("dblclick", (ev) => {
  13. ev.stopPropagation();
  14. if (ev.metaKey) {
  15. let block_id = $(ev.target).parents("div[data-block-id]").eq(0).attr('data-block-id');
  16. block_id = block_id.replaceAll("-", "")
  17. window.open("https://www.notion.so/tianyunperfect/" + block_id, "_blank");
  18. }
  19. })
  20. }, 2000)
  21. })();