A lightweight in-browser Request Viewer that intercepts and displays fetch/XHR requests in real time. Includes filters, live UI, POST parsing, export to JSON, auto-copy, and a floating DevTools console panel. Just paste it into DevTools and start capturing.
πΊπΈ English | πͺπΈ EspaΓ±ol
You can either copy ReCapture.js and paste it in DevTools (F12 > Console > Ctrl + v) OR create a persistent script that you can enable/disable whenever you like WHITHOUT you having to keep coming to this horrible repo and copying the script. For that last option, you can use TAMPERMONKEY:
- Copy the script from above
- Open Tampermonkey in your browser
- Create new script (
+button) - Paste the code
- Save (Ctrl+S)
- Enable the script
- Reload any page (F5)
- Done! UI appears automatically
1. Install Tampermonkey Extension:
- Chrome: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
- Firefox: https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/
2. Create New Script:
- Click Tampermonkey icon
- Select "Create a new script"
- Delete all existing code
3. Paste This Script:
// ==UserScript==
// @name ReCapture
// @namespace http://tampermonkey.net/
// @version 1.2
// @description Capture and analyze HTTP requests in real-time
// @author URDev
// @match *://*/*
// @grant none
// @run-at document-end
// ==/UserScript==
// PASTE THE ENTIRE SCRIPT FROM ABOVE HERE
// (Start from (function() { to })();)- Save & Enable:
- Press
Ctrl+Sto save - Ensure script is enabled (toggle switch ON)
- Reload any webpage
Once installed:
- Visit any website
- UI panel appears (top-right corner)
(you can minimize the ui if you need to)
You'll be able to see in the minimized window whenever new requests appear.
- Interact with the page - requests are captured automatically
- Use buttons in the panel to:
- Show all captures
- Show only POST requests
- Export to JSON
- Copy to clipboard
- Filter results
Console Commands:
captureCommands.showAll() - Show all captures
captureCommands.showPost() - Show only POST requests
captureCommands.clear() - Clear all captures
captureCommands.export() - Export to JSON file
captureCommands.copy() - Copy to clipboard
captureCommands.toggle() - Toggle capture on/off
captureCommands.find("text") - Search captures
captureCommands.getLast(5) - Get last 5 captures
captureCommands.getPostCaptures() - Get all POST
Edit these variables in the script:
const CONFIG = {
captureAll: true, // Capture all requests
showInRealTime: true, // Real-time logging
maxCaptures: 100, // Storage limit
filterMethods: ['POST'], // Methods to capture
filterUrls: [], // URLs to filter (empty = all)
excludeUrls: [], // URLs to exclude
includeHeaders: true, // Include request headers
includeBody: true, // Include request body
includeResponse: false, // Include response (can be large)
autoCopy: false, // Auto-copy POST data
saveToFile: false // Auto-save to file
};Issue: UI not appearing
- Ensure Tampermonkey is enabled
- Check script is enabled in Tampermonkey dashboard
- Try reloading page (F5)
- Check browser console for errors (F12 β Console)
Issue: Not capturing requests
- Check CONFIG.filterMethods - set to
['GET', 'POST', 'PUT', 'DELETE']for all - Some sites use WebSockets (not captured by this tool)
- Ensure page is fully loaded before interacting
Issue: Script conflicts
- Disable other userscripts temporarily
- Check for adblockers that might interfere
- Try running in browser incognito mode
Issue: Memory/performance
- Reduce CONFIG.maxCaptures to 50 or lower
- Set CONFIG.includeResponse to false
- Click "Clear" button regularly to free memory
To save captures:
- Click "Export JSON" button in UI panel
- File downloads automatically as
request-captures-[timestamp].json - Open with any text editor, JSON viewer, or import into analysis tools
To copy specific request:
- Use console command:
captureCommands.getLast(1) - Copy from console output
- Or use
captureCommands.find("search-term")to find specific requests - Click "Copy All" in UI to copy all captures to clipboard
JSON structure:
{
"metadata": {
"exportedAt": "2024-12-04T14:30:00.000Z",
"url": "https://example.com",
"totalCaptures": 42,
"config": { ... }
},
"captures": [
{
"id": "timestamp-random",
"timestamp": "2024-12-04T14:29:55.123Z",
"type": "fetch",
"method": "POST",
"url": "https://api.example.com/login",
"headers": { ... },
"body": "username=test&password=123",
"response": { ... }
}
]
}To update:
- Open Tampermonkey dashboard
- Find "ReCapture"
- Click edit (pencil icon)
- Replace with new code
- Save (Ctrl+S)
- Reload pages where script runs
To disable temporarily:
- Click Tampermonkey icon in toolbar
- Toggle "ReCapture" switch OFF
- Toggle back ON when needed (VERY useful to just have it "stored" in TamperMonkey's scripts)
- Keyboard Shortcuts: None by default, but you can add them
- Mobile: Works on mobile browsers with Tampermonkey (not tested though)
- Multiple Tabs: Each tab has independent capture
- Privacy: Data stays in your browser, not sent anywhere
- Filter specific domains: Set
filterUrls: ["api.example.com"]in CONFIG - Exclude analytics: Set
excludeUrls: ["google-analytics.com", "facebook.com"]
- Cannot capture WebSocket traffic
- May not work on some heavily secured sites
- Requires page reload to start capturing
- Large responses can affect performance
- Some headers may be sanitized by browser
Quick fixes:
- Clear browser cache if UI glitches
- Disable/re-enable script in Tampermonkey
- Check for script updates
- Restart browser if issues persist
- OR just press F5 and ReRun (98% success rate)
For issues:
- Check browser console (F12)
- Capture error message
- Note website URL where issue occurs
- Check Tampermonkey error logs
Debug mode: Enable detailed logging by adding to CONFIG:
debugMode: true, // Add this for verbose loggingMade with <3 by URDev, for YOU!