From d45c116414328eb6c391bcc66bd7f7ae1995fcd3 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Thu, 9 Oct 2014 13:02:57 +0000 Subject: [PATCH] Add support for Safari 8 --- core/main/client/browser.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 6ffa0af3c..91c030050 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -397,12 +397,20 @@ beef.browser = { 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 8.xx + * @example: beef.browser.isS8() + */ + isS8: function () { + return (window.navigator.userAgent.match(/ Version\/8\.\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() || this.isS7(); + return this.isS4() || this.isS5() || this.isS6() || this.isS7() || this.isS8(); }, /** @@ -1009,6 +1017,7 @@ beef.browser = { S5: this.isS5(), // Safari 5.xx S6: this.isS6(), // Safari 6.x S7: this.isS7(), // Safari 7.x + S8: this.isS8(), // Safari 8.x S: this.isS() // Safari any version } }, @@ -1405,6 +1414,10 @@ beef.browser = { return '7' } ; // Safari 7 + if (this.isS8()) { + return '8' + } + ; // Safari 8 if (this.isO9_52()) { return '9.5'