Browser components

Intro

迁移指南: https://www.chromium.org/developers/design-documents/cookbook/

Layered design of a component:

image-20240217102541661

What is a browser component?

image-20240217103631384

Directory structure of a browser component:

image-20240217103551252

Example: safe browsing

以security_interstitials为例来看一下component的相关实现。要测试safe browsing可以用以下网站 https://testsafebrowsing.appspot.com/ (注意在chrome里要打开安全浏览)。

README中提到SecurityInterstitialControllerClient 处理安全浏览相关的提示逻辑,搜它的子类,我们以SSLErrorControllerClient为例。如果尝试访问chrome://interstitial中关于SSL的链接会触发以下调用:

未命名绘图.drawio

相关的统计数据在单例SafeBrowsingMetricsCollectorFactory中。

https://www.chromium.org/developers/design-documents/safebrowsing/