问题
As you know that there are many entries in chrome://settings, is there any way that I can read the value in my extension JS code? e.g. get the "homepage", "account_info" etc.
The values present in the file names Preferences which locates in folder Google\Chrome\User Data\Default.
Thanks. Easton
回答1:
Marco's answer stating you can't access settings is not entirely true.
Chrome APIs provide access to some settings:
- accessibility,
- privacy settings,
- font settings,
- content settings,
and maybe the identity API can read account info.
Homepage, though, is not directly accessible, as are many other settings. It is correct that this is done for security reasons.
回答2:
Unfortunately, I'm afraid you cannot read Chrome settings. Chrome doesn't provide any API to manipulate/read/overwrite the browser settings. It's easy to wonder why this isn't possible: it's a basic security measure.
来源:https://stackoverflow.com/questions/27979202/chrome-extension-how-can-i-get-global-settings-in-preference