diff options
| author | Stephen Blott | 2014-12-21 13:07:26 +0000 |
|---|---|---|
| committer | Stephen Blott | 2014-12-21 13:07:26 +0000 |
| commit | 7ce860833fea405dae522e431a017a6135cfc54e (patch) | |
| tree | 757f245b2be131292790ec4ad1ee6af593e5e542 /pages | |
| parent | 589250a33288a458419cd7f74be518a7a062a67e (diff) | |
| download | vimium-7ce860833fea405dae522e431a017a6135cfc54e.tar.bz2 | |
Exclusion; warn on chrome pages.
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/options.coffee | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pages/options.coffee b/pages/options.coffee index d7a5f91f..eefac48b 100644 --- a/pages/options.coffee +++ b/pages/options.coffee @@ -1,4 +1,5 @@ $ = (id) -> document.getElementById id +bgUtils = chrome.extension.getBackgroundPage().Utils bgSettings = chrome.extension.getBackgroundPage().Settings bgExclusions = chrome.extension.getBackgroundPage().Exclusions @@ -251,16 +252,20 @@ initOptionsPage = -> new type(name,enableSaveButton) initPopupPage = -> - exclusions = null chrome.tabs.getSelected null, (tab) -> + exclusions = null + console.log tab.url + hasChromePrefix = bgUtils.hasChromePrefix tab.url document.getElementById("optionsLink").setAttribute "href", chrome.runtime.getURL("pages/options.html") updateState = -> rules = exclusions.readValueFromElement() isEnabled = bgExclusions.getRule tab.url, rules - console.log isEnabled + console.log hasChromePrefix $("state").innerHTML = - if isEnabled and isEnabled.passKeys + if hasChromePrefix + "Vimium cannot run on this page." + else if isEnabled and isEnabled.passKeys "Excluded: <strong class='code'>#{isEnabled.passKeys}</strong>" else if isEnabled "Disabled" |
