A desktop application that allows you to browse two websites side-by-side with JavaScript injection capabilities. Built with Electron, this app can load ANY website including those that block iframes (like ChatGPT, Claude, Google, etc.).
- Split View: Browse two websites simultaneously with adjustable split (10%-90%)
- Full Browser Capabilities: Load any website without iframe restrictions
- JavaScript Injection: Inject custom HTML into elements with id="toInjectJS"
- Navigation Controls: Back, forward, reload buttons for each webview
- DevTools: Built-in developer tools for each webview
- Session Persistence: Maintains login sessions separately for each side
- Keyboard Shortcuts: Quick navigation with keyboard commands
-
Install Node.js (if not already installed)
- Download from: https://nodejs.org/
- Recommended: LTS version
-
Navigate to the project directory
cd electron-split-browser -
Install dependencies
npm install
npm startOr for development with logging:
npm run dev-
Load Websites:
- Enter URLs in the input fields
- Press "Load Left" or "Load Right" buttons
- Or press Enter after typing a URL
-
Navigate:
- Use ◄ ► buttons to go back/forward
- Use ⟳ button to reload
- Click links normally within the webviews
-
Resize Views:
- Click and drag the middle divider
- Adjust split from 10% to 90%
-
Inject JavaScript:
- Type HTML code in the textarea
- Click "Inject to Left", "Inject to Right", or "Inject to Both"
- The code will be inserted into any element with id="toInjectJS"
-
Developer Tools:
- Click "DevTools Left" or "DevTools Right"
- Inspect and debug the loaded websites
Ctrl/Cmd + R- Reload left webviewCtrl/Cmd + Shift + R- Reload right webviewCtrl/Cmd + ←- Go back on left webviewCtrl/Cmd + →- Go forward on left webview
To inject custom HTML into a website:
- The target website must have an element with
id="toInjectJS" - Enter your HTML in the injection textarea
- Click the appropriate inject button
Example target element in your website:
<div id="toInjectJS">
<!-- Your injected content will appear here -->
</div>Example injection:
<p style='color: red; font-weight: bold;'>Hello from Electron!</p>- Each webview has its own session partition (persist:left and persist:right)
- Cookies and local storage are isolated between the two webviews
- JavaScript injection only works on pages where you have the target element
- The app uses Chrome's security features for safe browsing
Websites like ChatGPT, Claude, Google, etc. block iframes using:
X-Frame-OptionsheadersContent-Security-Policyheaders
Electron's webview is NOT an iframe - it's a full Chromium browser instance running in a separate process. This means:
- No iframe restrictions apply
- Full JavaScript execution
- Complete DOM access
- Separate security context
npm install- Check your internet connection
- Some sites may require login
- Try opening DevTools to see console errors
- Verify the target element exists:
<div id="toInjectJS"></div> - Check DevTools console for errors
- Some websites may have Content Security Policies that block injection
To package the app for distribution:
npm install electron-builder --save-devAdd to package.json:
"scripts": {
"build": "electron-builder"
}Then run:
npm run build- Framework: Electron 28.x
- Renderer: Chromium-based webview
- Node Integration: Enabled for main renderer
- Context Isolation: Disabled for webview access
- Session Partitions: Separate for each webview
MIT
For issues or questions, please check:
- Electron documentation: https://www.electronjs.org/docs
- Webview API: https://www.electronjs.org/docs/latest/api/webview-tag