feat: rendered comparison through headless Chrome

- github.com/chromedp/chromedp v0.21.0 (decision note
  2026-10-28-chromedp-rendered-crawl.md): with golem15.seo.crawl_chrome_path
  the crawl renders up to golem15.seo.crawl_render_max pages (200) and
  compares them with the raw HTML; without a path it records skipped
- guard: site host and www twin resolved and checked with
  fetchguard.IsPrivateAddr, pinned through --host-resolver-rules with a
  final MAP * ~NOTFOUND; Fetch-domain interception fails every request
  outside the site (third-party scripts never load); fresh temporary
  profile removed on Close; downloads denied; one tab, 20 s, 5 MiB DOM
- a relative or non-executable path, a private address or a Chrome that
  does not start records render_status failed; the crawl still finishes
- config keys documented; README Rendered comparison section
- TestChromeRenderer (runs with a local Chromium) and TestRendererGuards
This commit is contained in:
Jakub Zych
2026-11-04 15:58:36 +01:00
parent 96963c3067
commit b553fc2937
10 changed files with 638 additions and 9 deletions

3
go.mod
View File

@@ -5,6 +5,8 @@ go 1.27.0
require (
git.golem15.com/golem15/sm-sitemap-plugin v0.1.2
git.golem15.com/golem15/summercms v0.6.0
github.com/chromedp/cdproto v0.157.8
github.com/chromedp/chromedp v0.21.0
github.com/go-gormigrate/gormigrate/v2 v2.1.7
github.com/goccy/go-yaml v1.19.2
github.com/jackc/pgx/v5 v5.10.0
@@ -74,6 +76,7 @@ require (
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.15 // indirect
github.com/go-json-experiment/json v0.0.0-20260213210345-44df1a37e875 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect