diff options
Diffstat (limited to 'src/models/Service.js')
-rw-r--r-- | src/models/Service.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index 023103048..3ab6e2603 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -2,7 +2,7 @@ import { computed, observable, autorun } from 'mobx'; | |||
2 | import path from 'path'; | 2 | import path from 'path'; |
3 | import normalizeUrl from 'normalize-url'; | 3 | import normalizeUrl from 'normalize-url'; |
4 | 4 | ||
5 | const debug = require('debug')('Franz:Service'); | 5 | const debug = require('debug')('Ferdi:Service'); |
6 | 6 | ||
7 | export const RESTRICTION_TYPES = { | 7 | export const RESTRICTION_TYPES = { |
8 | SERVICE_LIMIT: 0, | 8 | SERVICE_LIMIT: 0, |
@@ -180,11 +180,15 @@ export default class Service { | |||
180 | } | 180 | } |
181 | 181 | ||
182 | @computed get userAgent() { | 182 | @computed get userAgent() { |
183 | let userAgent = window.navigator.userAgent; | 183 | let { userAgent } = window.navigator; |
184 | if (typeof this.recipe.overrideUserAgent === 'function') { | 184 | if (typeof this.recipe.overrideUserAgent === 'function') { |
185 | userAgent = this.recipe.overrideUserAgent(); | 185 | userAgent = this.recipe.overrideUserAgent(); |
186 | } | 186 | } |
187 | 187 | ||
188 | // Remove Ferdi as it can cause incompatabilities with services. | ||
189 | // This way, Ferdi will look like a normal Chrome instance | ||
190 | userAgent = userAgent.replace(/(Ferdi|Electron)([^\s]+\s)/g, ''); | ||
191 | |||
188 | return userAgent; | 192 | return userAgent; |
189 | } | 193 | } |
190 | 194 | ||