DevBrowser is a desktop browser built on PyQt6 and QtWebEngine (Chromium) for testing and debugging web pages. Everything you need sits in one window: device emulation, a console, an element inspector, performance metrics, a network log, a session recorder and player, an intercepting proxy and an HTTP client.
| Area | What it does |
|---|---|
| Device preview | Desktop, Laptop, Tablet and Mobile presets with matching user agents, custom sizes, rotate and preview zoom. |
| Inspector | Hover to see the margin / border / padding / content overlay. Click to select. |
| Measure | Figma-style pixel distances between the selected and hovered element (or hold Alt). |
| Grid & Outline | Pixel grid overlay and an outline around every element. |
| Console | Logs, warnings and errors with filters, plus a JavaScript prompt with history and $0, $, $$ helpers. |
| Elements | Box model, attributes, computed styles and event listeners. Edit id, class, text, inline style and outerHTML live. |
| Performance | Live FPS and JS heap charts, Web Vitals (TTFB, FCP, LCP, CLS), long tasks and DOM size, colour-coded against thresholds. |
| Network | Request log with filtering. Chromium DevTools is available in its own tab for full detail. |
| Recorder & Player | Record a session (DOM, mouse, keys, console, network, navigation) and replay it with a timeline, inspector and exports. |
| Proxy | Intercepting HTTP/HTTPS proxy: hold and edit requests and responses, history, Repeater and match-and-replace rules. |
| Query | A small Postman-like HTTP client in its own window. |
| Screenshots | Save the current view as PNG. |
Requires Python 3.11 or newer.
pip install -r requirements.txt
python main.py [url]requirements.txt should contain:
PyQt6
PyQt6-WebEngine
cryptography # optional: decrypt HTTPS in the Proxy
brotli # optional: decode "Content-Encoding: br" in the Proxy
Without the optional packages DevBrowser still works. HTTPS in the Proxy is then only tunnelled, not decrypted.
With no argument, DevBrowser reopens your last page, or the built-in demo page (about:demo) on first run.
The address bar accepts URLs, about:demo, local hosts and search terms.
- Hosts starting with
localhost,127.,192.168.,10.or0.0.0.0usehttp://. - Other hosts use
https://. - Text with spaces, or a single word without a dot, is sent to the search engine.
Pick a device from the toolbar or type a custom width × height (200–5000 px). Switching to a device with another user agent reloads the page. Zoom only scales the preview, and the layout viewport stays at the device size.
| Toggle | Behaviour |
|---|---|
⌖ Inspect (Ctrl+Shift+C) |
Hover and click to select. Page clicks are blocked while it is on. Esc turns it off. |
| ↔ Measure | Select an element, then hover another to read the distances. |
| ⊞ Grid | Overlay a pixel grid (overlay.grid_size). |
| ▢ Outline all | Outline every element. |
The panel has five tabs: Console, Elements, Performance, Network and Chromium DevTools.
In the console prompt, Enter runs the code, Shift+Enter adds a line and ↑ / ↓ browse history. Promises are awaited and their result is printed.
Press F9 to start and stop recording. The Player opens when you stop (Ctrl+Shift+P opens it any time).
- Recording follows you across page navigations, and password fields are masked.
- The Player has a timeline with markers for errors, failed requests, clicks, navigations and bookmarks.
- Side panels show Events, Console, Network, a live DOM tree, an Inspector and Info.
- Jump to the next problem, change speed, skip idle time and add bookmarks.
- Save and open recordings as
.dbrecor.dbrec.gz, or drop a file on the window. - Export the replayed DOM at any moment, or export the logs as text.
All browser traffic goes through a local proxy. It starts before the browser engine so Chromium can be configured to use it.
- Intercept (
F8): hold requests, optionally responses too, then edit, forward or drop them. - HTTP history: filter by text or scope, view raw messages, copy as cURL or send to Repeater.
- Repeater: edit and resend any raw request in multiple tabs.
- Options: port, HTTPS decryption, localhost interception, scope (regular expressions) and match-and-replace rules.
HTTPS is decrypted with a local CA created on first use. All generated certificates share one key, and Chromium is told to trust only that key. Your system trust store is not modified and certificate errors for real sites stay on. Hosts in proxy.tls_passthrough are never decrypted. WebSocket traffic is tunnelled without inspecting frames. Use the proxy only on traffic you are allowed to inspect.
Pick a method, then fill in params, headers, a JSON, text or form body, and Bearer or Basic auth. Responses show status, time and size with a pretty-printed body and headers. Passwords and tokens are kept in memory only and never saved.
| Shortcut | Action |
|---|---|
Ctrl+L |
Focus the address bar |
Ctrl+R |
Reload / stop |
F12 |
Toggle DevTools |
Ctrl+Shift+C |
Inspect |
F9 |
Start / stop recording |
Ctrl+Shift+P |
Recorder and Player |
F8 |
Intercept on / off |
Ctrl+Shift+B |
Proxy window |
Ctrl+Shift+Q |
Query window |
Ctrl+Enter |
Send request (Query) |
Settings are merged in this order (later wins, objects are merged key by key):
config/settings.json,config/devices.json(shipped defaults, don't edit)<user dir>/settings.json,<user dir>/devices.json(your overrides)
Open them from the Settings menu. Restart to apply changes.
User dir:
| System | Path |
|---|---|
| Linux | ~/.config/devbrowser |
| macOS | ~/Library/Application Support/DevBrowser |
| Windows | %APPDATA%\DevBrowser |
Set DEVBROWSER_HOME to use another folder.
| Key | Controls |
|---|---|
window |
Initial size and screen fraction |
start |
home page and restore_last_url |
search_engine, local_host_prefixes |
Address-bar behaviour |
theme |
Palette, console, card and status colours |
console |
Entry limit, font size, input height |
network |
Maximum rows in the Network tab |
performance |
Sampling interval, history length, rating thresholds |
overlay |
Overlay colours, grid size and colour, outline colour |
inspector |
Size limits and the computed properties listed in Elements |
devtools |
Dock height |
device_preview |
Stage margin, custom bezel and radius, zoom options |
recorder |
Event limit, mouse and scroll intervals, keyframe interval, what to record, masked input types, open Player on stop |
proxy |
Port, MITM, localhost, scope, skip_ext, tls_passthrough, history size, enabled |
screenshot |
Default directory and file name |
Example settings.json override:
{
"search_engine": "https://www.google.com/search?q={query}",
"start": { "home": "http://localhost:3000", "restore_last_url": false },
"overlay": { "grid_size": 4, "select_color": "#ff0080" },
"performance": { "thresholds": { "fps": [58, 45] } },
"proxy": { "port": 8080, "scope": ["^https://api\\.example\\.com/"] }
}Example devices.json override (add one, remove one):
{
"pixel": { "label": "Pixel 8 412×915", "short": "Pixel", "w": 412, "h": 915,
"ua": null, "bezel": 12, "radius": 32, "scrollbars": false },
"laptop": null
}A device with "w": null is fluid (fills the window, like Desktop).
The injected scripts get their settings from the same JSON. Edit web/js/payload.js (inspector and console) or web/js/recorder.js (recorder) to change page-side behaviour.
<user dir>/preferences.json stores UI state. It is written shortly after each change and on exit. It includes:
- Window geometry and dock layout, selected device and custom size, preview zoom
- Inspect, Measure, Grid and Outline toggles, the selected DevTools tab, console filter and "preserve log" options
- Last URL and the last screenshot, recording and export folders
- Proxy options and Repeater tabs, and the Query window's request, history and layout (never passwords or tokens)
Settings → Reset saved preferences clears it.
| Problem | Fix |
|---|---|
HTTPS shows only CONNECT rows |
Install cryptography and enable Decrypt HTTPS in Proxy → Options, then restart. |
| A page hangs | Intercept is probably holding a request. Press F8 or use Forward all. |
| Settings changes are ignored | Restart after editing settings.json or devices.json. |
| Recording shows "not active on this page" | Reload or navigate; recording starts on the next load. |
| The window layout is broken | Settings → Reset saved preferences, then restart. |
MIT. See LICENSE.