How to change Chromium configs through extension

二次信任 提交于 2019-12-13 23:38:55

问题


I need some advice about Chromium extension possibilities. Can the extension change configs of the browser such as: home page, default behavior for protocol handlers (tel, mailto), security settings ("protect from dangerous websites" for example), disable sending statistics to Google, etc.?

Which configs from chrome://settings/ can be changed and how to do it if it's possible?


回答1:


The Chrome API index is a good place to start.

From it, you can glean the following capabilities:

  • accessibilityFeatures API that deals with accessibility settings.
  • browsingData API that deals with clearing browsing data.
  • contentSettings API that deals with allowed content, site permissions and plugins.
  • downloads API can at least partially influence download settings.
  • fontSettings API can manage fonts used by Chrome.
  • management API can manage (but not install) other extensions.
  • privacy API deals with privacy-related settings (that includes some security settings).
  • proxy API can manage proxy settings.

In addition, there's a lot of Chrome OS specific APIs I won't list here.

There are also some manifest keys that can influence Chrome settings on install - such as the home page. See chrome_settings_overrides (note: not available on Linux) and to a lesser extent Override Pages.

See also Protecting user settings on Windows with the new Settings API (which announced the above).

Other than those, no, you can't override Chrome settings. You cannot dynamically change the home or search provider, you can't control protocol handlers (that's on OS level anyway), etc.

Note that you can't inject scripts into chrome://* pages, so you won't be able to just fiddle with the UI.



来源:https://stackoverflow.com/questions/45729856/how-to-change-chromium-configs-through-extension

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