Contents

MōBrowser 2.14.0

In this update we added a built-in update flow for packaged macOS apps, cross-platform file associations, the mobrowser add command for extending existing projects, and control over the Windows titlebar icon. It also improves standard editing shortcuts on macOS and resolves window-closing and stability issues.

What’s new 

Built-in app updates on macOS 

Packaged macOS applications can now provide a complete, user-initiated update flow without implementing it in application code. Set the app.updateServerUrl property in mobrowser.conf.json to the URL of the update server or a cloud bucket where you store your app builds:

{
  "app": {
    "updateServerUrl": "https://app.com/updates"
  }
}

MōBrowser adds a Check for Updates… item to the default application menu. When the user selects it, the app checks the configured server, uses native dialogs to report that the app is up to date or ask whether to download an available update, and changes the menu item to Restart to Update once the update is ready.

Updates are never installed without user action. Applications that need a custom update experience can continue to use the existing auto-update API instead.

File associations 

Your app can now register its own document types on macOS, Windows, and Linux. Add fileAssociations to each platform’s bundle configuration to define the file extensions, display name, and icon:

{
  "app": {
    "bundle": {
      "macOS": {
        "fileAssociations": [
          {
            "extensions": ["myapp"],
            "name": "MyApp File",
            "icon": "assets/file.icns"
          }
        ]
      }
    }
  }
}

When the app is launched by opening an associated file, its path is available synchronously in app.launchInfo.files. Files opened while the app is already running are delivered to the new openFile handler:

import { app } from '@mobrowser/api';

// Handle files opened while the app is already running.
app.handle('openFile', (path: string) => {
  openFileEditor(path)
})

// Handle files that caused the app to launch.
app.launchInfo.files.forEach(openFileEditor)

The same launch-time model now applies to custom URL schemes. app.launchInfo.url contains the URL that caused the app to launch, while the existing openUrl handler receives URLs opened after launch. This fixes cold-launch custom URL handling on macOS, where the initial URL could previously be lost.

Add features to an existing project 

Features are no longer limited to those selected when a project is generated. The new mobrowser add command can extend an existing project interactively or add a specific feature:

# Pick a feature interactively.
npm run add

# Add a native C++ module.
npm run add native

# Add the GitHub Actions release workflow.
npm run add github-actions

Adding the native module creates its CMake, C++, and Protocol Buffers files and installs @mobrowser/native. Adding GitHub Actions creates the release workflow and configures the macOS signing fields to use its secrets.

Window titlebar icon on Windows 

The app icon shown in a Windows window titlebar can now be hidden for utility windows, widgets, and other custom window designs. Set windowIconVisible when creating a window, or change it later with setWindowIconVisible():

import { BrowserWindow } from '@mobrowser/api';

const win = new BrowserWindow({
  windowIconVisible: false
})

win.setWindowIconVisible(true)

Use isWindowIconVisible to query the current state. The icon remains visible by default, so existing applications are unaffected.

Fixes and improvements 

  • On macOS, the standard Undo, Redo, Cut, Copy, Paste, Paste and Match Style, and Select All keyboard shortcuts now work even when the application menu does not contain matching items. An application can still override any shortcut with its own menu item. The shortcuts also work while docked DevTools has focus.
  • Fixed a bug on macOS where quitting through Cmd+Q or Dock > Quit bypassed a window’s close handler. The handler now runs before the window is destroyed and receives isQuitting: true, allowing the application to save state before exiting.
  • Fixed a semi-transparent horizontal stripe that could be rendered over web content immediately below an enabled window titlebar on Windows.
  • Fixed a Windows browser-process crash caused by V8 deoptimization conflicting with Control-flow Enforcement Technology (CET) shadow stacks. The crash could occur reliably after importing packages such as @sentry/node, or unpredictably while other main-process JavaScript was running on CET-capable hardware.