A powerful Vue 3 network request override tool that replaces manual DevTools "Override content" functionality with a user-friendly widget that can be embedded on any website.
- π Network Interception: Automatically captures and overrides fetch() and XMLHttpRequest calls
- π‘ Real-time Monitoring: Live network request monitoring with activity indicators
- π― JSON Override Editor: Built-in JSON editor with validation and syntax highlighting
- πΎ File Downloads: Organized file downloads with structured naming
- π Auto-refresh: Automatic profile reloading after override changes
- π½ Persistent Storage: localStorage-based override persistence across sessions
- π Floating Icon: Unobtrusive floating widget with activity pulse animation
- π Activity Indicators: Green pulse for network activity, red badge for active overrides
- π Hover Tooltips: "Network Override Tool" tooltip on hover
- π± Fullscreen Modal: Expandable modal with backdrop blur and scrollable content
- β‘ Easy Embedding: Simple
<NetworkOverrideWidget />
component integration
- π Visual Status: Clear "LIVE API DATA" vs "OVERRIDDEN DATA" indicators
- π Instant Updates: Save override β automatically see changes applied
- ποΈ Smart Cleanup: Remove override β automatically restore original data
- π Organized Downloads: Files saved with domain/path structure for easy management
npm install
npm run dev
The widget will be available at: http://localhost:5173/widget
(port may vary)
- Node.js 16.x or higher
- npm 7.x or higher
Create a .env
file in the root directory with the following variables (if needed):
VITE_API_BASE_URL=your_api_base_url
# Run unit tests
npm run test
# Run tests with coverage
npm run test:coverage
npm run build
Add the widget to any website:
<template>
<div>
<!-- Your existing website content -->
<h1>My Website</h1>
<!-- Add the network override widget -->
<NetworkOverrideWidget />
</div>
</template>
<script setup>
import NetworkOverrideWidget from './components/NetworkOverrideWidget.vue'
</script>
Visit /widget
route for a complete demo with:
- User profile display (left panel)
- Override tools (right panel)
- Real API integration with jsonplaceholder.typicode.com
- Click "π€ Load User Profile" to make a real API call
- See live data displayed in the left panel
- Watch network requests appear in the monitor
- Click "β‘ Override" on any captured request
- Edit the JSON response in the built-in editor
- Use "Use Example Override" for quick testing
- Save your changes
- Auto-reload: Profile automatically refreshes with your override data
- Visual feedback: Status changes from "π‘ LIVE API DATA" to "π OVERRIDDEN DATA"
- File download: Organized backup file is automatically downloaded
- View active: See all saved overrides with timestamps
- Remove single: Click "ποΈ Remove Override" β auto-restore original data
- Clear all: Click "ποΈ Clear All Overrides" β auto-refresh original data
src/
βββ components/
β βββ NetworkOverrideWidget.vue # Main floating widget
β βββ NetworkOverrideTool.vue # Core override tool implementation
β βββ SimpleNetworkOverride.vue # Core override functionality
βββ views/
β βββ WidgetView.vue # Main widget demo page (root route)
β βββ EmbeddedView.vue # Embedded widget view
β βββ AboutView.vue # About page
βββ router/
β βββ index.js # Routes (/widget as root)
βββ styles/ # Global styles and theme configuration
βββ assets/ # Static assets
βββ main.js # Application entry point
- Global scope: Intercepts all page network requests
- Fetch API: Overrides
window.fetch
for modern requests - XMLHttpRequest: Overrides
XMLHttpRequest
for legacy requests - JSON filtering: Only captures JSON responses for override
- Memory: Active overrides stored in Map for instant access
- localStorage: Persistent storage across browser sessions
- File backup: Downloaded files serve as external backup/sharing
- High z-index: Ensures widget appears above all page content
- Teleport rendering: Uses Vue Teleport for proper DOM placement
- Event system: Parent-child communication via emit/props
- State management: Centralized state with reactive updates
- Modern UI: Clean, professional interface with gradients and shadows
- Responsive: Works on desktop and mobile devices
- Custom scrollbars: Styled webkit scrollbars for better UX
- Activity animations: Smooth pulse animations for visual feedback
- Green badge: "π‘ LIVE API DATA" for original responses
- Purple badge: "π OVERRIDDEN DATA" for custom responses (with pulse)
- Activity pulse: Green animation when network requests detected
- Override count: Red badge showing number of active overrides
- Start: Load widget at
http://localhost:5174/widget
- Load: Click "π€ Load User Profile" β see real API data
- Override: Click "β‘ Override" β edit JSON
- Save: Click "πΎ Save Override" β watch profile automatically update
- Download: Override file automatically downloaded with organized naming
- Remove: Click "ποΈ Remove Override" β watch original data automatically restore
- Save override: Automatically reloads profile to show override in action
- Remove override: Automatically fetches fresh original data
- Clear all: Smart refresh of displayed data when applicable
- Structured naming:
domain.com/path/segments/override_timestamp.json
- Simple downloads: Browser-native download (no ZIP complexity)
- Preview display: Shows exact filename before saving
- Network failures: Graceful fallbacks with helpful messages
- API errors: Smart error handling with user guidance
- State consistency: Maintains UI state even during failures
MIT License - feel free to use this tool in your projects!
Contributions welcome! This tool demonstrates advanced Vue 3 patterns:
- Composition API with reactive state management
- Network interception and override techniques
- Widget/modal architecture with Teleport
- Real-time UI updates and activity monitoring