aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/ui_component.coffee
diff options
context:
space:
mode:
authormrmr19932015-09-21 14:44:56 +0100
committermrmr19932015-09-21 14:44:56 +0100
commitba7d0d76840ecad6844855729a0e0392ce235a2c (patch)
treede9c30b13e7263a43da0fe3a10f03c56e206fc7f /content_scripts/ui_component.coffee
parentb2a194a58def7a3b1084a6f338bb48d6edd9397b (diff)
downloadvimium-ba7d0d76840ecad6844855729a0e0392ce235a2c.tar.bz2
Add a comment explaining the choice of XMLHttpRequest for UIComponent
Diffstat (limited to 'content_scripts/ui_component.coffee')
-rw-r--r--content_scripts/ui_component.coffee2
1 files changed, 2 insertions, 0 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee
index 72627f69..74b58b82 100644
--- a/content_scripts/ui_component.coffee
+++ b/content_scripts/ui_component.coffee
@@ -12,6 +12,8 @@ class UIComponent
# Default to everything hidden while the stylesheet loads.
styleSheet.innerHTML = "iframe {display: none;}"
+ # Use an XMLHttpRequest, possibly via the background page, to fetch the stylesheet. This allows us to
+ # catch and recover from failures that we could not have caught when using CSS @include (eg. #1817).
UIComponent::styleSheetGetter ?= new AsyncDataFetcher @fetchFileContents "content_scripts/vimium.css"
@styleSheetGetter.use (styles) -> styleSheet.innerHTML = styles