diff options
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/hud.coffee | 6 | ||||
| -rw-r--r-- | content_scripts/ui_component.coffee | 12 | ||||
| -rw-r--r-- | content_scripts/vimium.css | 11 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 2 |
4 files changed, 28 insertions, 3 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index e07d0713..f38d6b45 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -57,6 +57,12 @@ class Tween constructor: (@cssSelector, insertionPoint = document.documentElement) -> @styleElement = document.createElement "style" + + unless @styleElement.style + # We're in an XML document, so we shouldn't inject any elements. See the comment in UIComponent. + Tween::fade = Tween::stop = Tween::updateStyle = -> + return + @styleElement.type = "text/css" @styleElement.innerHTML = "" insertionPoint.appendChild @styleElement diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index ba141b23..e4cfc293 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -7,6 +7,18 @@ class UIComponent constructor: (iframeUrl, className, @handleMessage) -> styleSheet = document.createElement "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. styleSheet.innerHTML = "@import url(\"#{chrome.runtime.getURL("content_scripts/vimium.css")}\");" diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css index 647c8025..b4bce776 100644 --- a/content_scripts/vimium.css +++ b/content_scripts/vimium.css @@ -208,13 +208,18 @@ div#vimiumHelpDialog a { text-decoration: underline; } -div#vimiumHelpDialog .optionsPage { +div#vimiumHelpDialog .wikiPage, div#vimiumHelpDialog .optionsPage { position: absolute; display: block; font-size: 11px; line-height: 130%; - right: 60px; - top: 8px; + top: 6px; +} +div#vimiumHelpDialog .optionsPage { + right: 40px; +} +div#vimiumHelpDialog .wikiPage { + right: 83px; } div#vimiumHelpDialog a.closeButton:hover { color:black; diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 005412e5..c8c83029 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -1121,6 +1121,8 @@ window.showHelpDialog = (html, fid) -> chrome.runtime.sendMessage({handler: "openOptionsPageInNewTab"}) false) + # Simulating a click on the help dialog makes it the active element for scrolling. + DomUtils.simulateClick document.getElementById "vimiumHelpDialog" hideHelpDialog = (clickEvent) -> isShowingHelpDialog = false |
