From a1ab89e7eae7b07d6e5bb2c257df91d07dd60ea8 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 25 Jan 2016 07:10:00 +0300 Subject: [PATCH] Don't needlessly observe iframes while loading because the browser starts loading iframes after DOMContentLoaded event anyway --- apply.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apply.js b/apply.js index c78356f6..d6527d41 100644 --- a/apply.js +++ b/apply.js @@ -142,8 +142,10 @@ function applyStyles(styleHash) { document.head.appendChild(document.getElementById(id)); } } - document.addEventListener("DOMContentLoaded", addDocumentStylesToAllIFrames); - iframeObserver.start(); + document.addEventListener("DOMContentLoaded", function() { + addDocumentStylesToAllIFrames(); + iframeObserver.start(); + }); } if (retiredStyleIds.length) {