Notion.so Clean Todo Lists - no strikethrough or fading

This script prevents notion from adding a strikethrough and fading checked off items in a todo list.

  1. // ==UserScript==
  2. // @name Notion.so Clean Todo Lists - no strikethrough or fading
  3. // @description This script prevents notion from adding a strikethrough and fading checked off items in a todo list.
  4. // @namespace Violentmonkey Scripts
  5. // @match https://www.notion.so/*
  6. // @grant none
  7. // @version 1.0.0
  8. // ==/UserScript==
  9. //
  10.  
  11. function restyleCheckedTodos(elements){
  12. elements.forEach((e) => {
  13. if(e.style.textDecoration == 'line-through' & e.style.opacity == .375){
  14. e.style.textDecoration = 'none';
  15. e.style.opacity = 1;
  16. }
  17. });
  18. }
  19.  
  20. let config = {
  21. attributes: true,
  22. attributeFilter: ["style"],
  23. childList: true,
  24. subtree: true
  25. };
  26.  
  27. let observer = new MutationObserver((mutationsList, observer) => {
  28. // Any elements recently added or edited.
  29. restyleCheckedTodos(mutationsList.map((m) => m.target));
  30. // Anything that was missed by the above.
  31. restyleCheckedTodos(document.querySelectorAll("[contenteditable]"));
  32. });
  33.  
  34. observer.observe(document, config);

QingJ © 2025

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