diff options
| author | mrmr1993 | 2015-09-21 14:44:56 +0100 |
|---|---|---|
| committer | mrmr1993 | 2015-09-21 14:44:56 +0100 |
| commit | ba7d0d76840ecad6844855729a0e0392ce235a2c (patch) | |
| tree | de9c30b13e7263a43da0fe3a10f03c56e206fc7f /content_scripts/ui_component.coffee | |
| parent | b2a194a58def7a3b1084a6f338bb48d6edd9397b (diff) | |
| download | vimium-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.coffee | 2 |
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 |
