From 3b433adb42de1d8d9ecf23cb35f8a7473eb94289 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 21 Apr 2017 13:06:00 +0300 Subject: [PATCH] check if orphaned in docRewriteObserver --- apply.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apply.js b/apply.js index 7c3b7161..a2f523b2 100644 --- a/apply.js +++ b/apply.js @@ -246,6 +246,9 @@ function initDocRewriteObserver() { } // re-add styles if we detect documentElement being recreated const reinjectStyles = () => { + if (!styleElements) { + return orphanCheck && orphanCheck(); + } ROOT = document.documentElement; for (const el of styleElements.values()) { addStyleElement(document.importNode(el, true));