构建最小版本的 Chromium
为什么需要 Chrome 浏览器渲染
- 动态 ajax 页面
- 页面编码异常或者结构过甚,lxml 无法解析
dirty page examples:
- 页面的 style 在 html 外面,并且有黏贴的 Word 文档。http://gzg2b.gzfinance.gov.cn/gzgpimp/portalsys/portal.do?method=pubinfoView&&info_id=-2316ce5816ab90783eb-720f&&porid=gsgg&t_k=null
- 有好多个 html 标签,并且编码不一致。http://www.be-bidding.com/gjdq/jingneng/show_zbdetail.jsp?projectcode=1180903010&flag=3&moreinfo=true
优化方案
- 不加载图片和视频,但是保留占位
- 使用 proxy api 更改代理
- 禁用 H5 相关 API
- 删除 ICU 相关
参考文献
- https://peter.sh/experiments/chromium-command-line-switches/
- https://joydig.com/port-chromium-to-embedded-linux/
- Android 上的 Chrome 裁剪,值得借鉴。https://blog.csdn.net/mogoweb/article/details/76653627
- 架构图 https://blog.csdn.net/mogoweb/article/details/76653627
- webkit 架构图 https://blog.csdn.net/a957666743/article/details/79702895
- Chrome proxy API https://developer.chrome.com/extensions/proxy
- Chrome 嵌入式裁剪,直击底层 https://joydig.com/category/chromium/
- 官方构建教程 https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md
- 编译选项https://blog.csdn.net/wanwuguicang/article/details/79751503