first commit

This commit is contained in:
2025-10-27 16:02:30 +07:00
commit 8a44b67d0c
7 changed files with 481 additions and 0 deletions

38
README.md Normal file
View File

@@ -0,0 +1,38 @@
# Browser Tab Debugger
Execute JavaScript files on Chrome tabs via remote debugging.
## Setup
1. Install dependencies:
```bash
npm install
```
2. Start Chrome with remote debugging enabled:
```bash
chrome.exe --remote-debugging-port=9222
```
Or on Windows, run from PowerShell:
```powershell
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
```
## Usage
### Option 1: VS Code Debug Configuration
1. Open the JavaScript file you want to execute (e.g., `example.js`)
2. Press F5 or go to Run and Debug
3. Select "Execute Script on Current Tab"
4. The script will run on the currently active Chrome tab
### Option 2: Command Line
```bash
node run-script.js example.js
```
## How it works
The script connects to Chrome's DevTools Protocol on port 9222, finds the first active page tab, and executes your JavaScript code using `Runtime.evaluate`.