Notion Font Customizer

Customize font in Notion pages.

  1. // ==UserScript==
  2. // @name Notion Font Customizer
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.1
  5. // @description Customize font in Notion pages.
  6. // @author MiracleXYZ
  7. // @include http*://www.notion.so/*
  8. // @exclude http*://www.notion.so/appcache2.html
  9. // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
  10. // ==/UserScript==
  11.  
  12.  
  13. function changeStyle() {
  14. function pathToBlock (path) {
  15. pathList = path.split("-");
  16. realPath = pathList[pathList.length - 1];
  17. return [
  18. realPath.slice(0, 8),
  19. realPath.slice(8, 12),
  20. realPath.slice(12, 16),
  21. realPath.slice(16, 20),
  22. realPath.slice(20)
  23. ].join("-");
  24. }
  25.  
  26. var blocks = [];
  27.  
  28. var pathname = window.location.pathname;
  29. var path = pathname.split("/")[2];
  30. blocks.push(pathToBlock(path));
  31.  
  32. var search = window.location.search;
  33. var params = search.slice(1).split("&");
  34. for (idx in params) {
  35. if (params[idx][0] == "p") {
  36. blocks.push(pathToBlock(params[idx].slice(2)));
  37. }
  38. };
  39.  
  40. console.log(blocks);
  41.  
  42. for (idx in blocks) {
  43. block = blocks[idx];
  44. $("div.notion-selectable[data-block-id='" + block + "']").css({
  45. "font-family": "Times New Roman, 宋体"
  46. });
  47. console.log("Font changed.");
  48. }
  49.  
  50. $("div.notion-page-content").css({
  51. "font-size": "16px",
  52. "font-family": "Times New Roman, 宋体"
  53. });
  54. }
  55.  
  56. // $(window).on("load", changeStyle);
  57.  
  58. $(document).keyup(function(e) {
  59. if(e.keyCode == 71 && e.ctrlKey && e.altKey){
  60. // alert("You pressed Ctrl + Alt + G!");
  61. changeStyle();
  62. }
  63. });
  64.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址