diff options
| author | Stephen Blott | 2015-03-17 09:59:59 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-03-17 09:59:59 +0000 |
| commit | 5abde2faa3cbcf070de82c5dffef93c553c7ad02 (patch) | |
| tree | f511877ca52bdd51d98b1da55d773d18da4d371c /pages | |
| parent | 23cb1677bbc79328e7329fab4400f671ea6aee23 (diff) | |
| parent | 5b84f5cf94d32b6e8be75448f9c06aa7f2068582 (diff) | |
| download | vimium-5abde2faa3cbcf070de82c5dffef93c553c7ad02.tar.bz2 | |
Merge branch 'rework-exclusion-rules'
Conflicts:
content_scripts/vimium_frontend.coffee
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/options.coffee | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pages/options.coffee b/pages/options.coffee index d2950348..6545189b 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>" @@ -291,8 +295,6 @@ initPopupPage = -> Option.saveOptions() $("saveOptions").innerHTML = "Saved" $("saveOptions").disabled = true - chrome.tabs.query { windowId: chrome.windows.WINDOW_ID_CURRENT, active: true }, (tabs) -> - chrome.extension.getBackgroundPage().updateActiveState(tabs[0].id) $("saveOptions").addEventListener "click", saveOptions @@ -302,7 +304,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 |
