Next-Gen Framework-Agnostic In-App Mobile Debugger & Inspector Overlay for Web Applications
- π Comprehensive Documentation Suite
- πΈ Showcase
- π‘ Motivation & Why Use It?
- β¨ Core Capabilities
- ποΈ Technical Architecture
- π Framework Quickstart
- βοΈ Full Configuration & Props Reference
- π¨ Theme Engine & Customization
- π Monorepo Structure
- π οΈ Development Setup
- π License
Debugging mobile web applications or QA staging builds on physical smartphones, tablets, or embedded webviews is historically painful:
- β Requiring physical USB debugging cables connected to a desktop computer.
- β Configuring Safari Remote Inspector or Chrome Inspect ports over local WiFi.
- β Losing console logs when a mobile browser crashes or refreshes.
- β Inability to inspect network traffic on production staging environments without desktop proxies (Charles / Fiddler / Proxyman).
mobile-devtools eliminates these pain points entirely. It embeds a lightweight, high-performance floating badge and overlay drawer directly inside your web application. You can inspect logs, monitor network calls, browse DOM trees, edit local storage, and inspect device specs anytime, anywhere β directly on screen without external tools or cables.
- β‘ Ultra-Lightweight & Fast: Extremely small footprint (~2.0 kB gzipped / ~5.8 kB minified) with zero runtime dependencies, ensuring zero impact on page load speed or mobile frame rates.
- π³ DOM Elements Inspector (Elements Tab): Real-time HTML DOM tree browser, node expansion, interactive element picker, box model visualization (margin, border, padding, content), computed CSS styles, and grouped style categories (Layout, Flexbox, Grid, Typography, Colors).
- π Quick Bug Exporter: Instant 1-click bug report sharing via Web Share API (
navigator.share) to WhatsApp, Telegram, Slack, AirDrop, or Email with text file download and copy fallbacks. - π Network Throttling Simulator: Simulate
Slow 3G,Fast 3G, orOfflineconnection modes directly on mobile devices with synthetic latency injection. - β‘ Cable-Free Mobile Inspection: Debug directly on physical iOS / Android devices, mobile webviews, or mobile Safari/Chrome.
- π‘οΈ Shadow DOM Style Isolation: Rendered inside a Shadow DOM container (
<mobile-devtools-root>), guaranteeing zero CSS leaks into your app's global styles and zero style pollution from Tailwind, Bootstrap, or global CSS resets. - π Console Tab: Real-time capture of
console.log,info,warn,error, anddebugwith live filter search, JSON tree preview, and unread error badges. - π Network Tab: Live interception of
fetchandXMLHttpRequestcalls with HTTP status indicators (200 OK,500 Error), latency timing, request/response headers, and JSON body previews. - πΎ Storage Tab: Real-time inspector and editor for
localStorage,sessionStorage, anddocument.cookie. - π» System Info Tab: Real-time diagnostic monitor for viewport dimensions, device pixel ratio (DPR), user agent string, memory limit, and screen orientation.
- π Pluggable Custom Tabs (
customTabs): Easily extend DevTools by adding custom tabs with your own DOM rendering callbacks (render(container)). - π¨ Granular UI Style Overrides (
styles): Fine-grained inline CSS style overrides for badge, drawer, overlay, and handle (styles={{ badge: {}, drawer: {}, overlay: {} }}). - π¨ Dynamic Theme Engine: Built-in Light Mode and Dark Mode with auto-contrast luminance detection, accent color swatches, and custom background palettes.
- π§ͺ Comprehensive Test Suite: Tested with 65 Unit Tests (100% Passed) + 21 Playwright E2E Tests (100% Passed) across Desktop Chrome, Mobile Chrome, and Mobile Safari.
- π§© Framework Agnostic: Native support for React 18/19, Vue 3, Svelte 4/5, and Vanilla JS.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β mobile-devtools β
ββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββ¬βββββββββββββ΄ββββββββββββ¬ββββββββββββββββββββ
βΌ βΌ βΌ βΌ
Vanilla JS React Vue 3 Svelte
(mobile-devtools) (mobile-devtools/react) (mobile-devtools/vue) (mobile-devtools/svelte)
β β β β
βββββββββββββββββββββ΄βββββββββββββ¬ββββββββββββ΄ββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β Native Shadow DOM Host β
β <mobile-devtools-root> β
βββββββββββββββ¬ββββββββββββββ
β
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββ
β β
βββββββββββββΌββββββββββββββββββ βββββββββββββββββββββββββββΌβββββββββββββββ
β Core Interceptors β β UI Engine β
βββββββββββββββββββββββββββββββ€ ββββββββββββββββββββββββββββββββββββββββββ€
β β’ Console Interceptor β β β’ Floating Badge View (floating-badge) β
β β’ Fetch / XHR Interceptor β β β’ Drawer Views & Tabs (drawer) β
β β’ DOM Elements Inspector β β β’ Pluggable Custom Tabs (customTabs) β
β β’ Storage Inspector β β β’ Auto Contrast Theme Helper β
β β’ DevTools Store & State β β β’ Bug Exporter Engine β
βββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββ
npm install mobile-devtools
# or
pnpm add mobile-devtoolsImport from mobile-devtools/react:
import React from 'react';
import { MobileDevTools } from 'mobile-devtools/react';
export default function App() {
return (
<>
<YourAppRoutes />
{/* Mobile DevTools Overlay */}
<MobileDevTools
title="My App Debugger"
position="bottom-right"
enabledTabs={['console', 'elements', 'network', 'storage', 'system']}
theme={{ mode: 'dark', accentColor: '#0070f3' }}
styles={{
badge: { opacity: '0.9' },
}}
customTabs={[
{
id: 'analytics',
title: 'Analytics',
render: (container) => {
container.innerHTML =
'<div style="padding:16px;color:#fff;">π Custom Event Log</div>';
},
},
]}
/>
</>
);
}Import from mobile-devtools/vue:
<script setup>
import { MobileDevTools } from 'mobile-devtools/vue';
const customTabs = [
{
id: 'analytics',
title: 'Analytics',
render: (container) => {
container.innerHTML = '<div style="padding:16px;color:#fff;">π Custom Event Log</div>';
},
},
];
</script>
<template>
<YourAppLayout />
<MobileDevTools
title="My App Debugger"
position="bottom-right"
:enabled-tabs="['console', 'elements', 'network', 'storage', 'system']"
:theme="{ mode: 'dark', accentColor: '#0070f3' }"
:custom-tabs="customTabs"
/>
</template>Import from mobile-devtools/svelte:
<script>
import { mobileDevTools } from 'mobile-devtools/svelte';
</script>
<div use:mobileDevTools={{
title: 'My App Debugger',
position: 'bottom-right',
shakeToToggle: true,
theme: { mode: 'dark' }
}}>
<YourAppLayout />
</div>Import from mobile-devtools/svelte:
<script>
import { useMobileDevTools } from 'mobile-devtools/svelte';
</script>
<div use:useMobileDevTools={{
title: 'My App Debugger',
position: 'bottom-right',
theme: { mode: 'dark', accentColor: '#0070f3' }
}}>
<YourAppLayout />
</div>Import directly from mobile-devtools:
import { createMobileDevTools } from 'mobile-devtools';
// Instantiate DevTools overlay
const devtools = createMobileDevTools({
title: 'My App Debugger',
position: 'bottom-right',
enabledTabs: ['console', 'elements', 'network', 'storage', 'system'],
theme: {
mode: 'dark',
accentColor: '#0070f3',
},
styles: {
badge: { opacity: '0.9' },
drawer: { maxHeight: '85vh' },
},
customTabs: [
{
id: 'analytics',
title: 'Analytics',
render: (container) => {
container.innerHTML = '<div style="padding:16px;color:#fff;">π Custom Event Log</div>';
},
},
],
});Below is the complete reference table for all configuration options supported by <MobileDevTools /> / createMobileDevTools():
| Option / Prop | Type | Default | Description |
|---|---|---|---|
enabled |
boolean |
true (in dev) |
Enable or disable the DevTools overlay. Automatically set to false in production builds. |
forceEnable |
boolean |
false |
Force enable DevTools overlay in production builds for QA testing & staging previews. |
title |
string |
'DevTools' |
Label shown on floating badge and drawer header |
icon |
string |
undefined |
Custom icon (Emoji string like 'β‘', Image URL, or Base64 data URI) |
position |
BadgePositionPreset |
'bottom-right' |
Initial corner/edge preset ('bottom-right', 'bottom-left', 'top-right', 'top-left', 'bottom', 'top', 'left', 'right') |
initialTab |
DevToolsTabId |
'console' |
Default tab opened when drawer is triggered ('console', 'elements', 'network', 'storage', 'system') |
enabledTabs |
DevToolsTabId[] |
['console', 'elements', 'network', 'storage', 'system'] |
Filter which tabs are enabled in drawer |
customTabs |
CustomTabDefinition[] |
[] |
Pluggable consumer tabs with custom DOM rendering callback (render(container)) |
styles |
DevToolsStyles |
undefined |
Fine-grained custom style overrides object ({ badge?: {}, drawer?: {}, overlay?: {}, handle?: {} }) |
defaultOpen |
boolean |
false |
Set to true to open drawer automatically on mount |
autoSnapBadge |
boolean |
false |
Enable magnetic snapping of badge to nearest screen edge on drag release |
theme.mode |
'dark' | 'light' |
'dark' |
Theme mode |
theme.accentColor |
string |
undefined |
Custom primary accent color (Hex / RGB / HSL) |
theme.backgroundColor |
string |
undefined |
Custom background color for drawer and badge |
theme.cardBackgroundColor |
string |
undefined |
Custom background color for inner card elements |
privacy.mask |
string[] |
undefined |
Sensitive header & body keys to mask in network inspector (e.g. ['token', 'password']) |
interceptors.maxLogLimit |
number |
200 |
Maximum number of console logs stored in buffer |
mobile-devtools features a built-in theme engine that automatically calculates background brightness to maintain WCAG AAA readable text contrast:
<MobileDevTools
title="Staging Debugger"
icon="π"
position="bottom-left"
theme={{
mode: 'dark',
accentColor: '#10b981',
backgroundColor: '#0c0c0e',
}}
styles={{
badge: { borderRadius: '12px' },
drawer: { borderTopLeftRadius: '20px', borderTopRightRadius: '20px' },
}}
/>mobile-devtools/
βββ apps/
β βββ web/ # React documentation & live playground app (Port 3000)
βββ examples/
β βββ react/ # React 19 test harness app (Port 3001)
β βββ vue/ # Vue 3 test harness app (Port 3002)
β βββ vanilla/ # Vanilla JS test harness app (Port 3003)
βββ packages/
βββ mobile-devtools/ # Main unified published npm package (Core + UI + React/Vue/Vanilla Adapters)
βββ config/
βββ eslint/ # Shared ESLint configuration (@mobile-devtools/eslint-config)
βββ typescript/ # Shared TypeScript configuration (@mobile-devtools/tsconfig)
To build and run the project locally:
# Clone repository
git clone https://github.com/dewasemadi/mobile-devtools.git
cd mobile-devtools
# Install dependencies using pnpm
pnpm install
# Launch all apps & package watchers in dev mode
pnpm dev
# Run unit test suite (65 tests)
pnpm test
# Run unit tests with V8 coverage report
pnpm test:coverage
# Run Playwright E2E tests (21 tests across Chromium & Mobile Webkit)
pnpm test:e2e
# Build production bundles
pnpm buildDistributed under the MIT License. See LICENSE for details.




