diff options
author | Joas Schilling <coding@schilljs.com> | 2020-05-19 09:42:03 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-05-19 09:42:03 +0300 |
commit | 2cc3a434f4da294f70efba2f4a422f1642479fa0 (patch) | |
tree | 52f86fe87fb61e0086e3e029920d005bfe4aed8f /src/mixins/browserCheck.js | |
parent | 5c0d8929a82efdf41e83dc1151ed104404bdf96c (diff) |
Fix browser version comparison with Chromium
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/mixins/browserCheck.js')
-rw-r--r-- | src/mixins/browserCheck.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mixins/browserCheck.js b/src/mixins/browserCheck.js index 719f33f85..d7af88150 100644 --- a/src/mixins/browserCheck.js +++ b/src/mixins/browserCheck.js @@ -26,7 +26,7 @@ import UAParser from 'ua-parser-js' const browserCheck = { methods: { checkBrowser() { - console.info('Detected browser ' + this.browser.name + ' ' + this.browser.version) + console.info('Detected browser ' + this.browser.name + ' ' + this.majorVersion + ' (' + this.browser.version + ')') if (!this.isFullySupported) { showError( this.unsupportedWarning, @@ -58,17 +58,21 @@ const browserCheck = { return this.browser.name === 'IE' || this.browser.name === 'IEMobile' }, + majorVersion() { + return parseInt(this.browser.version.split('.')[0], 10) + }, + isFullySupported() { - return (this.isFirefox && this.browser.version >= 52) - || (this.isChrome && this.browser.version >= 49) - || (this.isSafari && this.browser.version >= 12) + return (this.isFirefox && this.majorVersion >= 52) + || (this.isChrome && this.majorVersion >= 49) + || (this.isSafari && this.majorVersion >= 12) || this.isEdge }, // Disable the call button and show the tooltip blockCalls() { - return (this.isFirefox && this.browser.version < 52) - || (this.isChrome && this.browser.version < 49) - || (this.isSafari && this.browser.version < 12) + return (this.isFirefox && this.majorVersion < 52) + || (this.isChrome && this.majorVersion < 49) + || (this.isSafari && this.majorVersion < 12) || this.isIE }, // Used both in the toast and in the call button tooltip |