2

I need to build a console program to read and update the chrome browser setting.

Where should I start?

herme 0
  • 912
  • 1
  • 9
  • 23

2 Answers2

1

Check if you can modify the following file.

Location - c:\Users\\AppData\Local\Google\Chrome\User Data\Default\Preferences

This file contains a few settings. I have never done this so not sure if you can modify the file. But looks like a good start. Also, not sure if chrome rebuilds the file. (It was updated when I opened chrome while this file was open on my machine).

Aditya Bhave
  • 998
  • 1
  • 5
  • 10
  • This file does indeed control Chrome settings, and can be edited but unless syncing with email (which identifies you across Google apps) is turned off, the file will be rewritten each time Chrome is run and your edits will be lost. – SimonKravis Nov 30 '19 at 22:50
0

Chrome settings are stored in the registry, so here to read/write the registry and here for the list of available settings.

RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\OurSettings"); 

/// Reading value 
var value = key.GetValue("Setting1");

/// Setting value
key.SetValue("Setting1", "This is our setting 1"); 

Be aware by Google's warning if you are not developing this for internal use :

These policies are strictly intended to be used to configure instances of Google Chrome internal to your organization. Use of these policies outside of your organization (for example, in a publicly distributed program) is considered malware and will likely be labeled as malware by Google and anti-virus vendors.

Selmir
  • 1,136
  • 1
  • 11
  • 21
  • 1
    Not all settings are available as policy; since we need to touch the preference file then we might as well make all modification there. Otherwise, this would have been my preferred approach. – herme 0 Aug 24 '18 at 18:59