diff options
| author | mrmr1993 | 2017-11-02 18:31:32 +0000 | 
|---|---|---|
| committer | mrmr1993 | 2017-11-02 18:31:32 +0000 | 
| commit | f10dfa843c60266504469fb5ea4d6222b051364b (patch) | |
| tree | 1491fc98ebe6250f8b42b84d359eded4aca300af /content_scripts | |
| parent | 73b1bd8057ef9b71f12bca5e81dae0103281800b (diff) | |
| download | vimium-f10dfa843c60266504469fb5ea4d6222b051364b.tar.bz2 | |
Replace all references to selection.type with our FF polyfill
Credit to @gdh1995 for catching these oversights.
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/mode_find.coffee | 13 | 
1 files changed, 5 insertions, 8 deletions
| diff --git a/content_scripts/mode_find.coffee b/content_scripts/mode_find.coffee index 950b08e9..f19b5db4 100644 --- a/content_scripts/mode_find.coffee +++ b/content_scripts/mode_find.coffee @@ -6,7 +6,7 @@ class SuppressPrintable extends Mode    constructor: (options) ->      super options      handler = (event) => if KeyboardUtils.isPrintable event then @suppressEvent else @continueBubbling -    type = document.getSelection().type +    type = DomUtils.getSelectionType()      # We use unshift here, so we see events after normal mode, so we only see unmapped keys.      @unshift @@ -16,7 +16,7 @@ class SuppressPrintable extends Mode        keyup: (event) =>          # If the selection type has changed (usually, no longer "Range"), then the user is interacting with          # the input element, so we get out of the way.  See discussion of option 5c from #1415. -        @exit() if document.getSelection().type != type +        @exit() if DomUtils.getSelectionType() != type  # When we use find, the selection/focus can land in a focusable/editable element.  In this situation, special  # considerations apply.  We implement three special cases: @@ -235,17 +235,14 @@ class FindMode extends Mode  getCurrentRange = ->    selection = getSelection() -  if selection.type == "None" +  if DomUtils.getSelectionType(selection) == "None"      range = document.createRange()      range.setStart document.body, 0      range.setEnd document.body, 0      range    else -    selection.collapseToStart() if selection.type == "Range" -    if selection.rangeCount > 0 -      selection.getRangeAt 0 -    else # Firefox returns a selection with no ranges and null anchor/focusNode in some situations. -      null +    selection.collapseToStart() if DomUtils.getSelectionType(selection) == "Range" +    selection.getRangeAt 0  getLinkFromSelection = ->    node = window.getSelection().anchorNode | 
