From 03f275e6e851bbad69a78ca5295349f7759701e3 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 14 Jul 2020 09:49:30 +0200 Subject: [PATCH] custom user-agent: rename "auto-fill" button to "Disguise as" - Give Firefox and Chrome alternatives - Update firefox user-agent to 78 --- frontend/sass/service-settings.scss | 30 +++++++++++++++++------------ frontend/service-settings.html | 17 +++++++++++----- frontend/ts/service-settings.ts | 10 ++++++++-- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/frontend/sass/service-settings.scss b/frontend/sass/service-settings.scss index 732ea91..159cc35 100644 --- a/frontend/sass/service-settings.scss +++ b/frontend/sass/service-settings.scss @@ -71,21 +71,27 @@ form { margin: 8px; grid-template-columns: 0fr auto 0fr; -} -.form-group > * { - margin: 8px; - padding: 8px; - white-space: nowrap; - align-self: center; -} + &.no-expand { + display: flex; + flex-direction: row; + justify-content: center; + } -.form-group > :first-child { - justify-self: end; -} + > * { + margin: 8px; + padding: 8px; + white-space: nowrap; + align-self: center; + } -.form-group > :not(:first-child) { - margin-left: 8px; + > :first-child { + justify-self: end; + } + + > :not(:first-child) { + margin-left: 8px; + } } label.form-group { diff --git a/frontend/service-settings.html b/frontend/service-settings.html index bd0fd68..c2673cd 100644 --- a/frontend/service-settings.html +++ b/frontend/service-settings.html @@ -42,11 +42,18 @@ -
- - - -
+
+ Disguise +
+ + +
+ +
+ + +
+
diff --git a/frontend/ts/service-settings.ts b/frontend/ts/service-settings.ts index bbe591c..8419476 100644 --- a/frontend/ts/service-settings.ts +++ b/frontend/ts/service-settings.ts @@ -72,10 +72,16 @@ document.addEventListener('DOMContentLoaded', () => { ipcRenderer.send('sync-settings'); - document.getElementById('userAgentAutoFill')?.addEventListener('click', () => { + document.getElementById('userAgentAutoFillFirefox')?.addEventListener('click', () => { let customUserAgent = document.getElementById('custom-user-agent'); if (customUserAgent) { - (customUserAgent).value = 'Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0'; + (customUserAgent).value = 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0'; + } + }); + document.getElementById('userAgentAutoFillChrome')?.addEventListener('click', () => { + let customUserAgent = document.getElementById('custom-user-agent'); + if (customUserAgent) { + (customUserAgent).value = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36'; } }); });