Overview
Scroll the page to specific elements, by pixel offsets, or to page boundaries. Automatically waits for lazy-loaded content and DOM mutations to stabilize.Syntax
Arguments
CSS selector or numeric index from cached query results (0-based)
Options
Element index if selector matches multiple (0-based)
Scroll down by pixels
Scroll up by pixels
Scroll left by pixels
Scroll right by pixels
Scroll to page top
Scroll to page bottom
Skip waiting for lazy-loaded content after scroll
Output as JSON
Behavior
Element scrolling
When a selector is provided:- Scrolls element into view (centered vertically)
- Uses instant scrolling (no smooth animation)
- Returns original scroll position for restoration
Post-scroll stability
By default, waits for content to stabilize:- Network idle (no requests for 150ms)
- DOM stable (no mutations for 200ms)
- Maximum wait: 2 seconds
Examples
Scroll to element
Scroll by pixels
Scroll to boundaries
Skip waiting
Common workflows
Load more content
Navigate to section
Screenshot visible area
Scroll modes
Element-based (with selector)
- Centers element vertically in viewport
- Waits for lazy-loaded content by default
- Returns original scroll position
Relative (with pixel offsets)
- Scrolls relative to current position
- Can combine vertical and horizontal
- No element targeting
Absolute (with boundaries)
- Scrolls to fixed position
--topgoes to (0, 0)--bottomgoes to maximum scroll height
Exit codes
Success - scrolled to target
INVALID_ARGUMENTS - invalid pixel value or conflicting options
RESOURCE_NOT_FOUND - element not found
STALE_CACHE - cached index invalid (page navigation)
CDP_TIMEOUT - CDP operation timed out
Lazy loading detection
The scroll command detects lazy-loaded content through:- Network activity: Monitors resource requests via Performance Observer
- DOM mutations: Tracks element additions and changes via MutationObserver
- Stability thresholds: Waits until both network and DOM are idle
Troubleshooting
Content not loading
If lazy content doesn’t load after scroll:- Verify the page uses scroll-triggered loading
- Check scroll reached the trigger point:
bdg dom eval 'window.scrollY' - Increase wait time manually:
bdg dom scroll --bottom && sleep 2
Scroll position wrong
For elements not centered correctly:- Check element is visible:
bdg dom get <selector> - Verify element has dimensions:
bdg dom get <selector> --raw - Try scrolling by pixels instead:
bdg dom scroll --down 500
Related commands
bdg dom screenshot- Capture screenshots with--scrolloptionbdg dom query- Find elements to scroll tobdg dom eval- Check scroll position programmatically

