From f144c7c9d3f141636ce6a3856db3abf08a4fc063 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 10 Apr 2016 11:51:32 +0100 Subject: 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'). --- content_scripts/link_hints.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'content_scripts') 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 -- cgit v1.2.3