diff options
| author | Stephen Blott | 2016-04-10 11:51:32 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2016-04-12 06:36:03 +0100 | 
| commit | f144c7c9d3f141636ce6a3856db3abf08a4fc063 (patch) | |
| tree | d8b2dce8227e2760f2f65722a3e8450f88f7ec95 | |
| parent | 81fa2852b9ebfd1a0a2abd8b5ea374ac9bc49ca8 (diff) | |
| download | vimium-f144c7c9d3f141636ce6a3856db3abf08a4fc063.tar.bz2 | |
Set the mode indicator last.
Similarly to the previous commit: 454f5272c71388c53665d7505aa6832566284e2b.
This is intended to mitigate some CSP violations we're seeing.  In some
circumstances - as yet not fully pinned down - messages to the HUD
trigger CSP violations.  Until we track that down, we move all HUD
operations (in link hints) to the end of their execution slice.  So, if
HUD operations fail, then they won't affect any other operation.
The error message for offending HUD operations is:
ui_component.js:55:
  Failed to execute 'postMessage' on 'DOMWindow': The target origin provided
  ('chrome-extension://hiihfcebjbnoniicphblpiekhfmbdmog') does not match
  the recipient window's origin ('null').
| -rw-r--r-- | content_scripts/link_hints.coffee | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 083e214e..f2b9cd0f 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -164,7 +164,6 @@ class LinkHintsMode        keydown: @onKeyDownInMode.bind this        keypress: @onKeyPressInMode.bind this -    @setIndicator()      @hintMode.onExit (event) =>        if event?.type == "click" or (event?.type == "keydown" and          (KeyboardUtils.isEscape(event) or event.keyCode in [keyCodes.backspace, keyCodes.deleteKey])) @@ -175,6 +174,8 @@ class LinkHintsMode      @hintMarkerContainingDiv = DomUtils.addElementList (marker for marker in @hintMarkers when marker.isLocalMarker),        id: "vimiumHintMarkerContainer", className: "vimiumReset" +    @setIndicator() +    setOpenLinkMode: (@mode, shouldPropagateToOtherFrames = true) ->      if shouldPropagateToOtherFrames        HintCoordinator.sendMessage "setOpenLinkMode", modeIndex: availableModes.indexOf @mode | 
