diff options
| -rw-r--r-- | lib/utils.coffee | 2 | ||||
| -rw-r--r-- | pages/options.coffee | 11 | 
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee index 81b0fb49..8ee948b0 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -26,7 +26,7 @@ Utils =      -> id += 1    hasChromePrefix: do -> -    chromePrefixes = [ "about:", "view-source:", "extension:", "chrome-extension:", "data:" ] +    chromePrefixes = [ "about:", "view-source:", "extension:", "chrome://", "chrome-extension:", "data:" ]      (url) ->        if 0 < url.indexOf ":"          for prefix in chromePrefixes 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"  | 
