Add device-mode emulation (rodney emulate) #1

Open
pecheny wants to merge 1 commit from device-emulation into review-base
Owner

Why

rodney could only narrow the viewport, so hover-only CSS and UA sniffing still took the desktop path. This adds real DevTools device mode.

Changes

  • rodney emulate <device> sets Chrome device mode via rod's devices package — metrics, touch, and User-Agent together. emulate prints the current device, emulate clear restores desktop, -l rotates. 38 devices.
  • Device is stored in state and re-applied on every page attach (a CDP override dies with its session; each command is a new session).
  • screenshot honours an active emulation instead of forcing 1280x720; explicit -w/-h still overrides.

Mock PR for review before upstreaming to simonw/rodney.

🤖 Posted by Claude

# Why `rodney` could only narrow the viewport, so hover-only CSS and UA sniffing still took the desktop path. This adds real DevTools device mode. ## Changes - `rodney emulate <device>` sets Chrome device mode via rod's `devices` package — metrics, touch, and User-Agent together. `emulate` prints the current device, `emulate clear` restores desktop, `-l` rotates. 38 devices. - Device is stored in state and re-applied on every page attach (a CDP override dies with its session; each command is a new session). - `screenshot` honours an active emulation instead of forcing 1280x720; explicit `-w/-h` still overrides. Mock PR for review before upstreaming to `simonw/rodney`. 🤖 *Posted by Claude*
Add device-mode emulation (rodney emulate)
Some checks failed
Go tests / test (macos-latest) (push) Has been cancelled
Go tests / test (ubuntu-latest) (push) Has been cancelled
Go tests / test (windows-latest) (push) Has been cancelled
Go tests / test (macos-latest) (pull_request) Has been cancelled
Go tests / test (ubuntu-latest) (pull_request) Has been cancelled
Go tests / test (windows-latest) (pull_request) Has been cancelled
04091a4ac9
`rodney emulate <device>` puts Chrome in DevTools device mode via rod's
devices package — metrics (size, DPR, mobile flag, orientation), touch, and
the User-Agent together, not merely a narrow viewport. So hover-only CSS and
UA sniffing behave as they would on the device.

The device is stored in the state file and re-applied on every page attach,
because a CDP emulation override only lives as long as the session that set
it, and every rodney command is its own session.

`screenshot` now honours an active emulation instead of forcing 1280x720; an
explicit -w/-h still overrides. `emulate` prints the current device, `emulate
clear` restores the desktop viewport, `-l` rotates. 38 devices from rod.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pecheny/rodney!1
No description provided.