Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Electron.js Desktop App Development

Lesson 25 of 28 · javascript

Creating BrowserWindows – Options & Features

Duration: 9 mins

Creating BrowserWindows – Options & Features

BrowserWindow accepts an options object that controls size, frame, transparency, security, etc.

const win = new BrowserWindow({
  width: 1024,
  height: 768,
  title: "My Electron App",
  show: false,               // create hidden, show later for smooth startup
  webPreferences: {
    preload: path.join(__dirname, '../preload/bridge.js'),
    contextIsolation: true,   // must be true for security
    nodeIntegration: false,
    enableRemoteModule: false
  }
});

Common useful flags:

  • transparent: true – frameless windows.
  • alwaysOnTop: true – stay above other apps.
  • resizable: false – fixed‑size UI.

Show the window after it’s ready:

win.once('ready‑to‑show', () => win.show());
Previous: Project Structure & npm ScriptsNext: Loading Local HTML, Remote URLs & Custom Protocols