Last active
July 16, 2021 00:25
-
-
Save jasonwoodland/a555d3007a98e9cb8fd43ee340c31193 to your computer and use it in GitHub Desktop.
Fix translate for Notion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Fix translate for Notion | |
| // @author Jason Woodland (jasonwoodland) | |
| // @include https://notion.so/* | |
| // ==/UserScript== | |
| m = new MutationObserver(() => { | |
| document.querySelectorAll('[contenteditable]').forEach(e => { | |
| e.removeAttribute('contentEditable'); | |
| e.addEventListener('dblclick', () => { | |
| e.setAttribute('contenteditable', 'true'); | |
| }); | |
| }); | |
| document.querySelectorAll('.notranslate').forEach(e => e.classList.remove('notranslate')); | |
| }) | |
| m.observe(document, { attributes: true, childList: true, subtree: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment