Explorar el Código

fixed error when body does not exist

Gildas hace 7 años
padre
commit
0540097fa8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lib/lazy/content/content-lazy-loader.js

+ 1 - 1
lib/lazy/content/content-lazy-loader.js

@@ -81,7 +81,7 @@ this.lazyLoader = this.lazyLoader || (() => {
 	function injectScript(path) {
 		const scriptElement = document.createElement(SCRIPT_TAG_NAME);
 		scriptElement.src = browser.runtime.getURL(path);
-		document.body.appendChild(scriptElement);
+		document.documentElement.appendChild(scriptElement);
 		scriptElement.onload = () => scriptElement.remove();
 	}