view-sim

v1.1.1
io.github.itelo/view-sim Checked 3 days ago Published 9 days ago

See a site on phones, tablets and laptops in Safari, Chrome, Firefox or Zen frames; PNG screenshots.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

view_sim_status Simulator status

Whether the extension is connected, and every open simulator tab with its devices, URLs and viewport sizes.

view_sim_list_devices List devices

Every device the simulator can show (phones, tablets, Macs, displays) with screen size, pixel ratio and the browsers it supports.

view_sim_open Open a URL in the simulator

Opens a URL in a new browser tab with the simulator on for its site, optionally choosing the devices. Waits until every device has loaded. The site must have been allowed once from the extension's toolbar button in Firefox/Zen.

ParameterTypeDescription
url *string
devicesarrayDevices to show, left to right. Omit to keep the site's saved devices.
framebooleanDraw device bezels, status bars and browser UI
syncbooleanNavigate every device when one of them navigates
tab_idintegerReuse this tab instead of opening a new one
zoomstringHow large devices are drawn on screen

view_sim_set_devices Set devices

Replaces the devices shown in a simulator tab and reloads them.

ParameterTypeDescription
devices *array
tab_idintegerBrowser tab id from view_sim_status. Defaults to the focused simulator tab.

view_sim_navigate Navigate

Loads a URL (absolute, or a path like /pricing) in the simulator's devices and waits for them to load. A URL on another site leaves the simulator unless that site is on too.

ParameterTypeDescription
url *string
tab_idintegerBrowser tab id from view_sim_status. Defaults to the focused simulator tab.

view_sim_set_options Set display options

Changes zoom, frames and navigation sync for a simulator tab.

ParameterTypeDescription
framebooleanDraw device bezels, status bars and browser UI
syncbooleanNavigate every device when one of them navigates
tab_idintegerBrowser tab id from view_sim_status. Defaults to the focused simulator tab.
zoomstringHow large devices are drawn on screen

view_sim_screenshot Screenshot devices

Screenshots one device, or every device in the extension's simulator tab (uses your real browser session, so signed-in pages work). mode 'device' includes the bezel and stand, 'screen' is the whole display with status bar and browser UI, 'viewport' is only the web page; 'device' and 'screen' have a transparent background. The tab is brought to the front while capturing. For screenshots without a browser window, use view_sim_headless_screenshot.

ParameterTypeDescription
deviceCard index (0 = leftmost) or device id. Omit to capture every device.
max_widthintegerImages wider than this are scaled down
modestring
save_dirstringAlso write the PNGs to this directory and return their paths
tab_idintegerBrowser tab id from view_sim_status. Defaults to the focused simulator tab.

view_sim_headless_screenshot Headless screenshot

Screenshots a URL on simulated devices without any browser window or the extension, using Playwright with real device emulation (viewport, pixel ratio, touch, mobile mode, user agent). Safari devices render in WebKit, the others in Chromium. The page can be set up first: dark mode, hidden elements, extra CSS, and steps such as clicks; selectors are Playwright selectors. 'device' and 'screen' images have a transparent background. Pages behind a login need storage_state.

ParameterTypeDescription
url *string
actionsarraySteps run in order after load and before capture, e.g. open a menu, fill a field or hover a button
color_schemestringprefers-color-scheme the page sees; omit for the browser default (light)
cssstringExtra CSS injected into the page before capture
devicesarray
enginestring
framebooleanviewport mode only: false uses the whole screen as the page instead of leaving room for status and browser bars
full_pagebooleanviewport mode only: capture the full scrollable page
hidearrayCSS selectors to hide before capture, e.g. cookie banners or chat widgets
max_widthintegerImages are rendered at most this wide (and at most at the device's pixel ratio)
modestringdevice: with bezel and stand; screen: display with status and browser bars; viewport: the web page only
reduced_motionstringprefers-reduced-motion the page sees; 'reduce' settles many animations before capture
save_dirstringAlso write the PNGs to this directory and return their paths
selectorstringSelector (CSS, or Playwright extras such as :visible and :has-text()) of an element. viewport mode captures only that element; device and screen modes scroll it to the top of the screen
storage_statestringPath to a Playwright storage-state JSON (cookies and localStorage) for signed-in pages
wait_msintegerExtra time after load, for animations and late content

view_sim_device_viewport Device page size

The page area each device leaves for the site once its status bar and browser bars are drawn, with the pixel ratio and user agent to emulate. Use it to size another browser (e.g. Playwright MCP's browser_resize) before taking a screenshot to pass to view_sim_frame. Needs no extension.

ParameterTypeDescription
devices *array

view_sim_frame Frame a screenshot

Draws a device (bezel, status bar and browser bars) around a PNG screenshot taken elsewhere, such as by Playwright MCP. Take the screenshot at the size view_sim_device_viewport gives for that device; a different shape is fitted to the device's width and cut or padded at the bottom. The result has a transparent background. Needs no extension.

ParameterTypeDescription
image_path *stringPath to the PNG screenshot of the page (the viewport only, not the whole window)
backgroundstringFills the page area below a screenshot that is too short
devicesarrayOne framed image per device
max_widthinteger
modestringdevice: with bezel and stand; screen: display with status and browser bars
save_dirstringAlso write the PNGs to this directory and return their paths
theme_colorstringThe page's theme-color, which tints Safari's bars on phones
titlestringShown on the tab, on desktop browsers
urlstringShown in the address bar

view_sim_turn_off Turn the simulator off for a site

Turns the simulator off for a hostname; its tabs show the normal page after a reload.

ParameterTypeDescription
host *stringHostname, e.g. localhost or example.com