目录

MōBrowser 2.2.0

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

What’s new 

Granting permissions 

In the previous versions, when a web page requested a permission to access the camera or microphone, the application displayed the dialog asking the user to grant or deny the permission. Now you can handle the permission request programmatically by implementing the requestPermissions handler.

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

const win = new BrowserWindow()
win.browser.handle('requestPermissions',
  async (params: RequestPermissionsParams) => {
    if (params.permissionType === 'geolocation') {
      return 'grant'
    }
    return 'deny'
  })

Moreover, when the application is displaying local frontend only, all the permissions are granted by default. For external URLs, you can grant permissions for specific origins by adding them to the trustedOrigins list in the mobrowser.conf.json file.

"trustedOrigins": [ "*.foo.com", "https://*.foo.bar.com" ]

Selecting media devices 

You can now handle the media device selection request programmatically by implementing the selectMediaDevice handler.

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

const win = new BrowserWindow()
win.browser.handle('selectMediaDevice', (params: SelectMediaDeviceParams) => {
  return params.devices[0].id
})

Features 

  • The framework now requires Node.js LTS versions ^20.20.2, ^22.22.2, or >=24.14.1.
  • Allow configuring which locales should be included in the application bundle. You can now specify the list of locales in the mobrowser.conf.json file. It allows reducing the application bundle size by excluding the locales that are not needed.
  • Allow configuring the minimium size of the application browser window.
  • Change the default minimum size of the application browser window to 1x1.

Improvements 

  • Reduce the application bundle size by removing the unnecessary language packs from it. It allows reducing the application bundle size by up to 50MB on macOS.
  • Reduce the application build and startup time in development mode. The build and startup time is now up to 3x times faster compared to the previous versions.
  • Do not launch the chrome_crashpad_handler processes by default to reduce the number of processes.
  • Remove the internal scripts from package.json in the generated project. Developers and AI agents check the available scripts in the package.json file and use them to interact with the application. By removing the internal scripts, we make the package.json file more readable and easier to understand.
  • Add the resources folder to the project templates without a frontend framework.
  • Improve the error message that is shown when a second instance of the application is started. In the previous versions you could see the following message: Opening in existing browser session. Now you will see the This application is already opened in process PID. Only one instance of the application can be running at the same time. message with more detailed information.
  • When you build the app using npm run build command and something went wrong, you will now see the error message in the console explaining the reason of the failure. Previously you needed to re-run the command with the --verbose flag to see the error message.
  • CLI now displays spinner animation and the elapsed time for each step of the build process.

Fixes 

  • Fix wrong path to the default user data directory on Windows.
  • Fix a bug when the detached DevTools window has zero size and is not visible on macOS.
  • Fix a bug when -webkit-app-region: no-drag CSS rule is ignored.
  • Fix a bug when attempt to download and use CMake on macOS fails because it is blocked by Gatekeeper.
  • Fix the wrong position of the native JavaScript dialogs on macOS. In the previous versions the dialogs were displayed slightly above the application window.