From f9cb424fad03042353e8720398b390dd8b2281d0 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Fri, 27 Dec 2013 10:05:41 +0530 Subject: Allow open popups from bookmarklets. Fix #968. Use the `openUrlInCurrentTab` message to open bookmarklets so they are opened via `chrome.tabs.update` instead of an injected script element. This allows bookmarklets to open popups. --- lib/utils.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/utils.coffee') diff --git a/lib/utils.coffee b/lib/utils.coffee index a93831d7..5d93ae70 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -26,7 +26,7 @@ Utils = -> id += 1 hasChromePrefix: (url) -> - chromePrefixes = [ "about", "view-source", "chrome-extension", "data" ] + chromePrefixes = ["about:", "view-source:", "chrome-extension:", "data:", "javascript:"] for prefix in chromePrefixes return true if url.startsWith prefix false -- cgit v1.2.3 From 226cfb8011e83e48b9c723ebc891ad0e9a7c82ec Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 19 Dec 2014 05:38:29 +0000 Subject: Tidy cursor hider, move haveChromeVersion to utils. --- lib/utils.coffee | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/utils.coffee') diff --git a/lib/utils.coffee b/lib/utils.coffee index 57d8a488..2efb4716 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -124,6 +124,11 @@ Utils = return 1 0 + # True if the current Chrome version is at least the required version. + haveChromeVersion: (required) -> + chromeVersion = navigator.appVersion.match(/Chrome\/(.*?) /)?[1] + chromeVersion and 0 <= Utils.compareVersions chromeVersion, required + # Zip two (or more) arrays: # - Utils.zip([ [a,b], [1,2] ]) returns [ [a,1], [b,2] ] # - Length of result is `arrays[0].length`. -- cgit v1.2.3