diff options
| author | Stephen Blott | 2015-04-25 10:32:30 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-04-25 10:32:30 +0100 | 
| commit | 07e65122debea72956cba6332b0f537374e965d3 (patch) | |
| tree | aed331da03230c14ce50b1ecfbe1f5cfeb05131d /background_scripts/main.coffee | |
| parent | e7ae8e0cc5aa5d4a8c7778c4a2f88b53d7cc4111 (diff) | |
| parent | 7b3b3b4b7e9b9b39cf583e857c4f384a4fff7fb1 (diff) | |
| download | vimium-07e65122debea72956cba6332b0f537374e965d3.tar.bz2 | |
Merge pull request #1580 from smblott-github/mrmr1993-exclusion-rules-pushState-and-hash
Update exclusion rules when the URL is changed by history.pushState/popState or its hash changes (v2)
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 642913a5..f11b3b4a 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -89,14 +89,20 @@ getCurrentTabUrl = (request, sender) -> sender.tab.url  # Checks the user's preferences in local storage to determine if Vimium is enabled for the given URL, and  # whether any keys should be passed through to the underlying page.  # -root.isEnabledForUrl = isEnabledForUrl = (request, sender) -> +root.isEnabledForUrl = isEnabledForUrl = (request) ->    rule = Exclusions.getRule(request.url)    {      isEnabledForUrl: not rule or rule.passKeys      passKeys: rule?.passKeys or "" -    incognito: sender.tab.incognito    } +onURLChange = (details) -> +  chrome.tabs.sendMessage details.tabId, name: "checkEnabledAfterURLChange" + +# Re-check whether Vimium is enabled for a frame when the url changes without a reload. +chrome.webNavigation.onHistoryStateUpdated.addListener onURLChange # history.pushState. +chrome.webNavigation.onReferenceFragmentUpdated.addListener onURLChange # Hash changed. +  # Retrieves the help dialog HTML template from a file, and populates it with the latest keybindings.  # This is called by options.coffee.  root.helpDialogHtml = (showUnboundCommands, showCommandNames, customTitle) -> | 
