diff options
| author | Stephen Blott | 2015-05-11 07:05:25 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-11 07:05:25 +0100 |
| commit | 3503b5a510416e04449272a461e6765b7e7cd3f7 (patch) | |
| tree | 8b6f883bd602fcb2d2fe05a7ba157c7731bbb667 | |
| parent | 42adefc558976e2118c55f54d23e3f4e73693258 (diff) | |
| parent | ecd682bb85eeee36057444de7b055090b3468110 (diff) | |
| download | vimium-3503b5a510416e04449272a461e6765b7e7cd3f7.tar.bz2 | |
Merge pull request #1649 from mrmr1993/css-import-for-shadow-dom-styles
Use css @import rather than XMLHttpRequest for shadow DOM external style
| -rw-r--r-- | content_scripts/ui_component.coffee | 7 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 7 |
2 files changed, 2 insertions, 12 deletions
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, diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 9da99018..d6cc835d 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -336,13 +336,8 @@ window.focusThisFrame = do -> # Inject stylesheet. _styleSheet = document.createElement "style" if _styleSheet.style? - _styleSheet.innerHTML = "" + _styleSheet.innerHTML = "@import url(\"#{chrome.runtime.getURL("content_scripts/vimium.css")}\");" _shadowDOM.appendChild _styleSheet - # 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() _frameEl = document.createElement "div" _frameEl.className = "vimiumReset vimiumHighlightedFrame" |
