From 7bdd0a0a97d6f83588785e0ac39d42fa91c87860 Mon Sep 17 00:00:00 2001 From: mxb Date: Thu, 18 Apr 2019 10:05:53 +0200 Subject: [PATCH 1/3] Allow to send accept language header to websites, according to settings --- electron/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/electron/main.js b/electron/main.js index d1722b57..18a57087 100644 --- a/electron/main.js +++ b/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'); From 8e19c5917028e271c2a652ff39a1c4ff84c916c1 Mon Sep 17 00:00:00 2001 From: mxb Date: Thu, 18 Apr 2019 10:20:55 +0200 Subject: [PATCH 2/3] Updated regular expressions for user agent --- app/ux/WebView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ux/WebView.js b/app/ux/WebView.js index 2c6b05ad..c67fc2ef 100644 --- a/app/ux/WebView.js +++ b/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) { From 874d79e76c55894f63bf1399ad50b5ff1ab506ad Mon Sep 17 00:00:00 2001 From: Juan Manuel Gonzalez Alama Date: Mon, 22 Apr 2019 13:06:01 -0300 Subject: [PATCH 3/3] Update main.js Code review. --- electron/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron/main.js b/electron/main.js index 18a57087..7f07c8fb 100644 --- a/electron/main.js +++ b/electron/main.js @@ -58,7 +58,7 @@ 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')) +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