From 0165d2e0664c9160cf1c86b8767e9641718745c6 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 31 Jul 2016 18:43:17 -0400 Subject: [PATCH] minor code review --- src/js/contentscript.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }