目录

MōBrowser 2.3.0

We’re happy to announce the release of MōBrowser 2.3.0! This release brings new features to the framework and contains a number of fixes and improvements.

What’s new 

AI improvements 

create-mobrowser-app now asks if you want to include AGENTS.md to guide AI coding agents on how to use the MōBrowser framework.

The AGENTS.md file is a short directive that tells agents to read the docs bundled at node_modules/@mobrowser/api/docs before writing any code. The @mobrowser/api npm package now includes the full documentation as plain Markdown files, giving agents accurate version-matched references locally without fetching external data.

The documentation includes guides and API reference with many examples to help AI coding agents better write code.

App preferences 

We’ve added the Preferences API to the framework. You can now store and retrieve the preferences of your application using the following approach:

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

prefs.setString('theme', 'dark')
const theme = prefs.getString('theme', 'system')

Learn more in the Preferences guide.

Injecting JavaScript 

When you load an external web page, you might want to execute some JavaScript code on it before the JavaScript code of the page is executed. For example, you might want to inject a script to the page to track the user’s activity or to override the existing functionality of the page.

You can do this now using the following approach:

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

const win = new BrowserWindow()
win.browser.handle('injectJs', (params) => {
  if (params.isMainFrame) {
    return `console.log('Hello, world!')`
  }
  return ''
})
win.browser.loadUrl('https://example.com')
win.show()

Screenshot protection 

You can now protect each browser window in your application from being captured by a screenshot tool. It’s useful when you need to protect sensitive data or content from being captured and shared. Use the following code to protect a window from being captured:

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

const win = new BrowserWindow()
win.setScreenCaptureProtectionEnabled(true)
win.show()

You can learn more about the screenshot protection in the Screenshot protection guide.

Improvements 

  • Validate the current installed Node.js version and show a warning if it is not compatible with the framework requirements. You will see the following message:
    You are using Node.js 20.20.2, but the required version is:
     ^20.20.3 || ^22.22.2 || >=24.14.1.
    Please upgrade Node.js and try again. You can download and install
    a compatible version from https://nodejs.org/en/download/
    
  • Reduced the build time by avoiding unnecessary second notarization step on macOS. In the previous versions, we notarized the application twice: once when building the application and once when creating the native DMG installer. Now we notarize the application only once when creating the installer. The application will be notarized automatically in this case.
  • CLI now prints the full command we recommend to run to get more details about the error. For example, if you run npm run dev and get an error, we will now see in the error message the arguments for the command that fails:
    Error: Failed to build and run application in development mode.
    Run `npm run dev -- --verbose` to get more details about this error.
    

Fixes 

  • Fixed a bug when it is not possible to debug TypeScript code in the VS Code debugger in the project generated with create-mobrowser-app. We fixed the launch configuration in .vscode/launch.json.
  • Fixed a bug when build fails when the path to the project contains whitespace.