Chrome Extension: How can I get global settings in preference

南楼画角 提交于 2019-12-24 05:00:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!