Electron and MōBrowser are frameworks for building desktop applications with web technologies. In both, you write the user interface in HTML, CSS, and JavaScript, and the rest of the application runs in Node.js.

This guide shows how to move an Electron application to MōBrowser. First, you prepare the application while it still runs on Electron. Then you create a new MōBrowser project next to it and move the application into that project piece by piece. The Electron version stays ready to ship the whole time.

Prerequisites 

  • Node.js 24.14.1 (LTS) or later, and a machine that meets the MōBrowser prerequisites.
  • MōBrowser 2.20.0 or later. The examples target this version.

The examples use TypeScript and assume that the application keeps its main-process code in src/main/ and its frontend in src/renderer/. Your code doesn’t have to be in TypeScript, and Step 3 shows how to set up the new project for JavaScript. Adjust the paths to match your project.

What you need to change 

Both frameworks run an application the same way. A Node.js main process manages the application, and Chromium renderer processes show its pages. Because of that, much of your code moves to MōBrowser unchanged. The changes concentrate in four areas where the frameworks differ.

Build system 

An Electron application assembles its own toolchain. It typically uses a bundler such as webpack or Vite, electron-builder or Electron Forge for packaging, scripts for notarization, and a package for updates.

A MōBrowser project comes with the toolchain included. It builds with Vite, and the MōBrowser CLI builds, signs, and packages the application. The application name, bundle ID, signing, and installer settings are in one file, mobrowser.conf.json, and updates are part of the framework API. You replace your build tools rather than port them.

Project structure 

Electron doesn’t prescribe where your files go. A MōBrowser project starts with a standard layout: main-process code in src/main/, frontend code in src/renderer/, and end-to-end tests in test/e2e/. Your code moves into these folders.

IPC 

In Electron, the webPreferences window option decides how much of Node.js the renderer gets, and a preload script decides what the page can call. The preload script exposes functions to the page and passes messages to the main process over string channels.

A MōBrowser renderer has no access to Node.js and no preload script. You describe the calls between processes in Protocol Buffers (Protobuf) files. A code generator creates a client for the renderer and types for the main process, so the compiler checks both sides. What’s wrong with Electron IPC explains why this matters.

The path of a renderer call in Electron, through a preload script and ipcMain, compared with the path in MōBrowser, through a generated client, an origin check, and a Protobuf service

A renderer call in Electron and in MōBrowser.

IPC changes the most code. Renderer code that uses Node.js moves to the main process, and every preload method becomes a method of a Protobuf service.

Framework API 

The main-process API covers most of the same ground as Electron’s, with different names and shapes. For example, win.webContents becomes win.browser, dialogs are methods of app, and many events become handlers that return a decision.

Security works differently too. In Electron, it’s up to your code to check the sender of each message and keep the window on your own content. MōBrowser accepts calls only from your bundled frontend and the origins that you list in app.trustedOrigins, and it cancels top-level navigation to other sites by default. You keep the rules that go beyond these defaults and express them as MōBrowser handlers. Electron Security Model vs MōBrowser compares the two models.

Migration plan 

The four areas touch almost every part of the application. If you migrate in one step, you can’t release the application until everything works again. When something breaks, it’s also hard to find the change that caused it. Instead, this guide splits the work into small steps that you can test one at a time. The work happens in two places.

First, you adjust the architecture in the Electron app. MōBrowser doesn’t support a renderer that uses Node.js, and Electron does. That makes Electron the easier place to separate the renderer from Node.js: the application keeps running, your tests still apply, and you can release after each change.

Then you create a new MōBrowser project next to the Electron app and move the application into it. The generated project already has the folder layout, the build configuration, an end-to-end test setup, and GitHub Actions workflows, so you don’t rebuild them by hand. The Electron app stays untouched until the new project is ready to ship.

Here are the six steps:

  1. Prepare the renderer. In the Electron app, make the renderer independent of Node.js and put every call to the main process behind a typed API.
  2. Create the project. Generate a MōBrowser project next to the Electron app.
  3. Move the shell. Copy your code into the new project and port the application lifecycle, windows, menus, and dialogs.
  4. Add services. Replace the preload methods with Protobuf services.
  5. Tune security. Adjust the default MōBrowser security checks and express your own rules as MōBrowser handlers.
  6. Ship it. Set up signing, packaging, automatic updates, and end-to-end tests.

Six migration steps on a timeline. Step 1 happens in the Electron app, and Steps 2 to 6 fill a new MōBrowser project

Only Step 1 changes the Electron app.

Some Electron features have no equivalent in MōBrowser, and each one needs a workaround or a decision. Find them before you start. This guide comes with a migration skill, a folder of instructions and scripts that a coding agent can read. One of its scripts lists the Electron APIs, events, and options your code uses, so you can check each one against the MōBrowser docs.

Step 1: Prepare the renderer 

You do this step in the Electron app. By the end of it, the renderer uses only browser APIs and reaches the main process only through typed API objects. Such a renderer would run in a plain browser tab if you replaced those objects with stubs that return test data. MōBrowser runs this kind of renderer.

Turn on the boundary 

Electron can enforce the same renderer boundary as MōBrowser with three webPreferences settings. When you turn them on, the application behaves like a MōBrowser one, and whatever breaks shows the code that has to change. Check every BrowserWindow for these settings:

import { BrowserWindow } from 'electron'
import path from 'node:path'

new BrowserWindow({
  width: 1024,
  height: 768,
  webPreferences: {
    contextIsolation: true,
    nodeIntegration: false,
    sandbox: true,
    preload: path.join(__dirname, 'preload.js'),
  },
})

All three are needed. Without the sandbox, the preload script can still use Node.js, and without context isolation, the page can reach everything that the preload script sets up. If every window had all three settings from the start, skip to Make IPC asynchronous.

Otherwise, turn the settings on, launch the application, run your tests, and fix what breaks. A sandboxed preload script can’t use modules such as fs, so move that code to the main process.

Tests and manual runs find only the code they reach. For example, a require('fs') behind a rarely used menu item fails only when someone clicks it. To find every Node.js import, build the renderer for a browser instead of Electron. The build then reports the imports that it can’t resolve. In webpack, change the target and check externals:

// webpack.renderer.config.js
module.exports = {
  target: 'web', // Was 'electron-renderer'.
  // Delete Node.js modules from externals, or the build skips them:
  // externals: { fs: 'commonjs fs' },
}

In Electron Forge, the webpack plugin chooses the target from its nodeIntegration option, so set it to false instead. An entry point can override the value, so check those too:

// forge.config.js, in the plugins array
new WebpackPlugin({
  mainConfig: './webpack.main.config.js',
  renderer: {
    config: './webpack.renderer.config.js',
    nodeIntegration: false, // Was true.
    entryPoints: [
      {
        name: 'main_window',
        html: './src/index.html',
        js: './src/renderer.ts',
        // Delete nodeIntegration: true here too.
      },
    ],
  },
})

Vite already builds the renderer for a browser, so Node.js imports resolve only through a plugin. Remove the plugin, which is usually vite-plugin-electron-renderer, and delete the Node.js modules listed in build.rollupOptions.external:

// vite.config.ts
import { defineConfig } from 'vite'
// Delete this import and the plugin call below.
import renderer from 'vite-plugin-electron-renderer'

export default defineConfig({
  plugins: [renderer()],
})

The build doesn’t catch everything. An import of a browser package named like a built-in module, such as events, builds without a message, and so does code that uses process.env or __dirname. The migration skill includes a script that checks the renderer for these too. Unzip the skill into your Electron app’s folder, for example into .agents/skills/, and run it from that folder:

node .agents/skills/electron-to-mobrowser/scripts/measure-boundary.mjs renderer
src/renderer/history.ts:1: Node.js built-in module: from 'events'
src/renderer/config.ts:8: Node.js global: process.env

Run the script after each fix until it prints nothing. It exits with a non-zero code when it finds something, so you can also run it in CI to keep Node.js out of the renderer.

Make IPC asynchronous 

MōBrowser has no synchronous IPC, so calls through ipcRenderer.sendSync() and @electron/remote have to become asynchronous. A sandboxed preload script can still call ipcRenderer.sendSync(), so look for these calls even if your windows already had all three settings.

The main-process code behind these calls stays as it is. Only the way the renderer reaches it changes. Electron already has the asynchronous version, so you can convert and test each call now:

// Before: the renderer waits until the main process answers.
// Renderer process, in the preload script:
const settings = ipcRenderer.sendSync('settings:load')
// Main process:
ipcMain.on('settings:load', (event) => {
  event.returnValue = readSettings()
})

// After: the same logic, behind an asynchronous call.
// Renderer process, in the preload script:
const settings = await ipcRenderer.invoke('settings:load')
// Main process:
ipcMain.handle('settings:load', () => readSettings())

Each converted call returns a promise, so its callers have to await the result. For @electron/remote, move the code that the renderer ran on remote objects into an ipcMain.handle() handler in the same way. Once no code uses @electron/remote, uninstall the package and delete its setup in the main process.

Add typed APIs 

The renderer now reaches the main process only through asynchronous IPC calls. In many Electron applications, these calls sit behind preload functions that were added one at a time, like the ones below. They take positional arguments, one of them runs logic of its own, and the page can’t remove the listener it adds:

// src/preload.ts, before
import { contextBridge, ipcRenderer } from 'electron'

contextBridge.exposeInMainWorld('api', {
  status: (path: string) => ipcRenderer.invoke('git-status', path),
  commit: async (path: string, message: string) => {
    const sha = await ipcRenderer.invoke('git-commit', path, message.trim())
    return sha.slice(0, 7)
  },
  onRepoChanged: (callback: (path: string) => void) => {
    ipcRenderer.on('repo-changed', (_e, path) => callback(path))
  },
})

Put these calls behind typed API objects, one per domain. A domain is a group of related operations, such as repository access or settings. Each domain becomes a Protobuf service in Step 4, so keep it within the limits of Protobuf. Every method is asynchronous, takes one request object, and returns one response object with plain data:

// src/shared/api.ts
export interface FileStatus { path: string; state: string }

export interface RepositoryApi {
  getStatus(req: { path: string }): Promise<{ files: FileStatus[] }>
  commit(req: { path: string; message: string }): Promise<{ sha: string }>
  onChanged(listener: (event: { path: string }) => void): () => void
}

The preload script then creates an object that implements this interface and exposes it to the page as window.repository. Each method only forwards the call to the main process, and the subscription returns a function that removes the listener:

// src/preload.ts, after
import { contextBridge, ipcRenderer } from 'electron'
import type { RepositoryApi } from './shared/api'

const repository: RepositoryApi = {
  getStatus: (req) => ipcRenderer.invoke('repository:getStatus', req),
  commit: (req) => ipcRenderer.invoke('repository:commit', req),
  onChanged: (listener) => {
    const handler = (_e: unknown, event: { path: string }) => listener(event)
    ipcRenderer.on('repository:changed', handler)
    return () => ipcRenderer.removeListener('repository:changed', handler)
  },
}

contextBridge.exposeInMainWorld('repository', repository)

Logic that the preload script ran itself, such as trimming the commit message and shortening the SHA, moves to the main process. Then the preload script has no code that Step 4 would have to port.

Split the main process the same way. For each domain, write its handlers as a plain object that implements the request methods of the domain’s interface. The object knows nothing about IPC: it takes a request and returns a response. The compiler checks it against the same types as the preload script, and any IPC system can call it. Here is the handler object of the repository domain:

// src/main/repository.ts
import type { RepositoryApi } from '../shared/api'

// `git` stands for the code that works with the repository.
export const repository: Pick<RepositoryApi, 'getStatus' | 'commit'> = {
  async getStatus({ path }) {
    return { files: await git.status(path) }
  },
  async commit({ path, message }) {
    // Moved from the preload script.
    const sha = await git.commit(path, message.trim())
    return { sha: sha.slice(0, 7) }
  },
}

Then keep every ipcMain call in one small file. It connects each channel to a handler method and does nothing else:

// src/main/ipc.ts, the only file that uses ipcMain.
import { ipcMain } from 'electron'
import { repository } from './repository'

ipcMain.handle('repository:getStatus', (_e, req) => repository.getStatus(req))
ipcMain.handle('repository:commit', (_e, req) => repository.commit(req))

In Step 4, only this file is replaced. The MōBrowser services call the same handler objects with the same requests.

Watch out for:

  • Indirect use of Node.js. The build reports an import of fs in your code, but a package such as a database driver that uses fs internally can fail only at runtime. List such packages by hand.
  • File.path. Electron 32 removed it, and in MōBrowser the main process can’t get the path of a file that the user drops on the page. Read the file in the renderer, or let the user pick it in a dialog from the main process.

You’re done with this step when:

  • Every window has the three settings, and the renderer builds for a browser.
  • The renderer check from the skill prints nothing.
  • No code calls ipcRenderer.sendSync() or uses @electron/remote.
  • The preload script only forwards calls, and one file binds the handlers to ipcMain.
  • Your tests pass, and the application is ready to ship on Electron.

Step 2: Create the project 

The rest of the work happens in a new MōBrowser project. Go to the parent folder of your Electron app, so that the two projects sit side by side, and run the scaffolding tool:

npm create mobrowser-app@latest

The tool asks for the project name, the frontend framework, the UI component library, and the language. Pick the framework and the language that your frontend already uses. If the frontend uses another framework, pick Vanilla, which gives you a plain Vite setup to add your framework to. This guide calls the project my-app-mobrowser. Then install the dependencies and start the template application:

cd my-app-mobrowser
npm install
npm run dev

A window with the template page opens. Next to your Electron app, you now have this:

my-app/                  Your Electron app, prepared in Step 1
my-app-mobrowser/        The new MōBrowser project
├── src/
│   ├── main/            Main-process code
│   └── renderer/        Frontend code
├── test/
│   └── e2e/             End-to-end tests
├── mobrowser.conf.json  Application configuration
├── package.json
└── vite.config.ts

The project also has GitHub Actions workflows and instructions for coding agents. Project Overview describes every file.

mobrowser.conf.json takes over the settings that your Electron build configuration held. Fill in the application name, version, and author, and copy the application ID, such as the appId of electron-builder, to the macOS bundleID:

{
  "app": {
    "name": "My App",
    "version": { "major": "2", "minor": "4", "patch": "0" },
    "author": "Example Inc.",
    "bundle": {
      "macOS": { "bundleID": "com.example.myapp" }
    }
  }
}

The example shows only the fields that change. Signing and installer settings come in Step 6.

You’re done with this step when:

  • npm run dev opens the template application.
  • mobrowser.conf.json has your application’s name, version, author, and bundle ID.

Step 3: Move the shell 

In this step, the template page gives way to your application. The goal is the application shell running on MōBrowser: the lifecycle, windows, menus, and dialogs. Your domains stay in the Electron app for now, and Step 4 brings them over one at a time.

Copy your code 

Replace the template code with yours. Copy the frontend from my-app/src/renderer/ into my-app-mobrowser/src/renderer/, and the main-process code into my-app-mobrowser/src/main/. Leave out the domain handlers, the file that binds them to ipcMain, and the preload script. MōBrowser builds both processes with Vite, so move any webpack settings that you still need to vite.config.ts.

If your code is in JavaScript, add "allowJs": true to tsconfig.json so that the type check accepts it. The entry point can be JavaScript too: rename src/main/index.ts to index.js and update build.lib.entry in vite.config.ts. Keep the name index, because the application loads index.js at startup.

Port the main process 

Many main-process changes are renames. Imports come from @mobrowser/api instead of electron, and the startup code gets shorter. There’s no app.whenReady(), and app.url points to the frontend in both development and production:

// src/main/index.ts
import { app, BrowserWindow } from '@mobrowser/api'

const win = new BrowserWindow({
  url: app.url,
  size: { width: 1024, height: 768 },
})
win.show()

Delete the webPreferences option, including preload. MōBrowser always isolates and sandboxes the renderer, so nothing replaces the three settings from Step 1.

MōBrowser has no ready-to-show event. Replace a win.once('ready-to-show', () => win.show()) listener with a direct win.show() call right after you create the window, as in the example above. The window then appears empty for a moment before the page paints.

Window options have new names, you build menus from classes instead of templates, and dialogs are methods of app. The skill’s references/api-mapping.md lists each Electron API with its MōBrowser counterpart.

Return decisions 

Another change is how your code makes decisions. Electron emits an event and lets the listener call preventDefault(). MōBrowser calls a handler, and the handler returns the decision.

Closing is a good example. MōBrowser has no before-quit or will-quit events. When the application quits, it asks the close handler of every window, and the handler receives isQuitting: true. This handler hides the window when the user closes it and lets it close when the application quits:

win.handle('close', async ({ isQuitting }) => {
  return isQuitting ? 'close' : 'hide'
})

Watch out for:

  • app.packaged is also true in the development build that npm run dev:build creates. To tell a development run from a release, use import.meta.env.DEV, which is true only under npm run dev, or a build flag of your own.
  • Browser packages that expect Buffer or process build without errors and can then leave the window blank. If your Electron project used node-polyfill-webpack-plugin, add these globals yourself.
  • Handlers belong to one window. A policy that you set once for the session or in web-contents-created becomes a function that you call for every window you create.
  • Anything that talks to the renderer stays broken until its domain moves: calls that the frontend makes while it starts, menu items that send commands to the page, and a close handler that asks the page to save first. A frontend that calls its API at startup can render only partially.
  • Native add-ons compiled for Electron don’t load. Install the packages again in the new project. Prefer packages built on Node-API, which doesn’t depend on the V8 version of the runtime.

You’re done with this step when:

  • npm run dev opens the window with your frontend loaded.
  • Menu items with standard roles work, and the application quits.
  • No file in src/main/ imports electron.

At this point, calls through the typed API fail, because nothing in the new project answers them yet.

Step 4: Add services 

Now your domains move into the new project one at a time. Each domain arrives with its main-process handlers from Step 1 and a Protobuf service that replaces its preload methods. Start with the domain that the frontend needs at startup, so that it renders fully as early as possible.

Define the service 

Describe the domain’s interface from Step 1 in a .proto file. Events that the main process sent with webContents.send() become methods with a stream response:

// src/renderer/proto/repo.proto
syntax = "proto3";

import "google/protobuf/empty.proto";

// The request and response messages are omitted.

service RepoService {
  rpc GetStatus(StatusRequest) returns (StatusResponse);
  rpc Commit(CommitRequest) returns (CommitResponse);
  rpc OnChanged(google.protobuf.Empty) returns (stream RepoChanged);
}

Then generate the code for both processes:

npm run gen

Implement it 

Copy the domain’s handler object, such as src/main/repository.ts, from the Electron app into my-app-mobrowser/src/main/, and port its Electron calls as you did in Step 3. Then register the service and pass the calls to the handler object. This file replaces the ipcMain binding from Step 1:

// src/main/repo.ts
import { ipc } from '@mobrowser/api'
import { RepoServiceDescriptor } from './gen/ipc_service'
import { repository } from './repository'

// Without an implementation, returns a publisher for the stream method.
const repo = ipc.registerService(RepoServiceDescriptor)

// With an implementation, registers the request and response methods.
ipc.registerService(RepoServiceDescriptor, {
  GetStatus: (req) => repository.getStatus(req),
  Commit: (req) => repository.commit(req),
})

// `watcher` stands for the code that detects repository changes.
// Was: win.webContents.send('repository:changed', { path })
watcher.on('change', (path: string) => repo.OnChanged({ path }))

Import this file from src/main/index.ts. The handler object keeps its methods, and only the binding around it changes. That’s why Step 1 kept it separate from ipcMain.

Keep the frontend calls 

You don’t need to rewrite every call site in the frontend. In Step 1, the preload script exposed the domain’s API object to the page as window.repository. Copy src/shared/api.ts from the Electron app to the same path in the new project. Keep it outside src/renderer/, because the main process can import it too. Then implement the same RepositoryApi interface in the renderer on top of the generated client, and assign it to window.repository:

// src/renderer/api.ts
import { ipc } from './gen/ipc'
// The interface from Step 1.
import type { RepositoryApi } from '../shared/api'

declare global {
  interface Window {
    repository: RepositoryApi
  }
}

const repository: RepositoryApi = {
  getStatus: (req) => ipc.repo.GetStatus(req),
  commit: (req) => ipc.repo.Commit(req),
  onChanged: (listener) => {
    const subscription = ipc.repo.OnChanged({}).subscribe({ next: listener })
    return () => subscription.unsubscribe()
  },
}

window.repository = repository

The preload script ran before the page’s own scripts, so import this module first in the renderer entry point. The frontend’s calls then keep working unchanged.

Watch out for:

  • An unset field arrives with its default value, such as '', 0, or false. Mark a field optional when “not set” matters.
  • The compiler checks field names and types, but not that every method has an implementation. A missing method fails only when the renderer calls it.
  • A subscriber receives only the events published after it subscribes. For state that the renderer follows, send the current state first and then the changes.

You’re done with this step when:

  • Every domain has a service, and the frontend and all its features work.
  • No file in src/ mentions ipcRenderer, ipcMain, or contextBridge.

Step 5: Tune security 

Electron leaves many security checks to the application. Its security checklist asks you to limit navigation, validate the sender of every IPC message, and handle permission requests. MōBrowser makes some of these decisions itself.

In this step, you tune the default MōBrowser security checks and express the rest of your security rules as MōBrowser handlers and services. Code that only repeats the defaults can go, such as a comparison of event.senderFrame with your own origins. The rules you keep belong in these places:

  • Checks that depend on the user or the operation go into the service implementation.
  • Navigation, popup, permission, and download policies become handlers on win.browser, the counterpart of win.webContents: navigation, openPopup, requestPermissions, and startDownload.
  • A remote site that the application controls and that calls your services goes into app.trustedOrigins.
  • Deep links and file associations go into mobrowser.conf.json and the openUrl and openFile handlers.

Here is a typical Electron policy that keeps the window on known URLs and opens new windows in the default browser:

// Electron
win.webContents.on('will-navigate', (event, url) => {
  if (!isAllowed(url)) event.preventDefault()
})

win.webContents.setWindowOpenHandler(({ url }) => {
  shell.openExternal(url)
  return { action: 'deny' }
})

If your policy only keeps the window on your own content, delete it. MōBrowser already cancels navigation to other sites. Otherwise, rewrite it as the navigation and openPopup handlers, which return the decision:

// MōBrowser
import { workspace } from '@mobrowser/api'

function openInBrowser(url: string) {
  if (/^https?:/.test(url)) workspace.openUrl(url)
}

win.browser.handle('navigation', (params) => {
  if (params.isTrusted || params.isAppControlled) return 'proceed'
  if (params.hasUserGesture) openInBrowser(params.url)
  return 'cancel'
})

win.browser.handle('openPopup', (params) => {
  openInBrowser(params.url)
  return 'block'
})

isTrusted is true for the application origin and the origins in app.trustedOrigins. isAppControlled is true for schemes that you register with protocol.handle().

Watch out for:

  • A navigation handler decides every top-level navigation, including navigation to your own application. Allow trusted destinations in the handler yourself, as the first line of the example does.
  • A Content Security Policy moves to a <meta> element. There, 'self' doesn’t match mobrowser://app, the origin that serves your frontend, so name that origin instead.

You’re done with this step when:

  • Navigation, popups, permissions, and downloads are either handled or left to the MōBrowser defaults on purpose.
  • app.trustedOrigins lists only origins that the application controls.
  • Deep links work in a built application.

Step 6: Ship it 

The application now behaves as it did on Electron. What remains is the release: signed installers, automatic updates, and end-to-end tests.

In Step 2, you put the name, version, and bundle ID in mobrowser.conf.json. Now move the rest of your electron-builder or Electron Forge configuration there: the signing settings, icons, and installer options. Then build and package the application on each platform you ship:

npm run build
npm run pack

Once you configure signing, it runs as part of the build, and on macOS the build also notarizes the application. npm run pack generates the update files and signs them with an update signing key that you provide. Every release has to use the same key.

Port your end-to-end tests last, and use them as the acceptance test for the migration. Tests keep the Playwright locators and assertions, and the application starts for you:

// test/e2e/settings.test.ts
import { expect, test } from '@mobrowser/cli/e2e'

test('opens the settings', async ({ page }) => {
  await page.getByRole('button', { name: 'Settings' }).click()
  await expect(page.getByRole('heading', { name: 'General' })).toBeVisible()
})

Watch out for:

  • Automatic updates work between MōBrowser versions of the application. They don’t move users from an installed Electron version.
  • Linux has no platform code signing and no automatic updates. On Windows, updates require the native installer.
  • A signed application refuses to start if its packed code changes after signing. Remove any code that patches application files at runtime.

You’re done with this step when:

  • Signed builds install and update on macOS and Windows.
  • Native add-ons load in a built application.
  • npm test passes on every platform you ship.

Result 

Your application now runs on MōBrowser. The project that was empty in Step 2 holds all of it:

my-app-mobrowser/
├── src/
│   ├── main/            Startup code, windows, and services
│   ├── renderer/        Your frontend and the typed API objects
│   │   └── proto/       Protobuf definitions of your services
│   └── shared/          The typed API interfaces from Step 1
├── test/
│   └── e2e/             Your ported end-to-end tests
└── mobrowser.conf.json  Name, bundle ID, signing, and installers

The migration is finished when all of the following are true:

  • The renderer builds for a browser, and nothing in it imports Node.js.
  • No preload script is left, and every domain has a service.
  • Every Electron feature without an equivalent has a workaround or a recorded decision.
  • Signed builds install and update on macOS and Windows.
  • npm test passes on every platform you ship.

Until then, the Electron version from Step 1 is still the one you ship.

Conclusion 

Two of the six steps deal with the boundary between the renderer and the main process. Step 1 draws it while the application still runs on Electron, and Step 4 replaces the preload script with services. The other steps create the new project, move the shell into it, tune security, and set up the release pipeline.

The migration skill has what this guide leaves out: the full mapping of Electron APIs to MōBrowser, the features without an equivalent and their workarounds, and the order of work for a coding agent. To hand the migration to an agent, unzip the skill into your Electron app’s folder, for example into .agents/skills/, and copy it into the new project after Step 2.

To learn more, see these docs: