From ecd682bb85eeee36057444de7b055090b3468110 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Mon, 11 May 2015 02:00:38 +0100 Subject: Use css @import rather than XMLHttpRequest for shadow DOM external style --- content_scripts/ui_component.coffee | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'content_scripts/ui_component.coffee') diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index 61c45136..5e0bd5d5 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -8,12 +8,7 @@ class UIComponent styleSheet = document.createElement "style" styleSheet.type = "text/css" # Default to everything hidden while the stylesheet loads. - styleSheet.innerHTML = "* {display: none !important;}" - # Load stylesheet. - xhr = new XMLHttpRequest() - xhr.onload = (e) -> styleSheet.innerHTML = xhr.responseText - xhr.open "GET", chrome.runtime.getURL("content_scripts/vimium.css"), true - xhr.send() + styleSheet.innerHTML = "@import url(\"#{chrome.runtime.getURL("content_scripts/vimium.css")}\");" @iframeElement = document.createElement "iframe" extend @iframeElement, -- cgit v1.2.3