Capture d'écran web et exécution JavaScript

VérifiéPrudence

Prend une capture d'écran d'une page web ou exécute du JavaScript avec la commande websnap. Utile pour vérifier la mise en page, les styles, le contenu rendu ou interroger des propriétés comme les dimensions et la hauteur de défilement. Supporte la taille de fenêtre configurable, la capture pleine page et l'exécution d'expressions JavaScript personnalisées.

Spar Skills Guide Bot
DeveloppementDébutant
7002/06/2026
Claude Code
#screenshot#web-page#javascript#rendering#layout

Recommandé pour

Notre avis

Capture une capture d'écran d'une page web ou exécute du JavaScript dessus, utile pour vérifier la mise en page ou inspecter le contenu.

Points forts

  • Permet de prendre des captures d'écran avec différentes largeurs/hauteurs et défilement
  • Capable d'exécuter du JavaScript arbitraire sur la page cible
  • Capture la page entière avec l'option -f
  • Sortie claire : chemin PNG pour les captures, résultat JS direct pour -r

Limites

  • Chaque appel lance un nouveau navigateur sans état persistant (pas de cookies, localStorage)
  • Nécessite un outil de lecture (Read) pour afficher l'image
  • Pas de support pour les interactions plus complexes (clic, formulaire)
Quand l'utiliser

Utilisez websnap quand vous devez vérifier visuellement le rendu d'une page ou extraire des propriétés via JavaScript.

Quand l'éviter

Évitez websnap si vous devez interagir avec la page (navigation, formulaires) ou si vous avez besoin d'un état de session persisté.

Analyse de sécurité

Prudence
Score qualité85/100

The skill runs a shell command with arguments provided by the user or the agent. While it does not explicitly perform destructive actions, the use of Bash and passing unfiltered arguments to an external tool presents a risk of command injection or unintended behavior if the websnap command fails to sanitize inputs. The -r option allows execution of arbitrary JavaScript, which could be abused if the agent or user provides malicious scripts, though this is inherent to the tool's functionality.

Points d'attention
  • Uses Bash to execute a command with user-supplied arguments, which may be vulnerable to command injection if the websnap tool does not properly sanitize inputs.

Exemples

Screenshot of a local page
/websnap http://localhost:1313/guide/
Custom viewport size
/websnap http://localhost:1313/ -w 1920 -h 1080
Run JavaScript to get page title
/websnap http://example.com -r 'document.title'

name: websnap description: Take a screenshot of a web page or run JavaScript against it. Use when checking page layout, verifying styling changes, inspecting rendered content, or querying page properties like dimensions. argument-hint: <url> [-w width] [-h height] [-y scroll] [-f] [-r js] allowed-tools: Bash, Read disable-model-invocation: true

Take a screenshot of the specified URL using websnap and display the result.

Steps

  1. Run: websnap $ARGUMENTS
  2. For screenshots: the command outputs the path to the saved PNG (in /tmp/), then use the Read tool to display the image
  3. For -r (run JS): the command outputs the JavaScript result directly (no screenshot)

Options

  • -w, --width <px> — Viewport width (default: 1280)
  • -h, --height <px> — Viewport height (default: 1080)
  • -x, --xoffset <px> — Horizontal scroll offset
  • -y, --yoffset <px> — Vertical scroll offset
  • -f, --full — Capture full page height (ignores -h)
  • -r, --run <js> — Run JavaScript and output result (no screenshot)

Examples

/websnap http://localhost:1313/guide/
/websnap http://localhost:1313/ -w 1920 -h 1080
/websnap http://localhost:1313/guide/ -y 500
/websnap http://localhost:1313/ -f
/websnap http://example.com -r 'document.title'
/websnap http://example.com -r 'document.documentElement.scrollHeight'

If no URL is provided, ask the user what page they want to screenshot.

Notes

Each call to websnap spawns a fresh browser instance. State does not persist between calls (no cookies, localStorage, or session data).

Skills similaires