aboutsummaryrefslogtreecommitdiffstats
path: root/pages/options.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'pages/options.coffee')
-rw-r--r--pages/options.coffee8
1 files changed, 6 insertions, 2 deletions
diff --git a/pages/options.coffee b/pages/options.coffee
index d2950348..61b055c2 100644
--- a/pages/options.coffee
+++ b/pages/options.coffee
@@ -271,8 +271,12 @@ initPopupPage = ->
exclusions = null
document.getElementById("optionsLink").setAttribute "href", chrome.runtime.getURL("pages/options.html")
+ # As the active URL, we choose the most recently registered URL from a frame in the tab, or the tab's own
+ # URL.
+ url = chrome.extension.getBackgroundPage().urlForTab[tab.id] || tab.url
+
updateState = ->
- rule = bgExclusions.getRule tab.url, exclusions.readValueFromElement()
+ rule = bgExclusions.getRule url, exclusions.readValueFromElement()
$("state").innerHTML = "Vimium will " +
if rule and rule.passKeys
"exclude <span class='code'>#{rule.passKeys}</span>"
@@ -302,7 +306,7 @@ initPopupPage = ->
window.close()
# Populate options. Just one, here.
- exclusions = new ExclusionRulesOnPopupOption(tab.url, "exclusionRules", onUpdated)
+ exclusions = new ExclusionRulesOnPopupOption(url, "exclusionRules", onUpdated)
updateState()
document.addEventListener "keyup", updateState