diff --git a/src/js/contentscript.js b/src/js/contentscript.js index 6be19d9a8..27e22cf33 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -288,7 +288,9 @@ var domFilterer = { var styleTag = document.createElement('style'); styleTag.setAttribute('type', 'text/css'); styleTag.textContent = styleText; - document.head.appendChild(styleTag); + if ( document.head ) { + document.head.appendChild(styleTag); + } this.styleTags.push(styleTag); }