aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-06-03 19:01:01 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-03 19:01:01 +0200
commit2ad39ffb1cb0d0e5f79d6948f798ca79ed73c76c (patch)
treedcb679119cf4963126a3520b7c62ae4b032e0225 /src/helpers
parentUpgraded electron to '13.1.0'. (diff)
downloadferdium-app-2ad39ffb1cb0d0e5f79d6948f798ca79ed73c76c.tar.gz
ferdium-app-2ad39ffb1cb0d0e5f79d6948f798ca79ed73c76c.tar.zst
ferdium-app-2ad39ffb1cb0d0e5f79d6948f798ca79ed73c76c.zip
Expose Chrome version to todos webview (fix #1211) (#1478)
* Expose Chrome version to todos webview (fix #1211) The TickTick todo service fails to load if the Chrome version number does not appear in the User-Agent string. However, login to Google Tasks is prevented by the same. We adopt the "chromeless" User-Agent logic from the service webview, which selectively exposes the Chrome version everywhere except the Google login screen. The common logic was moved into the userAgent-helpers module. * Refactor user agent switching * "Chromeless" user agent switching is extracted into a separate model * Both the service and the todos webview uses the same model
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/userAgent-helpers.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/helpers/userAgent-helpers.js b/src/helpers/userAgent-helpers.js
index c5eee0082..73c454304 100644
--- a/src/helpers/userAgent-helpers.js
+++ b/src/helpers/userAgent-helpers.js
@@ -19,6 +19,10 @@ function linux() {
19 return 'X11; Ubuntu; Linux x86_64'; 19 return 'X11; Ubuntu; Linux x86_64';
20} 20}
21 21
22export function isChromeless(url) {
23 return url.startsWith('https://accounts.google.com');
24}
25
22export default function userAgent(removeChromeVersion = false, addFerdiVersion = false) { 26export default function userAgent(removeChromeVersion = false, addFerdiVersion = false) {
23 let platformString = ''; 27 let platformString = '';
24 28