Skip to content

renderJs: false appears to still use Lightpanda when Lightpanda is configured #346

Description

@Antardas

Summary

When a Lightpanda container is configured in Docker Compose, renderJs: false appears to produce the same result as renderJs: true.

Based on my understanding, I would expect renderJs: false to skip JavaScript rendering entirely and return the raw HTML result.

Environment

  • Self-hosted FastCRW
  • Docker Compose with a Lightpanda container

Request

curl -X POST http://localhost:4050/v2/scrape \
  -H "Content-Type: application/json" \
  -d '{
    "url":"https://ahbab.com.bd/product/creative-wooden-gun-shaped-mini-ballpoint-pen-05-solid-wood-metal-pen-body-color-pear-wood-rbo2pp",
    "renderJs": false,
    "formats":["markdown"],
    "onlyMainContent": true,
    "waitFor": 2500
  }'

I also tested the same request with:

"renderJs": true

Docker Compose

version: "3.9"

services:
  crw:
    image: ghcr.io/us/crw:0.26.0
    container_name: crw
    restart: unless-stopped

    ports:
      - "4050:3000"
    read_only: true

    tmpfs:
      - /tmp
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    mem_limit: 2g
    memswap_limit: 2g

    pids_limit: 512
    environment:
      - CRW_RENDERER__LIGHTPANDA__WS_URL=ws://lightpanda:9222

  lightpanda:
    image: lightpanda/browser:nightly
    restart: unless-stopped
    command:
      - lightpanda
      - serve
      - --host
      - 0.0.0.0
      - --port
      - "9222"

Observed behavior

When the Lightpanda container is running:

  • renderJs: false returns the same output as renderJs: true.
  • The response appears to contain JavaScript-rendered content.

When I stop/remove the Lightpanda container:

  • renderJs: false returns the expected non-rendered result.

This makes it seem like requests may still be going through Lightpanda even when renderJs is set to false.

Expected behavior

I would expect:

  • renderJs: false → Never use Lightpanda. Return the raw/non-JavaScript-rendered page.
  • renderJs: true → Use Lightpanda and return the JavaScript-rendered page.

Question

Is this the intended behavior, or is renderJs: false expected to completely bypass the Lightpanda renderer when it is available?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions