Framework
Unreleased
v6.11.0
Config: fallback modes
By default, Neutralinojs apps show an error message and stop the process on mode failures (e.g., if Chrome isn't installed but the app has launched with the chrome mode or if WebView2 (on Windows) isn't installed but the app has launched with the window mode). Now the framework offers the tryFallbackModes boolean config option to activate fallback modes. If this setting is set to true and the app has launched in window mode, it will try launching the app in window, chrome, and browser modes respectively on failures.
Config: logging formats
- Add log format customization support with the
logging.formatconfig option. Supports all Easylogging++ format specifiers, e.g.,"%level %datetime %msg %loc %user@%host"(default)
API: filesystem
- Add the
filesystem.getOpenedFiles()function to retrieve an array of currently opened files withfilesystem.openFile().
v6.10.0
Security: Shell command allow list
The shell command allow-listing feature restricts os.execCommand and os.spawnProcess to a configurable set of allowed programs via the new commandAllowList configuration option. When this option is set with one or more entries, the framework rejects any command whose program name (argv[0]) does not match an entry with the new NE_OS_CMDNALW error. Patterns support * and ? wildcards. The command is parsed with simple shell-quote rules; unquoted shell metacharacters (;|&><$`(){} and newline) reject the command outright, so commandAllowList cannot be used to run piped or redirected commands, but it's very helpful for strengthening command execution security for simple commands that Neutralinojs apps execute or spawn.
Example configuration:
{
"commandAllowList": ["node", "python*", "gcc"]
}
If the list is empty or omitted, no restriction is applied. A list containing only * (or any other pattern that matches every program) is equivalent to omitting the option.
Security: Filesystem scopes
Restrict filesystem access to a set of allowed paths via the new filesystemScopes configuration option. Each entry is a path-to-mode mapping where the mode is read, write, or read-write and gates the corresponding read/write operations accordingly. Read-only filesystem API calls (readFile, readBinaryFile, openFile, readDirectory, getStats, getPermissions, access, and the source path of copy/move) require a scope entry whose mode is read or read-write. Write-style API calls (writeFile, writeBinaryFile, appendFile, appendBinaryFile, createDirectory, remove, createWatcher, setPermissions, chmod, chown, both paths of move, and the destination path of copy) require write or read-write. Calls outside any matching scope fail with the new NE_FS_SCOPERR error. Pure string-manipulation helpers (getAbsolutePath, getRelativePath, getPathParts, getJoinedPath, getNormalizedPath, getUnnormalizedPath) and in-memory handle operations (updateOpenedFile, getOpenedFileInfo) are not gated. Scope entries support NL_PATH and NL_OS_*PATH constants, and each entry may reference a directory (any nested path is allowed) or a file (only the exact file is allowed). If the map is empty or omitted, no restriction is applied.
Example configuration:
{
"filesystemScopes": {
"/path/to/location": "read-write",
"${NL_OSHOMEPATH}": "read",
"${NL_PATH}/resources": "write"
}
}
Configuration
- Add the
systemEnvsconfig option to update or use custom environment variables. These environment variables are activated at the framework initialization stage, so developers can add GTK, webview-specific, or other library/system configurations here.
{
"systemEnvs": {
"WEBKIT_DISABLE_COMPOSITING_MODE": "1",
"GDK_BACKEND": "x11"
}
}
API: computer
- Add
computer.getGPUs()to get a list of all GPUs in the computer.
v6.9.0
API: net
Neutralinojs apps can use the fetch API available in the webview for making network requests, but the CORS policy often becomes a barrier. The new C++-based network API offers functions to call network resources without disabling webview network security. Here is a list of all available net API functions:
net.get(url, options): Sends aGETrequest.net.post(url, options): Sends aPOSTrequest.net.put(url, options): Sends aPUTrequest.net.patch(url, options): Sends aPATCHrequest.net.delete(url, options): Sends aDELETErequest.net.options(url, options): Sends anOPTIONSrequest.net.head(url, options): Sends aHEADrequest.net.request(url, method, options): Sends a request by specifying an HTTP method
API: computer
- Add
computer.getDisks()to retrieve information for each connected disk, including vendor, model, mount point, size, free space, and serial number. - Add
compuer.getMachineId()to get the platform-specific unique machine identifier.
API: app
- Add
app.getProcessId()to retrieve the app's process identifier.
API: os
- Add
os.setEnv(key, value)to update process environment variables. - Add
os.getLocaleInfo()to get the current locale information, including the full standard, unparsed locale, parsed region, and language.
v6.8.0
Core: new window policy
In previous framework versions, target="_blank" hyperlinks didn't automatically open in the default web browser or a new Neutralinojs window. The new window policy feature offers a way to handle target="_blank" hyperlinks properly using the window.newWindowPolicy: string configuration option. This option accepts three values:
system: Uses the default behavior of the platform-specific system webview. Ignores or opens in a new webview window.browser: Opens the URL in the default web browser.custom: Emits thenewWindowRequestevent with the URL, so the developer can implement custom logic (e.g., opening the specific URL in a new Neutralinojs window, HTML popup, etc.).
API: native file drag and drop
By default, Neutralinojs webview enables the system webview's drag and drop implementation, so developers can add drag and drop features for Neutralinojs apps using standard JavaScript web APIs, but they can't retrieve the actual file path due to security concerns. Neutralinojs native filesystem API can't be used with C:\fakepath\filename.ext-like fake file paths. Now, you can disable webview-specific drag and drop handling and get full file paths of dropped files directly via Neutralinojs events using the window.emitDropEvents: boolean configuration option. If this option is set to true, you can get dropped files as follows:
await Neutralino.events.on('filesDropped', (e) => {
console.log('Files: ', e.detail);
});
API: computer
- Implement
os.getHostname()to retrieve the hostname. - Implement
os.getNetworkInterfaces()to retrieve network interface details, including name, IP, MAC, type (internal/loopback or not), and IP family (v4 or v6) for each network interface entity. This function produces a similar output to Node.js'sos.networkInterfaces()
API: filesystem
- Implement
filesystem.chmod(path, mode)to change file access permissions using POSIX octal file modes — a POSIX-friendly alternative to the existing genericfilesystem.setPermissions()function. - Implement
filesystem.access(path, mode)to test file access permissions using POSIX access modes (0,1,2, and4) — a POSIX-friendly alternative to the existing genericfilesystem.getPermissions()function. - Implement
filesystem.chown(path, uid, gid)to change user/group ownership of files and directories. This method has no effect on Windows.
API: os
- Implement
os.trashItem(path)to send a file or directory into the system trash container. - Add
homeanddesktoppath name implementations to theos.getPath(name)function.
Core: static server
- Implements HTTP 206 partial content feature to support HTML
<video>progress changes (seeking).
Core: extensions
- Allow extensions to use WebSocket binary mode for communicating with the Neutralinojs framework.
Improvements/bugfixes
- Fix memory handling issues in the
os.setTray()implementation. - Fix the crash that occurs while using the tray menu and window menu together on macOS.
- Focus app content on the window focus event on Windows.
- Using the theme color to fix the well-known white screen flashing bug on Linux.
- Remove the registered system tray icon when the framework process exits on Windows.
v6.7.0
API: Input device simulation and handling
New functions were added to the computer namespace to update the mouse position, confine the mouse cursor within the window, and simulate keyboard events. These functions work on Windows and macOS, but only work under the X window system on Linux (or FreeBSD). On Wayland, these functions will throw NE_CO_UNLTOSC, NE_CO_UNLTOMG, or NE_CO_UNLTOSK error messages.
- Implement
computer.setMousePosition(x, y)to update the current mouse cursor position. - Implement
computer.setMouseGrabbing(grabbing: boolean)to activate/deactivate confining the mouse cursor within the native app window. Ifgrabbingis set totrue, the mouse cursor always stays within the window boundaries, so this feature helps create interactive games and similar apps operated using the mouse. - Implement
computer.sendKey(keyCode, keyState)to simulate keyboard events. App developers can use a platform-specific key code and states (press,down, andup) to simulate from simple single key strokes to complex key combinations:
// Simulate letter 'a' press on GNU/Linux:
await Neutralino.computer.sendKey(38)
// Simulate Ctrl + V keyboard shortcut on GNU/Linux:
await Neutralino.computer.sendKey(105, 'down') // Hold right control
await Neutralino.computer.sendKey(55, 'down') // Hold letter 'v'
await Neutralino.computer.sendKey(55, 'up') // Release letter 'v'
await Neutralino.computer.sendKey(105, 'up') // Release right control
API: os
- Add
useTemplateIcon: booloption toos.setTray(options)for activating adaptive tray icon with the current color-scheme on macOS.
Improvements/bugfixes
- Display the app icon properly with the
os.showNotification()function when the app is launched from a Mac app bundle. - Fix the window-ordering issue with
window.focus()on macOS. - Auto-focus the app window when the Mac dock app icon is clicked.
- Write full C++ exception messages to the terminal to improve the framework-related bug-reporting experience.
v6.5.0
Core: events
- New window events:
windowMinimize,windowRestore,windowMaximize,windowFullScreenEnter, andwindowFullScreenExit
API: window
- Add
window.setBorderless(bool)to toggle borderless mode while the Neutralinojs app is running.
Configuration
- Add
modes.chrome.browserBinaryoption to set custom browser binary path under the chrome mode. If this field is specified, the framework will try to launch Chrome from there. If it fails, the framework will initiate the Chrome binary search as usual:
// cross-platform
"browserBinary": "/path/to/chrome/bin"
// platform-specific path
"browserBinaryLinux": "/usr/bin/google-chrome",
"browserBinaryDarwin": "/Applications/Google Chrome.app",
"browserBinaryWindows": "C:\\Programs\\Google Chrome\\chrome.exe"
// cross-platform (with path constants)
"browserBinary": "${NL_OSDATAPATH}/chrome/bin"
"browserBinaryWindows": "${NL_OSDOWNLOADSPATH}/chrome.exe"
- Add the
modes.window.useLogicalPixels: true|falseoption to activate DPI-aware sizing based on the operating system's display scale factor. - Add extra path constants support (early versions only supported
${NL_PATH}) for the extensions command:${NL_OSDATAPATH},${NL_OSCACHEPATH}, ... All supported path constants use this format:${NL_OS<name>PATH}where<name>is any accepted parameter (uppercased) to theos.getPath(name)function:
"commandLinux": "${NL_OSDOWNLOADSPATH}/extensionBinary --load"
Improvements/bugfixes
- Fix issues with filter extension handling of the file dialogs API on Linux
- Fix tray icon disappearing issue on Windows
v6.4.0
API: storage
- Implement
storage.clear()andstorage.removeData(key)functions to remove saved storage data.
Improvements/bugfixes
- Fix the draggable region not working issue on Windows.
- Replace deprecated macOS API with suitable modern APIs in the codebase.
- Static file server enhancements.
- Improve
window.getPosition()in macOS. - Save the correct window size and position when a maximized/minimized window is being closed on Windows.
- Fix the window disappearing issue while restoring the window on Windows
v6.3.0
Single-executable mode
Earlier, the Neutralinojs framework normally loaded resources either from the resources directory or the resources.neu file, and didn't offer a proper way to use embedded resource files in the app binary to allow developers to create single-executable apps. Now, the framework loads resources from the binary itself on all platforms if the app was built using the neu build --embed-resources CLI flag. This feature deprecates the --load-dir-res option and introduces the new --res-mode=<mode> option to choose the preferred resource loading mode from embedded (default), bundle, or directory.
The Neutralinojs single-executable feature internally uses the postject library to embed the resources.neu file into platform-specific binaries via the neu CLI and the postject library C header file to read the embedded resources during application runtime.
Configuration
- Support the
window.skipTaskbarboolean option to hide the application icon from the operating system taskbar/dock. This option can also be passed from the command line via the--window-skip-taskbar=<true|false>option. - Implement the
window.openInspectorOnStartupboolean option to configure auto-opening the inspector window. This feature is also available via the--window-open-inspector-on-startup=<true|false>command-line flag.
Improvements/bugfixes
- Fix WebView2 crash when Windows usernames or executable paths contain Unicode characters (e.g., äüö, Chinese characters). Replaced ANSI Windows APIs with Unicode equivalents and added proper null pointer checking for environment variable access.
- Include details about missing parameter names in the error object of
NE_RT_NATRTER.
v6.2.0
API: window
- Add
Neutralino.window.print()to display the native print dialog on all platforms. This was especially added since the macOS webview doesn't implement thewindow.print()function. - Introduce the
window.beginDrag()function to trigger native window dragging. The new draggable region API implementation uses this function internally.
API: filesystem
- Add
filesystem.getJoinedPath(...paths: string[])to create a single path by joining multiple path strings. - Add
filesystem.getNormalizedPath()andfilesystem.getUnnormalizedPath()functions, which make Windows paths look like Unix paths by replacing\\with/and revert normalized paths into Windows-specific paths respectively on the Windows platform. On non-Windows platforms, these functions return the same input strings.
Configuration
- Implement the
window.webviewArgsconfiguration option to pass additional browser arguments to the WebView2 instance on Windows:
"modes": {
"window": {
// ....
"webviewArgs": "--user-agent=\"Custom user agent\""
}
}
Improvements/bugfixes
- Display GUI error messages for webview initialization failures. i.e., if the WebView2 runtime is not installed on Windows and if the WebKitGTK library is not installed on GNU/Linux platforms.
v6.1.0
API: Native window main menu
The new window.setMainMenu(menu) function lets developers create a native window menu on GNU/Linux and Windows and an application menu on macOS. This function can be called multiple times with different menu objects to update menu items dynamically:
const menu = [
{id: 'file', text: 'File',
menuItems: [
{id: 'open', text: 'Open'},
{text: '-'},
{id: 'quit', text: 'Quit'},
]},
{id: 'edit', text: 'Edit',
menuItems: [
{id: 'cut', text: 'Cut'},
{id: 'copy', text: 'Copy'},
{id: 'paste', text: 'Paste'},
]}
];
await Neutralino.window.setMainMenu(menu);
The framework will trigger the mainMenuItemClicked event with menu item data when the user clicks on a specific menu item.
On macOS, app developers can register key accelerators and pre-defined actions as follows:
{id: 'edit', text: 'Edit',
menuItems: [
{id: 'cut', text: 'Cut', action: 'cut:', shortcut: 'x'},
{id: 'copy', text: 'Copy', action: 'copy:', shortcut: 'c'},
{id: 'paste', text: 'Paste', action: 'paste:', shortcut: 'v'},
]}
On GNU/Linux and Windows, the framework only displays the keyboard shortcut within the particular menu item and doesn't register a key accelerator yet:
{id: 'copy', text: 'Copy', shortcut: 'Ctrl + C'}
Note: We are planning to add key accelerator support for GNU/Linux and Windows native window menus with a global key accelerator feature in an upcoming framework version.
Core: global variables
- Add
NL_LOCALEto get the user locale name, e.g.,en_US.UTF-8 - Add
NL_COMPDATAto display custom data strings embedded in the binary via the BuildZri configuration. Developers can use this global variable to set the build number or other static data when they compile their own framework binary with the BuildZri script:
"definitions": {
"*": [
"NEU_COMPILATION_DATA=\\\"build_number=${BZ_BUILDNUMBER};compiler_name=${BZ_COMPILERNAME}\\\"",
v6.0.0
API: clipboard
- Implement
clipboard.writeHTML(html)andclipboard.readHTML()functions to write/read HTML strings
API: os
- Adding
envskey-value pair parameter to theoptionsof theos.execCommand(command, options)function to set specific environment variables for the child process. - Change the
os.spawnProcess(command, cwd)toos.spawnProcess(command, options)to set environment variables and the current working directory via theoptionsobject for the spawned child process:
// e.g.:
await Neutralino.os.spawnCommand('env', {
cwd: NL_PATH,
envs: {
VAR1: 'var1',
VAR2: 'var2'
}
});
API: filesystem
- Add the
timestamp(ISO 8601) property to thewatchFileevent's data payload to identify when a specific file watcher event occurred. - Implement
filesystem.setPermissions(path, permissions, mode)andfilesystem.getPermissions(path)functions to set/get file permissions in a cross-platform way:
// e.g.:
await Neutralino.filesystem.setPermissions(NL_PATH + '/my-directory-1', {ownerRead: true, groupRead: true});
await Neutralino.filesystem.setPermissions(NL_PATH + '/my-directory-2', {all: true});
await Neutralino.filesystem.setPermissions(NL_PATH + '/my-directory-3', {otherAll: true}, 'REMOVE');
const permissions = await Neutralino.filesystem.getPermissions(NL_PATH);
// permissions -> {all:.., ownerRead, ownerWrite...}
Core: extensions
- Extensions are now loaded internally using the
os.spawnProcess()function without triggering process events. This modification displays extension logs within the Windows terminal and lets app developers control extensions using the existing spawn process API.
Security
- Improve the
NL_TOKENgeneration algorithm to strengthen security using the C++std::mt19937random number generator.
Improvements/bugfixes
- Fix framework crashing when creating the
.tmpdirectory under restricted file manipulation permissions. - Fix several issues in the Windows-specific GUI notification implementation of the
os.showNotification()function. - Fix invalid utf8 character handling issues in several native APIs (i.e.,
os.spawnProcess('./bin')crashed ifbinoutput"ä\xA9ü")
v5.6.0
API: server
Neutralinojs doesn't support the file:// protocol to load local resource files due to application security concerns. Because of this limitation, app developers had to read files using filesystem APIs. The new server namespace implements server.mount(path, target), server.unmount(path), and server.getMounts() functions to let developers load local files from the Neutralinojs static server by creating directory mappings as an alternative for the file:// protocol.
For example, the following function call configures the Neutralinojs static server to serve resources on the ${NL_PATH}/app-res directory:
await Neutralino.server.mount('/app-res', NL_PATH + '/app-res');
With the above server configuration, NL_PATH + '/app-res/stat.txt' can be loaded to the webview via the following URL:
http://127.0.0.1/app-res/stat.txt
This local directory mounting configuration can be deactivated as follows:
await Neutralino.server.unmount('/app-res');
API: resources
- Fallback to native filesystem APIs when
NL_RESMODEisdirectory. - Implement
resources.getStats(path)andresources.extractDirectory(path, destination)functions.
API: window
- Implement the
window.snapshot(path)function to capture the window and save it as a PNG image file.
Improvements/bugfixes
- Fix the empty string returning issue with the
window.getTitle()function on Windows. - Create non-existent directories while extracting resource files using the
resources.extractFile()function. - Supports using large
resources.neufiles.
DevOps
- Fix minor string formatting issues in the BuildZri automation script.
- Fix various test suite failure scenarios.
v5.5.0
Client library and globals injection
Neutralinojs apps usually load globals and the client library using HTTP requests via the static server. This mechanism implements a generic way to enable the native API on all supported Neutralinojs app modes. However, this strategy prevents
enabling the Neutralinojs native API if the primary web app is loaded through another server (local or remote). Now, app developers can inject globals and
the client library script into external web services using window.injectGlobals and window.injectClientLibrary configuration options on the window mode.
These options are available as CLI options as well (--window-inject-globals and --window-inject-client-library), so developers can use these options via the window.create(url, options) function. This code injection feature currently works with HTTP URLs only (can be used with local and remote HTTP web servers).
Preload script support
The framework already lets developers set pre-defined global variables for each web page by using custom globals from the app configuration and activating the window.injectGlobals option. However, custom globals are static values, so app developers can't define dynamic values or run a custom JavaScript source using globals and window.injectGlobals features. This framework version implements the window.injectScript configuration option to inject and run custom JavaScript source file before running the primary webapp's JavaScript sources.
For example, the following setup loads an initialization script from the preload.js file:
"window": {
"injectScript": "/resources/js/preload.js"
}
Developers can use native API calls within initialization scripts if window.injectClientLibrary is set to true. This option also can be set via --window-inject-script and window.create(url, options).
Configuration
- Implement the
dataLocationconfig option to let users set data directory for framework data storage purposes, such as saving window state, storing extracted resources, etc. Ifapp(default) is used, the framework will store app data within the app directory and ifsystemis used, the framework will use a platform-specific data directory path (i.e.,/home/username/.local/share/<appId>on GNU/Linux systems) to store app data. App developers can obtain the current data directory string from theNL_DATAPATHglobal variable. - Implement the
storageLocationconfig option to let developers use system data directory for the Neutralinojs storage. If this option is 'app' (default), the framework store storage files within the app directory. Ifsystemis used, the framework will use the platform-specific standard data directory. In bothappandsystemmodes, the framework will use the.storagesub-directory for storage files.
Improvements/bugfixes
- Search and load WebKitGtk functions dynamically from the available webkit2gtk library:
libwebkit2gtk-4.0-37orlibwebkit2gtk-4.1-0. - Fix the auto-reload issue during app development.
v5.4.0
API: resources
- Implement
getFiles(),extractFile(path, dest),readFile(path), andreadBinaryFile(path)functions via theresourcesmodule for reading the files embedded in theresources.neuresources bundle. These functions works only if the framework loaded resources from the resource bundle -- they will throwNE_RS_APIRQRFif the framework loaded resources from the resources directory.
API: window
- Implement
minimize(),unminimize(), andisMinimized()functions to minimize and restore the native app window.
Improvements/bugfixes
- Fix issues with the
clipboard.writeImage()function on Windows. - Fix the unwanted delay with the
window.exitProcessOnCloseconfiguration option on Windows. - Fix a bug with the
window.isFullScreen()function on GNU/Linux-based platforms. - Fix duplicate virtual PID issues with the
os.spawnProcess()function.
v5.3.0
Configuration: window transparency on Windows
Window transparency support was added on the Windows version of the Neutralinojs framework. This can be activated with modes.window.transparent configuration property or --window-transparent command-line option. Unlike in other platforms, Windows native window becomes borderless (window controls will be hidden) with the activation of the transparent mode.
API: os
- Add the
tempkey for the supported directory list of theos.getPath(pathKey)function.
API: filesystem
- Add the
filesystem.getAbsolutePath(path)function to let developers get a full path string from a relative path string. - Add the
filesystem.getRelativePath(path, ?base)function to get a relative path from a path and a base path. - Add the
filesystem.getPathParts(path)to parse and get path segments like filename, extension, root path, etc.
Improvements/bugfixes
- Fix Unicode issues in the Windows version with filesystem, storage, and general modules.
- Fix standard output/error data display issues on Windows
v5.2.0
Configuration: Configless framework initialization
Now, developers can load the Neutralinojs framework without creating a neutralino.config.json file. Now, there is no mandatory configuration properties since Neutralinojs set reasonable defaults. Developers can launch the framework using the following methods without a configuration file:
# Loading a remote URL
./framework-bin --url=https://neutralino.js.org/docs
# Launches a local static web app
./framework-bin --url="/resources/" --window-title="My web app" --enable-server
Configuration
- New internal CLI arguments added:
--single-page-serve,--enable-native-apiand--document-root=<string>
Core: Static server SPA (Single Page App) serving
Earlier, Neutralinojs app developers had to use hash routing with their frontend-library-based apps since the internal static server didn't offer an inbuilt URL rewrite logic for SPAs (Single Page Apps). Now, they can use the singlePageServe: true option in the app configuration file to activate SPA routing. If this setting is on, the static server will serve the main index.html file when it receives directory requests that possibly send HTTP 404 status.
For example, the /invoices path serves the main index.html file if there is no directory named invoices which holds an index.html file.
API: window
- Improve the behaviour of the
window.show()function on Windows. Now, this function flashes the window if it's already in foreground and activates the window properly if it's minimized.
Improvements/bugfixes
- Fix path issues with the
defaultPathoption in system file dialogs on Windows.
v5.1.0
Configuration: window transparency
Neutralinojs offers the inbuilt borderless mode and draggable region API to create custom window frames using HTML and CSS. Earlier, Neutralinojs used a default opaque color (usually white) for the window and webview layer, so app developers couldn't make custom CSS-styled window frames transparent or implement custom window frame shapes (i.e., rounded edges). Now, it offers the window.transparent boolean flag to activate window transparency.
If the transparency mode is on, the Neutralinojs window and webview use an alpha color layer and become transparent, so developers can use the rgba CSS color function on body background to handle the transparency level of the app.
The transparency mode can be activated using the --window-transparent=<bool> internal command-line option too.
Note: This feature is not implemented for the Windows operating system yet.
API: clipboard
- Implement
clipboard.readImage()andclipboard.writeImage(image)functions to work with clipboard image data. - Expose the
clipboard.clear()function to clear system clipboard. - Expose the
clipboard.getFormat()function to check the system clipboard data format. This function returnstext,image, andunknownenum values based on existing data on the clipboard.
v5.0.0
API: Reading, writing with standard streams
- Implement
app.readProcessInput(readAll=false)for reading string data from the standard input stream. This function can read a single line or multiple lines at once. - Implement
app.writeProcessOutputandapp.writeProcessErrorfor sending string data to standard output and error streams accordingly.
API: filesystem
- Enable default recursive behavior in the
filesystem.createDirectoryfunction. - Add
filesystem.copy,filesystem.move, andfilesystem.removefunctions. - Add
{recursive}options object tofilesystem.readDirectory(path, options)activate recursive directory listing.
API: os
- Accept stdin with the background mode of the
os.execCommandfunction.
Core: security
- Now, all app clients and extensions require a valid connect token (A part of the
NL_TOKEN) to connect to the Neutralinojs framework WebSocket server to receive app events. - The framework now sends the access token, connect token, port, and extension identifier to extension processes via the standard input, so other processes can't read them by scanning the process list.
- The WebSocket client connection origin is checked during the HTTP/WS handshake to make sure that only local clients connect with a specific Neutralinojs app that runs on window, browser, or Chrome mode. Any URL origin is allowed for the cloud mode.
- The above security enhancements fix two security advisories on GitHub.
Global variables
- Now the
NL_ARCHglobal variable returns the same value thatcomputer.getArchreturns.
Deprecations
- Removed
filesystem.removeFile,filesystem.removeDirectory,filesystem.copyFile, andfilesystem.moveFilefunctions. - Extensions won't receive
--nl-port,--nl-token, and--nl-extension-idas command-line arguments. Now the framework sends these via stdin as a JSON string.
v4.15.0
Configuration: custom user agent string
Developers sometimes use the user agent string to identify the client in server-side and client-side source codes. Now, Neutralinojs lets app developers extend the default user agent string with a custom string via the window.extendUserAgentWith configuration property and the --window-extend-user-agent-with=<string> command-line option, as shown in the following example:
"window": {
// ---
"extendUserAgentWith": "MyAppClient"
}
The above configuration extends the user agent string:
console.log(navigator.userAgent) // <Default UA> MyAppClient
Configuration: custom configuration files
The Neutralinojs framework typically loads the application configuration content from the neutralino.config.json file, but sometimes app developers need to use a custom configuration filename during development (i.e., For separating production and development environments). Now, you can use the --config-file=<filename> internal command-line parameter to use a custom app configuration, as shown in the following example:
./myapp-linux_x64 --load-dir-res --config-file=neutralino-dev.config.json
v4.14.1
DevOps
- Use Windows 2019 server and macOS 11 (Big Sur) to compile framework release artifacts.
- Set minimum supported macOS version via
MACOSX_DEPLOYMENT_TARGET=10.7
v4.14.0
Filesystem API
- Introduce the
filesystem.getWatchersfunction to get all created watchers. - Add binary file reading support for the
filesystem.updateOpenedFile(id, action, data)function. This function implementsreadBinaryandreadAllBinaryactions anddataBinaryoutput action in theopenedFileglobal event. - Return the existing watcher identifier from
filesystem.createWatcherif there is an existing active watcher for the given path.
OS API
- Add a way to set current working directory for process creation functions:
os.execCommand(command, options)now supportscwdvia the options object andos.spawnProcess(command, cwd)accepts currently working directory via the second string parameter.
Improvements/bugfixes
- Fix Unicode character issues in the tray menu on Windows.
- Avoid including null bytes to file reader events initiated by the
filesystem.openFilefunction. - Discard
windowmethod executions on non-window modes.
DevOps
- Update external GitHub Action packages to their latest versions.
- Fix issues of the failing test cases
v4.13.0
Core: persistent window state
Now the framework stores the primary window state in a temporary file (JSON formatted) and loads during the startup process.
This feature stores and sets the window position (x, y coordinates), size (width and height), and maximized status. This feature is enabled by default in all platforms, but app developers can turn it off by using false for the window.useSavedState configuration attribute or --window-use-saved-state internal CLI argument.
Also, the window state loading status is available via the NL_WSAVSTLOADED global variable. The framework sets true for this boolean variable if the window state was loaded from the saved configuration.
Improvements/bugfixes
- Fix several issues in the webview Windows code (i.e., Wait for the window close event, window style fixes, etc.).
v4.12.0
API: window
- Add
window.centerto center the application window programmatically.
Core: configuration
- Setting the initial window position via
modes.window.xandmodes.window.yinteger config props. - Centering the window at startup via
modes.window.centerboolean config props. - Add config overrides for the startup window position:
--window-center=<true|false>,--window-x=<int>and--window-y=<int>
Core: webview
- Statically link the Webview2 loader library on Windows, so app developers can package their apps without including the
WebView2Loader.dllfile.
Improvements/bugfixes
- Added Unicode characters support for Neutralinojs Windows.