目录

MōBrowser 2.21.0

In this update, you can ship beta builds through a separate update channel, give them pre-release versions such as 1.0.1-beta.2, and include release notes with updates. Annotation Mode now works on Linux, and coding agents create app and tray icons before the first launch. Production builds no longer accept development-only switches, and we fixed transparent windows on macOS and maximized windows on Windows.

What’s new 

Update channels 

You can now ship pre-release builds, such as beta, to some users through a separate update channel, while everyone else stays on production.

Set app.updateChannel in mobrowser.conf.json. mobrowser build and mobrowser pack use it:

{
  "app": {
    "updateChannel": "beta"
  }
}

pack prints the channel it packs for:

Update channel: beta (osx-beta)

Without app.updateChannel, the app is built for the default production channel, as before. Production and beta releases can share one releases directory.

An app checks for updates in the channel it was built for. To switch to another channel, pass channel to app.checkForUpdate():

import { app } from '@mobrowser/api'

// Join the beta program.
await app.checkForUpdate('https://updates.example.com', { channel: 'beta' })

// Back to production.
await app.checkForUpdate('https://updates.example.com', { channel: '' })

Once an update from another channel is installed, the app stays in that channel. Only a newer version is offered: a user who switches from beta 1.0.2 back to production gets no update until production has a version newer than 1.0.2. Switching channels always downloads the full package.

Pre-release versions 

You can now version beta and other pre-release builds as 1.0.1-beta.1, 1.0.1-beta.2, instead of using up patch numbers on them. Updates follow the SemVer order:

1.0.1-beta.1 < 1.0.1-beta.2 < 1.0.1-beta.10 < 1.0.1-rc.1 < 1.0.1

Add prerelease to app.version in mobrowser.conf.json:

{
  "app": {
    "version": { "major": "1", "minor": "0", "patch": "1", "prerelease": "beta.1" },
    "updateChannel": "beta"
  }
}

Build and pack as usual. The app version becomes 1.0.1-beta.1, and app.version returns it:

import { app } from '@mobrowser/api'

console.log(app.version) // "1.0.1-beta.1"

For the next beta, change the pre-release to beta.2. For the release, clear it with "prerelease": "", and 1.0.1 is offered over all its betas.

A pre-release consists of dot-separated identifiers made of letters, digits, and -, such as beta.2, rc.1, or alpha-1. Numeric identifiers can’t have leading zeros. Build metadata (+...) isn’t supported.

Note: Ship pre-releases in their own update channel, as in the example above. Without app.updateChannel, a pre-release goes to the default channel, and every user of your stable releases is offered it as an update. The channel isn’t derived from the pre-release, and a channel can ship release versions too.

Release notes in updates 

You can now ship release notes with an update and show them in the update UI of your app.

Pass a Markdown file to pack with --release-notes. The notes are stored in the update feed together with the release:

npm run pack -- --release-notes ./CHANGELOG-1.2.0.md

When the app finds the update, AppUpdate.releaseNotes returns the notes, or an empty string when the release has none:

import { app } from '@mobrowser/api'

const update = await app.checkForUpdate('https://updates.example.com')
if (update && typeof update !== 'string') {
  console.log(`Version ${update.version} is available`)
  if (update.releaseNotes) {
    console.log(update.releaseNotes) // Markdown, e.g. '## 1.2.0\n\n- Fixed a crash on start.'
  }
}

Annotation Mode on Linux 

The development toolbar and Annotation Mode are now available on Linux, as on macOS and Windows. Start Annotation Mode with Ctrl+Shift+A, and hide or show the toolbar with Ctrl+Shift+T.

App and tray icons from coding agents 

Generated projects now guide AI coding agents to create the application icon before the first test launch, so the app runs with its own branding from the start. The agent creates one design based on the purpose and style of the app and derives valid assets/app.icns, assets/app.ico, and assets/app.png from it, regardless of the platform it runs on.

In the same pass, the agent prepares a matching monochrome tray icon, resources/imageTemplate.png and resources/imageTemplate@2x.png: a simplified symbol in black on a transparent background, as macOS template images require.

The agent validates the formats and sizes of the generated files. It keeps icons you already provided, generates only missing or invalid ones, and doesn’t regenerate them on later runs. When it can’t generate an icon, it tells you instead of leaving the template icons in place.

Fixes and improvements 

  • Production builds, signed or not, now ignore development-only inputs: the VITE_DEV_SERVER_PORT environment variable and the --e2e-test, --enable-agent-server, and --invisible switches. Before, only a production code signature blocked them, so in unsigned production builds, including all Linux builds, they could enable remote debugging and the Node.js inspector, load the renderer from localhost, or start the agent server and run arbitrary code in the app.
  • Fixed windows with transparentBackground: true or vibrancy rendering an opaque white background on macOS since 2.19.0.
  • Fixed a maximized window having an incorrect size on Windows.
  • Fixed the development toolbar overlapping the title bar of maximized windows on Windows and macOS.