crw icon indicating copy to clipboard operation
crw copied to clipboard

`onlyMainContent` (default true) still emits filter UI, cart drawer, live-chat widget and cookie/browser-warning text

Open thedancingdeveloper opened this issue 1 month ago • 5 comments

Environment

  • Self-hosted crw nightly on Node B, images pulled 2026-11-01, MCP crw_scrape, renderer chrome.

Repro

crw_scrape url=https://www.jbhifi.com.au/collections/tvs/cheap-tvs-50-55 (default onlyMainContent).

Expected

Product grid and heading only.

Actual

Markdown also contains: "Your browser version is unsupported. Please update...", the whole filter sidebar, "You're one step away from having this in your wishlist! Create account Log in" repeated per product, "My Cart / Your cart is empty", the "ASK JB" AI chat widget text including icon-font ligature words (arrow_downward Scroll to bottom, error_outline, close, north). Roughly 20% of the output tokens are chrome. Also lazy-load placeholder image URLs (_32x32.jpg) are emitted for every product after the first few.

Frequency

7/7 scrapes of jbhifi.com.au pages.

Log excerpt

"...Add to cartAdded\n\nCompare\n\nYou're one step away from having this in your wishlist!\n\nCreate accountLog in\n\n..."
"... arrow\\_downward Scroll to bottom \n\n arrow\\_downward Scroll to bottom ... error\\_outline Something went wrong, please try again."

thedancingdeveloper avatar Nov 01 '26 21:11 thedancingdeveloper

Disclosure: this was run on a third-party build, swack-tools/crw-build-aio-mcp, from crw 147c8d6 plus that repo's patches, with non-default renderer settings (RENDERER__MODE=chrome, RENDER_JS_DEFAULT=true, CHROME_INTERCEPT_RESOURCES=false, CHROME_CONTEXT_POOL_ENABLED=false). Sorry for not saying so when filing.

I could not reproduce this with stock crw: the stock image has no browser, and its plain-HTTP result for the same pages has none of the chat-widget or cart text. That text only appears in a Chrome-rendered DOM, and our CHROME_INTERCEPT_RESOURCES=false lets third-party scripts such as the chat widget load (stock blocks them), so part or all of this may come from that setting rather than the extractor. Leaving open until I can compare against stock crw with Chrome attached.

thedancingdeveloper avatar Nov 02 '26 02:11 thedancingdeveloper

thanks for the disclosure, that helps a lot.

CHROME_INTERCEPT_RESOURCES=false lets third-party scripts like the chat widget and cart drawer load and inject their dom, which stock blocks, so most of this is likely that setting. if you get a chance to run the same url on stock crw with chrome attached (default intercept) and something still leaks, paste the output and we will dig in.

us avatar Nov 03 '26 13:11 us

Retested on stock crw with Chrome attached, as requested.

Setup (2026-11-04): main @ 01cd667 (/health reports 0.40.0), built from the repo's docker-compose.yml with --profile heavy and the stock config.docker.toml. Default Chrome intercept, context pool on, no third-party patches. Request: POST /v1/scrape {"url":"https://www.jbhifi.com.au/collections/tvs/cheap-tvs-50-55","renderer":"chrome","formats":["markdown"]} (default onlyMainContent). Ran it 3 times and got the same output each time (renderedWith: chrome, 15188 chars of markdown).

Result: partly reproduces.

Gone on stock:

  • the "ASK JB" chat widget and the icon-font ligature words (arrow\_downward, error\_outline). There were 0 hits, so this part came from our CHROME_INTERCEPT_RESOURCES=false.

Still present on stock:

  • the browser warning, straight after the H1: # 50-55 Inch Televisions\n\nYour browser version is unsupported. Please update for best experience.
  • the wishlist prompt, 22 times (once per product): Sort by:\n\nYou're one step away from having this in your wishlist!\n\nCreate accountLog in
  • the cart drawer: ### My Cart\n\nYour cart is empty
  • the filter/sort UI (Filter, Brand, Price, Screen Size, Show: 36 / 72 / 100, Sort by:)
  • lazy-load placeholder images, 22 of them: ..._32x32.jpg

So the chat-widget part was our configuration. The rest is in the page's own DOM and still gets through onlyMainContent on stock crw with Chrome.

thedancingdeveloper avatar Nov 04 '26 11:11 thedancingdeveloper

thanks for the stock retest, that split is exactly what we needed.

reproduced on stock main with chrome, same url. what we see:

  • the browser warning shows up even with a current chrome user agent, so it is the page's own markup, not a ua check. it should still not survive onlyMainContent.
  • the wishlist prompt, the cart drawer and the filter/sort ui are the same story: page chrome getting through the main-content pass. looking at these next.
  • the _32x32.jpg urls are the lazy-load stand-ins, since the real images never load in a markdown render. those should be dropped rather than emitted.
  • one more thing we found on our side: a render could snapshot before the product grid had filled, and then you get the whole mega menu and no products. #678 adds a wait for placeholder grids, and the grid now comes through in 3 of 5 runs of this url. the remaining case, where the grid mounts after the page already looks ready, is being worked on.

will post here once the extraction side lands.

us avatar Nov 04 '26 15:11 us

the extraction side has landed in #682.

with onlyMainContent (the default) and the same chrome render of the jbhifi collection page:

  • the browser warning and the cart drawer are gone. both were hidden by an inline style on the page, and hidden markup is now dropped
  • the per-card wishlist prompt is gone
  • the _32x32.jpg blur-up placeholders are no longer emitted as product images
  • the filter, sort and page-size controls are gone
  • the product grid itself is unchanged

onlyMainContent: false still returns the page as it is.

the case where the render lands before the grid mounts (mega menu, no products) is the separate timing issue from #678 and is still being worked on.

thanks again for the stock retest, it is what made the split clear.

us avatar Nov 05 '26 16:11 us