From 46ca236c1082237177a668cc18605c4d4b72b020 Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Thu, 9 Oct 2014 13:31:23 +0200 Subject: [PATCH] Added support for Safari 7. --- core/main/client/browser.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index b611abbf5..6ffa0af3c 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -389,12 +389,20 @@ beef.browser = { return (window.navigator.userAgent.match(/ Version\/6\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome && !("MozWebSocket" in window)); }, + /** + * Returns true if Safari 7.xx + * @example: beef.browser.isS7() + */ + isS7: function () { + return (window.navigator.userAgent.match(/ Version\/7\.\d/) != null && window.navigator.userAgent.match(/Safari\/\d/) != null && !window.globalStorage && !!window.getComputedStyle && !window.opera && !window.chrome && !("MozWebSocket" in window)); + }, + /** * Returns true if Safari. * @example: beef.browser.isS() */ isS: function () { - return this.isS4() || this.isS5() || this.isS6(); + return this.isS4() || this.isS5() || this.isS6() || this.isS7(); }, /** @@ -1000,6 +1008,7 @@ beef.browser = { S4: this.isS4(), // Safari 4.xx S5: this.isS5(), // Safari 5.xx S6: this.isS6(), // Safari 6.x + S7: this.isS7(), // Safari 7.x S: this.isS() // Safari any version } }, @@ -1392,6 +1401,11 @@ beef.browser = { } ; // Safari 6 + if (this.isS7()) { + return '7' + } + ; // Safari 7 + if (this.isO9_52()) { return '9.5' }