aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/SettingsStore.js
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/stores/SettingsStore.js
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/stores/SettingsStore.js')
-rw-r--r--src/stores/SettingsStore.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js
index 15b0db120..b433efd45 100644
--- a/src/stores/SettingsStore.js
+++ b/src/stores/SettingsStore.js
@@ -320,5 +320,21 @@ export default class SettingsStore extends Store {
320 }, 320 },
321 }); 321 });
322 } 322 }
323
324 if (!this.all.migration['user-agent-settings']) {
325 this.actions.settings.update({
326 type: 'app',
327 data: {
328 userAgentPref: DEFAULT_APP_SETTINGS.userAgentPref,
329 },
330 });
331
332 this.actions.settings.update({
333 type: 'migration',
334 data: {
335 'user-agent-settings': true,
336 },
337 });
338 }
323 } 339 }
324} 340}