From fd183fc30079ba3c2cd039854f845b2dbc5cfe4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Rit?= Date: Tue, 23 Jan 2018 11:21:53 +0100 Subject: [PATCH] fix(addStyle): check if HTMLIFrameElement exist (not the case for cobalt) --- lib/addStyles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/addStyles.js b/lib/addStyles.js index 91f9d32d..752c8753 100644 --- a/lib/addStyles.js +++ b/lib/addStyles.js @@ -30,7 +30,7 @@ var getElement = (function (fn) { if (typeof memo[selector] === "undefined") { var styleTarget = fn.call(this, selector); // Special case to return head of iframe instead of iframe itself - if (styleTarget instanceof window.HTMLIFrameElement) { + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { try { // This will throw an exception if access to iframe is blocked // due to cross-origin restrictions