Lightweight, multi-tab Electron browser built with Tailwind CSS, featuring local session persistence and enhanced webview security.
Clone the repository:
git clone https://github.com/Endrulis/custom-electron-browser.git
cd custom-electron-browser
Install dependencies:
npm install
Start the application:
npm start
Ctrl+Shift+H
.custom-browser/
āāā index.js # Main process configuration
āāā index.html # Browser window UI
āāā preload.js # IPC communication bridge
āāā styles/
ā āāā tailwind.min.css # Tailwind CSS styles
āāā browser-data/ # Persistent user data
// In index.js, when creating the BrowserWindow:
webPreferences: {
contextIsolation: true,
sandbox: true,
preload: path.join(__dirname, "preload.js")
}
// In main process, set the CSP headers:
"Content-Security-Policy": [
"default-src 'self' 'unsafe-inline' data: blob: filesystem: http: https: ws: wss;"
]
// Harden webviews in main process:
mainWindow.webContents.on("will-attach-webview", (event, webPreferences) => {
webPreferences.nodeIntegration = false;
webPreferences.contextIsolation = true;
});
Live reload is enabled via electron-reload
.
browser-data/
node_modules/
require("electron-reload")(__dirname, {
electron: require(`${__dirname}/node_modules/electron`),
ignored: /browser-data|node_modules|[/\\]./
});