aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStephen Blott2014-11-02 06:00:41 +0000
committerStephen Blott2014-11-02 06:00:41 +0000
commit406f0e0e23266fbc483fc17602cd5dbe4a581168 (patch)
tree6800ae1e3d45bacd6a71f2ab8a9622e94a78ac4c /lib
parent8afdaabd2e66a3092bc2b122443956327e0ba679 (diff)
parenta61d69ea40c9f2683107416eccab8046ab00c87d (diff)
downloadvimium-406f0e0e23266fbc483fc17602cd5dbe4a581168.tar.bz2
Merge Utils.hasChromePrefix from mrmr1993.
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.coffee12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee
index a93831d7..bbcee1a0 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -25,11 +25,13 @@ Utils =
id = 0
-> id += 1
- hasChromePrefix: (url) ->
- chromePrefixes = [ "about", "view-source", "chrome-extension", "data" ]
- for prefix in chromePrefixes
- return true if url.startsWith prefix
- false
+ hasChromePrefix: do ->
+ chromePrefixes = [ "about:", "view-source:", "chrome-extension:", "data:" ]
+ (url) ->
+ if 0 < url.indexOf ":"
+ for prefix in chromePrefixes
+ return true if url.startsWith prefix
+ false
# Completes a partial URL (without scheme)
createFullUrl: (partialUrl) ->