The repository has 30 open issues spanning security vulnerabilities, crash bugs, error handling gaps, code quality improvements, test coverage, and new feature requests. Four epic issues (#1–#4) track groups of sub-tasks. This plan organizes all issues into 17 focused PRs with clear dependency ordering.
Phase 1: Critical & Crash Fixes
PR 1 — Fix XSS vulnerability in SetAttribute (#12)
Branch:fix/escape-javascript-xss
escapeJavaScript() in node.go:107-108 only escapes \ and '. Missing: ", backticks, newlines, null bytes, unicode separators. Replace string interpolation with Playwright's Evaluate argument passing to eliminate the injection surface entirely. Remove or fix escapeJavaScript for defense in depth.
sites/duckduckgo/page.go:20 — GetResults() has no error return value; ForEach error silently discarded.
Change SearchPage interface to GetResults() ([]Result, error). Update implementation and all callers. Fix Search() to return res, err.
Files:sites/duckduckgo/page.go, sites/duckduckgo/duckduckgo.go, sites/duckduckgo/cmd/duckduckgo/main.go Closes:#5, #6 → Epic #1 Must merge before PR 9 (deduplication depends on final interface).
Three different UA strings across playwright.go:94 (Firefox/142.0), interactive.go:62 (Firefox/142.0), cmd/browser/pkg/browser/flags.go:20 (Firefox/133.0 — outdated). Define const DefaultUserAgent in a central location, reference it everywhere.
Create exported mock implementations of Browser, Document, Node in a new extractortest/ package. Write HTML fixture-based tests for 2–3 extractors (duckduckgo, archive, powerball) to establish the pattern. Remaining extractors covered in follow-up.
Files: new extractortest/mock.go, new sites/*/testdata/*.html, new test files Closes:#21 → Epic #4
Starting work on this master plan. Will begin with Phase 1 (Critical & Crash Fixes) — PRs 1, 2, and 3 — since they have no dependencies and address the most urgent issues.
Plan:
PR 1 — Fix XSS vulnerability in SetAttribute (#12)
PR 3 — Fix archive cmd panic on short content (#9)
Will work through these sequentially, creating feature branches and PRs for each.
Starting work on this master plan. Will begin with Phase 1 (Critical & Crash Fixes) — PRs 1, 2, and 3 — since they have no dependencies and address the most urgent issues.
**Plan:**
1. PR 1 — Fix XSS vulnerability in SetAttribute (#12)
2. PR 2 — Fix nil-pointer panics (#10, #11)
3. PR 3 — Fix archive cmd panic on short content (#9)
Will work through these sequentially, creating feature branches and PRs for each.
Phases 1–4 are now fully complete. Moving on to Phase 5: New Site Extractors (PRs 13–17).
## Phase 4: Test Infrastructure — COMPLETE
- [x] PR 12 (#43) — Mock-based site extractor tests → Merged ✓ (Closes #21)
**Phases 1–4 are now fully complete.** Moving on to Phase 5: New Site Extractors (PRs 13–17).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
The repository has 30 open issues spanning security vulnerabilities, crash bugs, error handling gaps, code quality improvements, test coverage, and new feature requests. Four epic issues (#1–#4) track groups of sub-tasks. This plan organizes all issues into 17 focused PRs with clear dependency ordering.
Phase 1: Critical & Crash Fixes
PR 1 — Fix XSS vulnerability in SetAttribute (#12)
Branch:
fix/escape-javascript-xssescapeJavaScript()innode.go:107-108only escapes\and'. Missing:", backticks, newlines, null bytes, unicode separators. Replace string interpolation with Playwright'sEvaluateargument passing to eliminate the injection surface entirely. Remove or fixescapeJavaScriptfor defense in depth.Files:
node.go,node_test.goCloses: #12 → Epic #2
PR 2 — Fix nil-pointer panics (#10, #11)
Branch:
fix/nil-pointer-panicssites/archive/archive.go:107,114—SelectFirst(...)result immediately dereferenced without nil check. Add nil guards before.Type()and.Click().document.go:64—resp.Status()called without checking ifrespis nil. Playwright'sReload()can return nil response. Add nil guard.Files:
sites/archive/archive.go,document.goCloses: #10, #11 → Epic #1
PR 3 — Fix archive cmd panic on short content (#9)
Branch:
fix/archive-cmd-short-contentsites/archive/cmd/archive/main.go:116—article.Content[:32]panics if Content < 32 chars. Use length check (same pattern ascmd/browser/main.go:48-55).Files:
sites/archive/cmd/archive/main.goCloses: #9 → Epic #1
Phase 2: Error Handling Fixes
PR 4 — Fix DuckDuckGo error handling (#5, #6)
Branch:
fix/duckduckgo-error-handlingsites/duckduckgo/duckduckgo.go:133returnsres, nilinstead ofres, err— discardsForEacherror.sites/duckduckgo/page.go:20—GetResults()has no error return value;ForEacherror silently discarded.Change
SearchPageinterface toGetResults() ([]Result, error). Update implementation and all callers. FixSearch()to returnres, err.Files:
sites/duckduckgo/page.go,sites/duckduckgo/duckduckgo.go,sites/duckduckgo/cmd/duckduckgo/main.goCloses: #5, #6 → Epic #1
Must merge before PR 9 (deduplication depends on final interface).
PR 5 — Fix archive cmd flags and defer-before-error-check (#8, #19)
Branch:
fix/cmd-flags-and-defer-orderingsites/archive/cmd/archive/main.go:59passesFlags(archive only) instead of mergedflagsvariable. Browser flags never registered.defer DeferClose(x)placed before error check in 6+ locations:sites/duckduckgo/cmd/duckduckgo/main.go(browser creation)sites/duckduckgo/duckduckgo.go:93(doc before err check at :95)sites/google/cmd/google/main.go(browser creation)sites/wegmans/cmd/wegmans/main.go(browser creation)sites/wegmans/wegmans.go:64sites/aislegopher/aislegopher.go:54Move each
deferafter the error check.Files:
sites/archive/cmd/archive/main.go,sites/duckduckgo/cmd/duckduckgo/main.go,sites/duckduckgo/duckduckgo.go,sites/google/cmd/google/main.go,sites/wegmans/cmd/wegmans/main.go,sites/wegmans/wegmans.go,sites/aislegopher/aislegopher.goCloses: #8, #19 → Epic #1
PR 6 — Fix updateCookies error + context-aware sleep (#7, #18)
Branch:
fix/cookies-error-and-context-sleepplaywright.go:140— error frompage.Context().Cookies()never checked before iterating. Add error check.sites/archive/archive.go:122—time.Sleep(5s)ignores context. Replace with context-aware select.Files:
playwright.go,sites/archive/archive.goCloses: #7, #18 → Epic #1
Phase 3: Quality, Consistency & Enhancements
PR 7 — Fix ShowBrowser merge behavior + consistent browser defaults (#16, #15)
Branch:
fix/merge-options-and-browser-defaultsbrowser_init.go:157—base.ShowBrowser = o.ShowBrowseralways overwrites. ChangeShowBrowserto*boolinBrowserOptionssonilmeans "don't override".NewInteractiveBrowser(interactive.go:63) defaults to Chromium butNewBrowser(playwright.go:95) defaults to Firefox. Align both to Firefox.Files:
playwright.go,browser_init.go,interactive.go,cmd/browser/pkg/browser/flags.goCloses: #15, #16 → Epic #3
PR 8 — Consolidate user-agent strings (#17)
Branch:
fix/user-agent-consistencyThree different UA strings across
playwright.go:94(Firefox/142.0),interactive.go:62(Firefox/142.0),cmd/browser/pkg/browser/flags.go:20(Firefox/133.0 — outdated). Defineconst DefaultUserAgentin a central location, reference it everywhere.Files:
playwright.go,interactive.go,cmd/browser/pkg/browser/flags.goCloses: #17 → Epic #3
PR 9 — Deduplicate helpers (#13, #14)
Branch:
refactor/deduplicate-helpersnumericOnlyinline func insites/powerball/powerball.goandsites/megamillions/megamillions.go. Extract tosites/internal/parse/parse.go.duckduckgo.go:101-131nearly identical topage.go:24-54. Extract shared function.Depends on PR 4 (interface change to
GetResults).Files: new
sites/internal/parse/parse.go,sites/powerball/powerball.go,sites/megamillions/megamillions.go,sites/duckduckgo/duckduckgo.go,sites/duckduckgo/page.goCloses: #13, #14 → Epic #3
PR 10 — Fix silently ignored parsing errors (#24)
Branch:
fix/silent-parsing-errors20+ locations across site extractors discard errors with
_ =fromText(),Attr(),strconv.Atoi(),strconv.ParseFloat(). For each location:Depends on PR 9 (deduplication may consolidate some locations).
Key files:
sites/wegmans/wegmans.go,sites/aislegopher/aislegopher.go,sites/google/google.go,sites/duckduckgo/duckduckgo.go,sites/duckduckgo/page.goCloses: #24 → Epic #1
PR 11 — Thread-safe CookieJar, SameSite attr, Google countries (#20, #22, #23)
Branch:
enhance/cookies-and-googlecookies_txt.go—staticCookieJaris[]Cookiewith no sync. Wrap in struct withsync.RWMutex.cookiejar.go—Cookiestruct missingSameSitefield. Add it, update conversion functions inplaywright.go.sites/google/google.go:67-81— only 4 countries. Replaceswitchwith a comprehensive map.Files:
cookies_txt.go,cookies_txt_test.go,cookiejar.go,playwright.go,sites/google/google.go,sites/google/google_test.goCloses: #20, #22, #23 → Epics #1, #3
Phase 4: Test Infrastructure
PR 12 — Mock-based site extractor tests (#21)
Branch:
test/site-extractor-mocksCreate exported mock implementations of
Browser,Document,Nodein a newextractortest/package. Write HTML fixture-based tests for 2–3 extractors (duckduckgo, archive, powerball) to establish the pattern. Remaining extractors covered in follow-up.Files: new
extractortest/mock.go, newsites/*/testdata/*.html, new test filesCloses: #21 → Epic #4
Phase 5: New Site Extractors
PR 13 — DuckDuckGo weather + stock widget extractors (#25, #26)
Branch:
feature/duckduckgo-widgetsExtend existing
sites/duckduckgo/withweather.goandstock.go. Add CLI subcommands.Closes: #25, #26
PR 14 — CoinGecko cryptocurrency extractor (#27)
Branch:
feature/coingecko-extractorNew
sites/coingecko/following existing pattern.Closes: #27
PR 15 — Steam Store game price extractor (#28)
Branch:
feature/steam-extractorNew
sites/steam/following existing pattern.Closes: #28
PR 16 — Allrecipes recipe extractor (#29)
Branch:
feature/allrecipes-extractorNew
sites/allrecipes/following existing pattern. Leverage JSON-LD structured data.Closes: #29
PR 17 — IMDB movie/TV extractor (#30)
Branch:
feature/imdb-extractorNew
sites/imdb/following existing pattern.Closes: #30
Dependency Graph
Epic Closure
Verification (per PR)
go build ./...— compilationgo test ./...— all tests passStarting work on this master plan. Will begin with Phase 1 (Critical & Crash Fixes) — PRs 1, 2, and 3 — since they have no dependencies and address the most urgent issues.
Plan:
Will work through these sequentially, creating feature branches and PRs for each.
Progress Update — Phases 1–3 (partial)
Phase 1: Critical & Crash Fixes — COMPLETE
Phase 2: Error Handling Fixes — COMPLETE
Phase 3: Quality, Consistency & Enhancements — IN PROGRESS
Starting PR 10 and PR 11 now.
Phase 3: Quality, Consistency & Enhancements — COMPLETE
Phases 1–3 are now fully complete. All bug fixes, error handling, and quality improvements are merged.
Moving on to Phase 4: Test Infrastructure (PR 12, #21).
Phase 4: Test Infrastructure — COMPLETE
Phases 1–4 are now fully complete. Moving on to Phase 5: New Site Extractors (PRs 13–17).
Update: Added PR 18 to the plan.
Phase 5 (updated) — New Site Extractors
feature/duckduckgo-widgetsfeature/coingecko-extractorfeature/steam-extractorfeature/allrecipes-extractorfeature/imdb-extractorfeature/bambulab-extractorAll work complete. 19 PRs merged across 5 phases, resolving all 30 original open issues plus the Bambu Lab extractor (#45).
Phase 1 — Critical & Crash Fixes:
Phase 2 — Error Handling Fixes:
Phase 3 — Quality, Consistency & Enhancements:
Phase 4 — Test Infrastructure:
Phase 5 — New Site Extractors:
Epics closed:
Closing this master plan issue.