diff options
| author | Stephen Blott | 2015-05-27 17:06:16 +0100 | 
|---|---|---|
| committer | mrmr1993 | 2015-05-29 12:17:14 +0100 | 
| commit | 0c0e89c0e364b014a8c2836bd38902eeadcd4605 (patch) | |
| tree | ea7f2b06d27e3e662a43226e964f865ac39cd0d9 /content_scripts/ui_component.coffee | |
| parent | 3b9508d4b4ce27acd2182d793467e748c815fe94 (diff) | |
| download | vimium-0c0e89c0e364b014a8c2836bd38902eeadcd4605.tar.bz2 | |
Also disable all externally-used functions for XML.
Diffstat (limited to 'content_scripts/ui_component.coffee')
| -rw-r--r-- | content_scripts/ui_component.coffee | 16 | 
1 files changed, 10 insertions, 6 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index 5bb13496..e4cfc293 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -8,12 +8,16 @@ class UIComponent    constructor: (iframeUrl, className, @handleMessage) ->      styleSheet = document.createElement "style" -    # If this is an XML document, nothing we do here works: -    # * <style> elements show their contents inline, -    # * <iframe> elements don't load any content, -    # * document.createElement generates elements that have style == null and ignore CSS. -    # We bail here if this is the case so we're polluting the DOM to no or negative effect. -    return unless styleSheet.style +    unless styleSheet.style +      # If this is an XML document, nothing we do here works: +      # * <style> elements show their contents inline, +      # * <iframe> elements don't load any content, +      # * document.createElement generates elements that have style == null and ignore CSS. +      # If this is the case we don't want to pollute the DOM to no or negative effect.  So we bail +      # immediately, and disable all externally-called methods. +      @postMessage = @activate = @show = @hide = -> +        console.log "This vimium feature is disabled because it is incompatible with this page." +      return      styleSheet.type = "text/css"      # Default to everything hidden while the stylesheet loads.  | 
