
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
electron-as-browser
Advanced tools
A node module to help build browser like windows in electron.

npm i electron-as-browser
const BrowserLikeWindow = require('electron-as-browser');
let browser;
browser = new BrowserLikeWindow({
controlPanel: 'renderer/you-control-interface.html',
startPage: 'https://page-to-load-once-open',
blankTitle: 'New tab',
debug: true // will open controlPanel's devtools
});
// Trigger on new tab created
browser.on('new-tab', ({ webContents }) => {
// Customize webContents if your like
});
browser.on('closed', () => {
// Make it garbage collected
browser = null;
});
To make the control interface works, there are two steps:
For react users, there is a custom hook useConnect to help you setup ipc channels.
const useConnect = require('electron-as-browser/useConnect');
const ControlPanel = () => {
const { tabs, tabIDs, activeID } = useConnect();
return (
<div>Use tabs informations to render your control panel</div>
);
}
For non-react users, you have to setup ipc channels yourself, there are three steps:
ipcRenderer.send('control-ready') on dom readyipcRenderer.on('tabs-update', (e, tabs) => { // tabs updated })ipcRenderer.on('active-update', (e, activeID) => { // Active tab's id updated })Don't forget to removeListener on ipcRenderer once control panel unmounted.
Once setup ipc channels, you'll get all your control panel needed informations:
tabs an object contains all the opened tab's informationstabIDs array of opened tab's idsactiveID current active tab's idConstruct and style your control interface as your like.
Then you can send actions to control the browser view, the actions can require from electron-as-browser/control:
import {
sendEnterURL, // sendEnterURL(url) to load url
sendChangeURL, // sendChangeURL(url) on addressbar input change
sendGoBack,
sendGoForward,
sendReload,
sendStop,
sendNewTab, // sendNewTab([url])
sendSwitchTab, // sendSwitchTab(toID)
sendCloseTab // sendCloseTab(id)
} from 'electron-as-browser/control';
See example for a full control interface implementation.
FAQs
Make electron like browser easier and flexible.
The npm package electron-as-browser receives a total of 17 weekly downloads. As such, electron-as-browser popularity was classified as not popular.
We found that electron-as-browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.