diff --git a/extension/lib/events-frame.coffee b/extension/lib/events-frame.coffee index 71e90a48..bac51084 100644 --- a/extension/lib/events-frame.coffee +++ b/extension/lib/events-frame.coffee @@ -95,6 +95,7 @@ class FrameEventManager if target == @vim.content.document messageManager.send('frameCanReceiveEvents', false) + @vim.enterMode('normal') if @vim.mode =='hints' # If the target isn’t the topmost document, it means that a frame has # changed: It could have been removed or its `src` attribute could have diff --git a/extension/lib/vim.coffee b/extension/lib/vim.coffee index 0e6d7c53..b12ec44b 100644 --- a/extension/lib/vim.coffee +++ b/extension/lib/vim.coffee @@ -33,6 +33,7 @@ ChromeWindow = Ci.nsIDOMChromeWindow class Vim constructor: (browser, @_parent) -> + @mode = undefined @focusType = 'none' @_setBrowser(browser, {addListeners: false}) @_storage = {} @@ -128,11 +129,12 @@ class Vim return suppress _onLocationChange: (url) -> - unless @mode == 'ignore' and @_storage.ignore.type == 'explicit' - if @_isBlacklisted(url) + switch + when @_isBlacklisted(url) @enterMode('ignore', {type: 'blacklist'}) - else - @enterMode('normal') unless @mode == 'find' + when (@mode == 'ignore' and @_storage.ignore.type == 'blacklist') or + not @mode + @enterMode('normal') @_parent.emit('locationChange', {vim: this, location: new @window.URL(url)}) _call: (method, data = {}, extraArgs...) ->