Skip to content

Instantly share code, notes, and snippets.

@jasonwoodland
Last active July 16, 2021 00:25
Show Gist options
  • Select an option

  • Save jasonwoodland/a555d3007a98e9cb8fd43ee340c31193 to your computer and use it in GitHub Desktop.

Select an option

Save jasonwoodland/a555d3007a98e9cb8fd43ee340c31193 to your computer and use it in GitHub Desktop.
Fix translate for Notion
// ==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