Browse Source

Merge pull request #2219 from maxerbox/fix-locale-language

Allow to send accept language header to websites, according to settings & edited getUserAgent regexp
pull/2230/head
Juan Manuel Gonzalez Alama 6 years ago committed by GitHub
parent
commit
d4d7c4b49e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/ux/WebView.js
  2. 2
      electron/main.js

2
app/ux/WebView.js

@ -190,7 +190,7 @@ Ext.define('Rambox.ux.WebView',{
}
,getUserAgent: function() {
var ua = ipc.sendSync('getConfig').user_agent ? ipc.sendSync('getConfig').user_agent : Ext.getStore('ServicesList').getById(this.record.get('type')).get('userAgent')
return ua.length === 0 ? window.clientInformation.userAgent.replace(/Rambox\/([0-9]\.?)+\s/,'').replace(/Electron\/([0-9]\.?)+\s/,'') : ua;
return ua.length === 0 ? window.clientInformation.userAgent.replace(/Rambox\/([0-9]\.?)+\s/ig,'').replace(/Electron\/([0-9]\.?)+\s/ig,'') : ua;
}
,statusBarConstructor: function(floating) {

2
electron/main.js

@ -58,6 +58,8 @@ if (config.get('enable_hidpi_support') && (process.platform === 'win32')) {
app.commandLine.appendSwitch('force-device-scale-factor', '1')
}
app.commandLine.appendSwitch('lang', config.get('locale') === 'en' ? 'en-US' : config.get('locale'));
// Because we build it using Squirrel, it will assign UserModelId automatically, so we match it here to display notifications correctly.
// https://github.com/electron-userland/electron-builder/issues/362
app.setAppUserModelId('com.grupovrs.ramboxce');

Loading…
Cancel
Save