diff --git a/edit.html b/edit.html
index c626f148..7efc20ce 100644
--- a/edit.html
+++ b/edit.html
@@ -72,7 +72,6 @@
-
diff --git a/edit/edit.js b/edit/edit.js
index 57238558..09275607 100644
--- a/edit/edit.js
+++ b/edit/edit.js
@@ -92,14 +92,12 @@ function preinit() {
});
// preload the theme so that CodeMirror can calculate its metrics in DOMContentLoaded->setupLivePrefs()
- new MutationObserver((mutations, observer) => {
- const themeElement = $('#cm-theme');
- if (themeElement) {
- themeElement.href = prefs.get('editor.theme') === 'default' ? ''
- : 'vendor/codemirror/theme/' + prefs.get('editor.theme') + '.css';
- observer.disconnect();
- }
- }).observe(document, {subtree: true, childList: true});
+ document.head.appendChild(
+ $create('link#cm-theme', {
+ rel: 'stylesheet',
+ href: prefs.get('editor.theme') === 'default' ? '' :
+ 'vendor/codemirror/theme/' + prefs.get('editor.theme') + '.css'
+ }));
if (chrome.windows) {
queryTabs({currentWindow: true}).then(tabs => {