aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-06-17 14:17:37 +0000
committerLibravatar GitHub <noreply@github.com>2021-06-17 19:47:37 +0530
commita8253a9f6e5cd30760c3fcbf05767e7276b191c1 (patch)
tree32bd59f5ce3df73b91ed50728cf6a3d339e9b2e2 /src/components/settings
parentRun ALL builds if no OSes were chosen (manual trigger) (#1529) (diff)
downloadferdium-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/components/settings')
-rw-r--r--src/components/settings/services/EditServiceForm.js4
-rw-r--r--src/components/settings/settings/EditSettingsForm.js16
2 files changed, 18 insertions, 2 deletions
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js
index 025a667db..1bbc1f1d4 100644
--- a/src/components/settings/services/EditServiceForm.js
+++ b/src/components/settings/services/EditServiceForm.js
@@ -454,6 +454,10 @@ export default @observer class EditServiceForm extends Component {
454 </div> 454 </div>
455 </PremiumFeatureContainer> 455 </PremiumFeatureContainer>
456 )} 456 )}
457
458 <div className="user-agent">
459 <Input field={form.$('userAgentPref')} />
460 </div>
457 </form> 461 </form>
458 462
459 {action === 'edit' && ( 463 {action === 'edit' && (
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js
index b7e007186..d31bb8933 100644
--- a/src/components/settings/settings/EditSettingsForm.js
+++ b/src/components/settings/settings/EditSettingsForm.js
@@ -141,7 +141,7 @@ const messages = defineMessages({
141 id: 'settings.app.currentVersion', 141 id: 'settings.app.currentVersion',
142 defaultMessage: '!!!Current version:', 142 defaultMessage: '!!!Current version:',
143 }, 143 },
144 enableGPUAccelerationInfo: { 144 appRestartRequired: {
145 id: 'settings.app.restartRequired', 145 id: 'settings.app.restartRequired',
146 defaultMessage: '!!!Changes require restart', 146 defaultMessage: '!!!Changes require restart',
147 }, 147 },
@@ -596,7 +596,19 @@ export default @observer class EditSettingsForm extends Component {
596 { this.state.activeSetttingsTab === 'advanced' && ( 596 { this.state.activeSetttingsTab === 'advanced' && (
597 <div> 597 <div>
598 <Toggle field={form.$('enableGPUAcceleration')} /> 598 <Toggle field={form.$('enableGPUAcceleration')} />
599 <p className="settings__help">{intl.formatMessage(messages.enableGPUAccelerationInfo)}</p> 599 <p className="settings__help">{intl.formatMessage(messages.appRestartRequired)}</p>
600
601 <Hr />
602
603 <Input
604 placeholder="User Agent"
605 onChange={e => this.submit(e)}
606 field={form.$('userAgentPref')}
607 />
608 <p className="settings__help">{intl.formatMessage(messages.appRestartRequired)}</p>
609
610 <Hr />
611
600 <div className="settings__settings-group"> 612 <div className="settings__settings-group">
601 <h3> 613 <h3>
602 {intl.formatMessage(messages.subheadlineCache)} 614 {intl.formatMessage(messages.subheadlineCache)}