diff options
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 11 | ||||
| -rw-r--r-- | lib/utils.coffee | 5 |
2 files changed, 11 insertions, 5 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 6dd244de..21a05de6 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -1107,8 +1107,7 @@ Tween = CursorHider = # - # Hides the cursor when the browser scrolls, and prevent mouse from hovering while invisible - # NOTE(smblott) onScroll and onMouseMove events come in pairs. + # Hide the cursor when the browser scrolls, and prevent mouse from hovering while invisible. # cursorHideStyle: null isScrolling: false @@ -1124,12 +1123,14 @@ CursorHider = CursorHider.isScrolling = false init: -> - # NOTE(smblott) CursorHider is currently disabled pending a fix for #1345. - return + # Disable cursor hiding for Chrome versions less than 39.0.2171.71 due to a suspected browser error. + # See #1345 and #1348. + return unless Utils.haveChromeVersion "39.0.2171.71" + @cursorHideStyle = document.createElement("style") @cursorHideStyle.innerHTML = """ body * {pointer-events: none !important; cursor: none !important;} - body {cursor: none !important;} + body, html {cursor: none !important;} """ window.addEventListener "mousemove", @onMouseMove window.addEventListener "scroll", @onScroll diff --git a/lib/utils.coffee b/lib/utils.coffee index 57d8a488..2efb4716 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -124,6 +124,11 @@ Utils = return 1 0 + # True if the current Chrome version is at least the required version. + haveChromeVersion: (required) -> + chromeVersion = navigator.appVersion.match(/Chrome\/(.*?) /)?[1] + chromeVersion and 0 <= Utils.compareVersions chromeVersion, required + # Zip two (or more) arrays: # - Utils.zip([ [a,b], [1,2] ]) returns [ [a,1], [b,2] ] # - Length of result is `arrays[0].length`. |
