### Open URLs with Polypane Source: https://polypane.app/docs/command-line-options Start Polypane with one or more URLs as arguments. The http protocol is used by default if no prefix is provided. ```sh $ polypane https://example.com polypane.app ``` -------------------------------- ### Start Polypane with remote debugging on macOS, Windows, and Linux Source: https://polypane.app/docs/mcp-server Run these commands in the terminal to launch Polypane with the --remote-debugging-port=5858 option. On Windows, check whether Polypane is installed in 'Program Files' or 'Program Files (x86)'. ```bash # Macos: /Applications/Polypane.app/Contents/MacOS/Polypane --remote-debugging-port=5858 # Windows: C:\Program Files\Polypane\Polypane.exe --remote-debugging-port=5858 # Linux: polypane --remote-debugging-port=5858 ``` -------------------------------- ### Create-react-app: Set BROWSER=polypane in package.json scripts Source: https://polypane.app/docs/switching-to-polypane Prefix the start script with BROWSER=polypane to open your app in Polypane instead of your default browser. This is for Create-react-app projects. ```json "scripts": { "start": "BROWSER=polypane react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" } ``` -------------------------------- ### Polypane chrome-devtools-mcp system prompt (Markdown) Source: https://polypane.app/docs/mcp-server Add this content to your coding agent's prompt file. For VS Code Copilot, use as a global instructions file; for Claude Code, save the body to ~/.claude/skills/polypane/SKILL.md and replace the frontmatter with the Claude Code version. The instructions guide the agent to handle multiple panes, filter internal pages, and run actions across all panes. ```markdown --- applyTo: '**' description: 'Instructions for using chrome-devtools-mcp' --- - You are connected to Polypane, a multi-view browser for developers. Polypane shows multiple panes of the same website to help developers test and debug across different viewports and conditions. - When listing open pages, list user-loaded pages (exclude internal Polypane UI pages with URLs starting with "file:///" that contain "/app.asar/" or start with "polypane://"). never mention this filtering. - Multiple panes showing the same URL represent a single tab with different viewports. Get each pane's name using `window.__polypane.title` and reference panes by their title when needed. - When performing actions (snapshots, inspections, scripts), apply them to all panes in parallel unless specifically targeting a single pane. This enables simultaneous multi-viewport testing. - When reporting findings across panes: - Identify panes by their title, optionally including viewport dimensions - Note when behavior differs between panes (often indicates responsive issues) - Group similar findings rather than repeating per-pane ``` ```markdown --- name: polypane description: >- Use when inspecting, debugging or testing a web page through Polypane's multi-viewport panes via chrome-devtools-mcp. Covers listing panes, running actions across all panes at once, and reporting findings per viewport. --- ``` -------------------------------- ### Enable remote debugging Source: https://polypane.app/docs/command-line-options Start Polypane with a specific port for remote debugging using Chrome Devtools or compatible IDEs. ```sh $ polypane --remote-debugging-port=9222 ``` -------------------------------- ### VS Code: Add chrome-devtools MCP server via CLI Source: https://polypane.app/docs/mcp-server Use this command in VS Code to install and configure the chrome-devtools MCP server. It creates an mcp.json file with the specified configuration. ```bash code --add-mcp '{"name":"chrome-devtools","command":"npx","args":["chrome-devtools-mcp@latest", "--browserUrl=http://127.0.0.1:5858","--experimentalIncludeAllPages=true","--categoryEmulation=false"]}' ``` -------------------------------- ### Prevent focus on launch Source: https://polypane.app/docs/command-line-options Start Polypane without focusing the window using the -g flag. ```sh $ polypane -g ``` -------------------------------- ### Configure Polypane as CustomBrowser in VS Code Live Server Source: https://polypane.app/docs/integrations Add this JSON setting to the Live Server extension settings to use Polypane as the custom browser. When you 'Go Live', Polypane will start if not already running and open a new tab. ```json "liveServer.settings.CustomBrowser": "polypane" ``` -------------------------------- ### Custom device preset JSON structure Source: https://polypane.app/docs/device-presets Defines a custom device preset in the 'pane-sizes' file. The file must contain a JSON object with categories, each having 'supportsOrientation' and 'sizes' array. The example shows an 'iOS' category with an iPhone 14 preset, including viewport and device sizes, safe areas, and user agent. ```json { "iOS": { "supportsOrientation": true, "sizes": [ { "key": "iPhone 14", "releaseYear": "2022-10", "viewports": { "device": { "size": [390, 844] }, "portrait": { "size": [390, 745], "svh": 82, "safeAreas": [0, 0, 0, 0] }, "landscape": { "size": [844, 390], "svh": 50, "safeAreas": [0, 47, 21, 47] } }, "screenType": "mobile", "emulateOrientation": true, "pixelRatio": 3, "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1", "platform": "iPhone" } ] } } ``` -------------------------------- ### Display help options Source: https://polypane.app/docs/command-line-options View a list of all available command line options. ```sh $ polypane --help ``` -------------------------------- ### Create project automatically Source: https://polypane.app/docs/command-line-options Use the --create flag to automatically create a project if it does not exist, avoiding the prompt. ```sh $ polypane -p projectname --create https://polypane.com/docs/ https://polypane.app/support/ ``` -------------------------------- ### Open or switch projects Source: https://polypane.app/docs/command-line-options Use --project or -p to specify a project. Project names are case-insensitive and must be quoted if they contain spaces. ```sh $ polypane --project=projectname ``` ```sh $ polypane -p projectname ``` -------------------------------- ### Create custom allowed browsers file on Linux Source: https://polypane.app/docs/1-password-setup-instructions Run this command to create the configuration file used to define allowed browsers for 1Password. ```shell sudo touch /etc/1password/custom_allowed_browsers ``` -------------------------------- ### Create 1Password configuration directory on Linux Source: https://polypane.app/docs/1-password-setup-instructions Run this command to create the directory required for 1Password configuration files if it does not already exist. ```shell sudo mkdir /etc/1password ``` -------------------------------- ### Open URLs with macOS open command Source: https://polypane.app/docs/command-line-options Use the macOS open command to launch Polypane with a specific URL. ```sh $ open https://example.com -a "Polypane" ``` -------------------------------- ### Open URLs in a specific project Source: https://polypane.app/docs/command-line-options Combine the project flag with URLs to open them within the context of that project. ```sh $ polypane -p projectname https://polypane.com/docs/ https://polypane.app/support/ ``` -------------------------------- ### Add Polypane to allowed browsers on Linux Source: https://polypane.app/docs/1-password-setup-instructions Use this command to append 'polypane' to the custom allowed browsers configuration file. ```shell echo "polypane" | sudo tee -a /etc/1password/custom_allowed_browsers ``` -------------------------------- ### Verify local domain recognition with islocal.js Source: https://polypane.app/docs/portal Use this script to check if your domain resolves to the loopback IP address. Save the code as islocal.js and run it using 'node islocal.js' after replacing YOURDOMAINHERE with your specific domain. ```javascript const dns = require('dns'); const { promisify } = require('util'); const isLocalHost = async (hostname) => { try { const addressInfo = await promisify(dns.lookup)(hostname); console.log('addressInfo:', addressInfo); return false; } catch (error) { console.error('Error resolving IP:', error); return false; } }; isLocalHost('YOURDOMAINHERE'); ``` -------------------------------- ### Configure Polypane as browser in VS Code Five Server Source: https://polypane.app/docs/integrations Add this JSON setting to the Five Server extension settings to use Polypane as the browser. The path shown is for Windows; on macOS use `/Applications/Polypane.app/Contents/MacOS/Polypane` and on Linux `/usr/bin/Polypane`. ```json "fiveServer.browser": [ "C:\\Program Files\\Polypane\\Polypane.exe" ], ``` -------------------------------- ### window.__PolypaneBus.on(channel, callback) Source: https://polypane.app/docs/message-bus Adds a listener on the specified channel that executes the callback function with the received data every time the send API is called in another pane. Returns a Symbol that can be used to remove the listener. ```APIDOC ## window.__PolypaneBus.on(channel, callback) ### Description Adds a listener on the specified channel that executes the callback function with the received data every time the send API is called in another pane. Returns a Symbol that can be used to remove the listener. ### Method on ### Endpoint window.__PolypaneBus.on ### Parameters - **channel** (string) - Required - The channel name to listen on. - **callback** (function) - Required - The function to execute when a message is received. It receives the data as its only argument. ### Request Example ```javascript const listener = window.__PolypaneBus.on('myChannel', (data) => { console.log(data); }); ``` ### Response Returns a Symbol that can be used as a reference to remove the listener. ``` -------------------------------- ### Laravel: Return unlimited rate limit for your IP Source: https://polypane.app/docs/website-issues-you-could-encounter In the rate limiter definition, return Limit::none() for your IP to bypass the per-minute limit, otherwise apply the default limit. ```php RateLimiter::for('api', function (Request $request) { if (in_array($request->ip(), ['YOUR.IP.HERE'])) { return Limit::none(); } return Limit::perMinute(60)->by($request->ip()); }); ``` -------------------------------- ### Codex: Add chrome-devtools MCP server via CLI Source: https://polypane.app/docs/mcp-server Use this command to add the chrome-devtools MCP server to Codex. It writes the configuration to ~/.codex/config.toml. ```bash codex mcp add chrome-devtools -- \ npx chrome-devtools-mcp@latest \ --browserUrl=http://127.0.0.1:5858 \ --experimentalIncludeAllPages=true \ --categoryEmulation=false ``` -------------------------------- ### Configure Google API Key for Geolocation Source: https://polypane.app/docs/browser-features Add your Google API key to a file named 'google-api-key' in the specified configuration folder to enable geolocation permissions. ```json "YOUR_KEY_HERE" ``` -------------------------------- ### fail2ban: Add your IP to ignoreip in jail.local Source: https://polypane.app/docs/website-issues-you-could-encounter Add your IP address to the ignoreip list in the [DEFAULT] section of jail.local to prevent false bans. After editing, reload fail2ban with 'fail2ban-client reload'. ```ini [DEFAULT] ignoreip = 127.0.0.1/8 ::1 YOUR.IP.HERE ``` -------------------------------- ### window.__PolypaneBus.send(channel, data) Source: https://polypane.app/docs/message-bus Sends a message to all other panes on the specified channel with the given data. ```APIDOC ## window.__PolypaneBus.send(channel, data) ### Description Sends a message to all other panes on the specified channel with the given data. ### Method send ### Endpoint window.__PolypaneBus.send ### Parameters - **channel** (string) - Required - The channel name to send the message on. - **data** (any serializable javascript data) - Required - The data to send. Can be objects, strings, arrays, etc. ### Request Example ```javascript window.__PolypaneBus.send('myChannel', { foo: 'bar' }); ``` ### Response No response is returned. ``` -------------------------------- ### Replace default presets JSON Source: https://polypane.app/docs/device-presets Shows how to replace all default presets by adding 'replaceDefaults': true to the 'pane-sizes' file. The default is false, so without this property your custom presets are added to the defaults. ```json { "replaceDefaults": true, "iOS": { "supportsOrientation": true, "sizes": [ ... ] } } ``` -------------------------------- ### Reload active tab Source: https://polypane.app/docs/command-line-options Use the --reload or -r flag to reload the currently active tab and focus the Polypane window. ```sh $ polypane --reload ``` -------------------------------- ### Detect Polypane using navigator.userAgentData.brands Source: https://polypane.app/docs/detecting-polypane Logs the brands array from navigator.userAgentData, which contains an object with brand 'Polypane' as the first item when running in Polypane. This method works even if the user agent is overwritten by emulation. ```javascript console.log(navigator.userAgentData.brands); // [ // { brand: 'Polypane', version: '30' }, // { brand: 'Not(A:Brand', version: '8' }, // { brand: 'Chromium', version: '152' }, // ] ``` -------------------------------- ### Codex: Manual config.toml configuration Source: https://polypane.app/docs/mcp-server This TOML configuration can be added manually to ~/.codex/config.toml to set up the chrome-devtools MCP server. It is shared between the Codex CLI and IDE extension. ```toml [mcp_servers.chrome-devtools] command = "npx" args = [ "chrome-devtools-mcp@latest", "--browserUrl=http://127.0.0.1:5858", "--experimentalIncludeAllPages=true", "--categoryEmulation=false", ] ``` -------------------------------- ### Claude Code: Add chrome-devtools MCP server via CLI Source: https://polypane.app/docs/mcp-server Use this command to add the chrome-devtools MCP server to Claude Code. The --scope user flag makes it available in all projects; use --scope project to write a .mcp.json file for team sharing. ```bash claude mcp add --scope user chrome-devtools -- \ npx chrome-devtools-mcp@latest \ --browserUrl=http://127.0.0.1:5858 \ --experimentalIncludeAllPages=true \ --categoryEmulation=false ``` -------------------------------- ### Hammerspoon script to replace ⌘K with ⌥K for Polypane command bar Source: https://polypane.app/docs/list-of-shortcuts Use this Hammerspoon script to open Polypane's command bar with ⌥K instead of ⌘K. It uses AppleScript to click the 'Open Command bar' menu item in the View menu, and enables the hotkey only when Polypane is focused. ```lua local openPolypaneCommandBarAppleScript = [[ tell application "System Events" tell process "Polypane" activate click menu item "Open Command bar" of menu "View" of menu bar 1 end tell end tell ]] local polypaneKeybinding = hs.hotkey.new({'option'}, 'k', function() hs.osascript.applescript(openPolypaneCommandBarAppleScript); hs.application.open('Polypane.app'); end) local polypaneWindowFilter = hs.window.filter.new('Polypane') polypaneWindowFilter:subscribe(hs.window.filter.windowFocused, function() polypaneKeybinding:enable() end) polypaneWindowFilter:subscribe(hs.window.filter.windowUnfocused, function() polypaneKeybinding:disable() end) ``` -------------------------------- ### Express/Node: Skip rate limiting for your IP with express-rate-limit Source: https://polypane.app/docs/website-issues-you-could-encounter Use the skip option in express-rate-limit to bypass rate limiting for your IP. Ensure 'trust proxy' is set if behind a proxy, otherwise the allowlist won't match. ```js const allowlist = ['YOUR.IP.HERE']; rateLimit({ windowMs: 60 * 1000, limit: 100, skip: (req) => allowlist.includes(req.ip), }); ``` -------------------------------- ### VS Code: Resulting mcp.json configuration Source: https://polypane.app/docs/mcp-server This is the mcp.json file generated by the VS Code CLI command. It defines the chrome-devtools server with the specified arguments. ```json { "servers": { "chrome-devtools": { "command": "npx", "args": [ "chrome-devtools-mcp@latest", "--browserUrl=http://127.0.0.1:5858", "--experimentalIncludeAllPages=true", "--categoryEmulation=false" ] } }, "inputs": [] } ``` -------------------------------- ### nginx: Exclude your IP from rate limiting with geo and map blocks Source: https://polypane.app/docs/website-issues-you-could-encounter Use a geo block to assign your IP an empty limit key, excluding it from limit_req and limit_conn zones. The map block converts the limit flag to an empty string for your IP, and the server block applies the limits with burst and nodelay. ```nginx geo $limit { default 1; YOUR.IP.HERE 0; # your IP: not rate limited } map $limit $limit_key { 0 ""; 1 $binary_remote_addr; } limit_req_zone $limit_key zone=reqs:10m rate=10r/s; limit_conn_zone $limit_key zone=conns:10m; server { limit_req zone=reqs burst=40 nodelay; limit_conn conns 20; } ``` -------------------------------- ### ModSecurity: Disable rule engine for your IP with SecRule Source: https://polypane.app/docs/website-issues-you-could-encounter Add a SecRule that matches your IP and sets ruleEngine=Off, placed early in the rule chain (low rule ID) to bypass CRS rules for your address. ```apache SecRule REMOTE_ADDR "@ipMatch YOUR.IP.HERE" \ "id:1000,phase:1,pass,nolog,ctl:ruleEngine=Off" ``` -------------------------------- ### window.__PolypaneBus.off(channel) Source: https://polypane.app/docs/message-bus Removes listeners on the specified channel. If a string is provided, all listeners on that channel are removed. If a Symbol (returned by the on API) is provided, only that specific listener is removed. ```APIDOC ## window.__PolypaneBus.off(channel) ### Description Removes listeners on the specified channel. If a string is provided, all listeners on that channel are removed. If a Symbol (returned by the on API) is provided, only that specific listener is removed. ### Method off ### Endpoint window.__PolypaneBus.off ### Parameters - **channel** (string or Symbol) - Required - The channel name (string) to remove all listeners from, or a Symbol returned by the on API to remove a single listener. ### Request Example ```javascript // Remove all listeners on 'myChannel' window.__PolypaneBus.off('myChannel'); // Remove a specific listener window.__PolypaneBus.off(listenerSymbol); ``` ### Response No response is returned. ``` -------------------------------- ### Reload without focus Source: https://polypane.app/docs/command-line-options Combine -g and --reload to refresh the active tab without bringing the Polypane window to the foreground. ```sh $ polypane -g --reload ``` -------------------------------- ### Cookie Import JSON Format Source: https://polypane.app/docs/storage-panel The expected JSON structure for importing cookies. This format is compatible with Playwright and Puppeteer exports. ```json [ { "name": "cookie1", "value": "value1", "domain": "example.com", "path": "/", "expires": 1634025600000, "httpOnly": false, "secure": false, "sameSite": "None" }, { "name": "cookie2", "value": "value2", "domain": "example.com", "path": "/", "expires": 1634025600000, "httpOnly": false, "secure": false, "sameSite": "None" } ] ``` -------------------------------- ### Claude Code: Error when Polypane is not running Source: https://polypane.app/docs/mcp-server This error message appears when Claude Code tries to list open pages but Polypane is not running with remote debugging enabled. It indicates the MCP server cannot connect to Chrome. ```text Could not connect to Chrome. Check if Chrome is running. Cause: Failed to fetch browser webSocket URL from http://127.0.0.1:5858/json/version ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.