diff options
author | 2021-06-17 14:17:37 +0000 | |
---|---|---|
committer | 2021-06-17 19:47:37 +0530 | |
commit | a8253a9f6e5cd30760c3fcbf05767e7276b191c1 (patch) | |
tree | 32bd59f5ce3df73b91ed50728cf6a3d339e9b2e2 /src/containers/settings/EditSettingsScreen.js | |
parent | Run ALL builds if no OSes were chosen (manual trigger) (#1529) (diff) | |
download | ferdium-app-a8253a9f6e5cd30760c3fcbf05767e7276b191c1.tar.gz ferdium-app-a8253a9f6e5cd30760c3fcbf05767e7276b191c1.tar.zst ferdium-app-a8253a9f6e5cd30760c3fcbf05767e7276b191c1.zip |
User agent as a user-preference (#1535)
Introduced a global and a service-specific 'user-agent' value that can be set by the user from the preference section.
The global override is in Advanced, while the service override was moved to the bottom of the service editor form (and now occupies the full width of the form).
Show 'restart reqd' prompt for user-agent setting.
The order of the user-agent is the following:
1. Any request header overrides in the recipe will still override the user agent string.
2. If the user has set a user agent override for the service, use that.
3. If the recipe has a predefined user agent, use that.
4. If the user has set a global user agent override, use that.
5. Otherwise, use the user agent string corresponding to the underlying Electron version.
If the current webpage is the Google login form, we still remove the Chrome version number from the user agent string.
The value that would be used if no custom override is set (recipe-provided value or global override for the service, current Electron instance for the global override) is shown as a placeholder in the input box on the corresponding setting screen.
Co-authored-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'src/containers/settings/EditSettingsScreen.js')
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index a5dc427ba..2b2d7277b 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -18,6 +18,7 @@ import { config as spellcheckerConfig } from '../../features/spellchecker'; | |||
18 | 18 | ||
19 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 19 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
20 | import { hash } from '../../helpers/password-helpers'; | 20 | import { hash } from '../../helpers/password-helpers'; |
21 | import defaultUserAgent from '../../helpers/userAgent-helpers'; | ||
21 | 22 | ||
22 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; | 23 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; |
23 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 24 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
@@ -283,6 +284,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
283 | showDragArea: settingsData.showDragArea, | 284 | showDragArea: settingsData.showDragArea, |
284 | enableSpellchecking: settingsData.enableSpellchecking, | 285 | enableSpellchecking: settingsData.enableSpellchecking, |
285 | spellcheckerLanguage: settingsData.spellcheckerLanguage, | 286 | spellcheckerLanguage: settingsData.spellcheckerLanguage, |
287 | userAgentPref: settingsData.userAgentPref, | ||
286 | beta: settingsData.beta, // we need this info in the main process as well | 288 | beta: settingsData.beta, // we need this info in the main process as well |
287 | automaticUpdates: settingsData.automaticUpdates, // we need this info in the main process as well | 289 | automaticUpdates: settingsData.automaticUpdates, // we need this info in the main process as well |
288 | locale: settingsData.locale, // we need this info in the main process as well | 290 | locale: settingsData.locale, // we need this info in the main process as well |
@@ -524,6 +526,12 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
524 | options: spellcheckingLanguages, | 526 | options: spellcheckingLanguages, |
525 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, | 527 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, |
526 | }, | 528 | }, |
529 | userAgentPref: { | ||
530 | label: intl.formatMessage(globalMessages.userAgentPref), | ||
531 | value: settings.all.app.userAgentPref, | ||
532 | default: DEFAULT_APP_SETTINGS.userAgentPref, | ||
533 | placeholder: defaultUserAgent(), | ||
534 | }, | ||
527 | darkMode: { | 535 | darkMode: { |
528 | label: intl.formatMessage(messages.darkMode), | 536 | label: intl.formatMessage(messages.darkMode), |
529 | value: settings.all.app.darkMode, | 537 | value: settings.all.app.darkMode, |