






















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 the newWindowRequest event with the URL, so the developer can implement custom logic (e.g., opening the specific URL in a new Neutralinojs window, HTML popup, etc.).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);
});
os.getHostname() to retrieve the hostname.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's os.networkInterfaces()filesystem.chmod(path, mode) to change file access permissions using POSIX octal file modes — a POSIX-friendly alternative to the existing generic filesystem.setPermissions() function.filesystem.access(path, mode) to test file access permissions using POSIX access modes (0, 1, 2, and 4) — a POSIX-friendly alternative to the existing generic filesystem.getPermissions() function.filesystem.chown(path, uid, gid) to change user/group ownership of files and directories. This method has no effect on Windows.os.trashItem(path) to send a file or directory into the system trash container.home and desktop path name implementations to the os.getPath(name) function.<video> progress changes (seeking).os.setTray() implementation.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.
computer.setMousePosition(x, y) to update the current mouse cursor position.computer.setMouseGrabbing(grabbing: boolean) to activate/deactivate confining the mouse cursor within the native app window. If grabbing is set to true, the mouse cursor always stays within the window boundaries, so this feature helps create interactive games and similar apps operated using the mouse.computer.sendKey(keyCode, keyState) to simulate keyboard events. App developers can use a platform-specific key code and states (press, down, and up) 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
useTemplateIcon: bool option to os.setTray(options) for activating adaptive tray icon with the current color-scheme on macOS.os.showNotification() function when the app is launched from a Mac app bundle.window.focus() on macOS.windowMinimize, windowRestore, windowMaximize, windowFullScreenEnter, and windowFullScreenExitwindow.setBorderless(bool) to toggle borderless mode while the Neutralinojs app is running.modes.chrome.browserBinary option 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"
modes.window.useLogicalPixels: true|false option to activate DPI-aware sizing based on the operating system's display scale factor.${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 the os.getPath(name) function:"commandLinux": "${NL_OSDOWNLOADSPATH}/extensionBinary --load"
storage.clear() and storage.removeData(key) functions to remove saved storage data.window.getPosition() in macOS.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.
window.skipTaskbar boolean 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.window.openInspectorOnStartup boolean 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.NE_RT_NATRTER.Neutralino.window.print() to display the native print dialog on all platforms. This was especially added since the macOS webview doesn't implement the window.print() function.window.beginDrag() function to trigger native window dragging. The new draggable region API implementation uses this function internally.filesystem.getJoinedPath(...paths: string[]) to create a single path by joining multiple path strings.filesystem.getNormalizedPath() and filesystem.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.window.webviewArgs configuration option to pass additional browser arguments to the WebView2 instance on Windows:"modes": {
"window": {
// ....
"webviewArgs": "--user-agent=\"Custom user agent\""
}
}
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.
NL_LOCALE to get the user locale name, e.g., en_US.UTF-8NL_COMPDATA to 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}\\\"",
clipboard.writeHTML(html) and clipboard.readHTML() functions to write/read HTML stringsenvs key-value pair parameter to the options of the os.execCommand(command, options) function to set specific environment variables for the child process.os.spawnProcess(command, cwd) to os.spawnProcess(command, options) to set environment variables and the current working directory via the options object for the spawned child process:// e.g.:
await Neutralino.os.spawnCommand('env', {
cwd: NL_PATH,
envs: {
VAR1: 'var1',
VAR2: 'var2'
}
});
timestamp (ISO 8601) property to the watchFile event's data payload to identify when a specific file watcher event occurred.filesystem.setPermissions(path, permissions, mode) and filesystem.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...}
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.NL_TOKEN generation algorithm to strengthen security using the C++ std::mt19937 random number generator..tmp directory under restricted file manipulation permissions.os.showNotification() function.os.spawnProcess('./bin') crashed if bin output "ä\xA9ü")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');
NL_RESMODE is directory.resources.getStats(path) and resources.extractDirectory(path, destination) functions.window.snapshot(path) function to capture the window and save it as a PNG image file.window.getTitle() function on Windows.resources.extractFile() function.resources.neu files.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).
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).
dataLocation config option to let users set data directory for framework data storage purposes, such as saving window state, storing extracted resources, etc. If app (default) is used, the framework will store app data within the app directory and if system is 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 the NL_DATAPATH global variable.storageLocation config 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. If system is used, the framework will use the platform-specific standard data directory. In both app and system modes, the framework will use the .storage sub-directory for storage files.libwebkit2gtk-4.0-37 or libwebkit2gtk-4.1-0.getFiles(), extractFile(path, dest), readFile(path), and readBinaryFile(path) functions via the resources module for reading the files embedded in the resources.neu resources bundle. These functions works only if the framework loaded resources from the resource bundle -- they will throw NE_RS_APIRQRF if the framework loaded resources from the resources directory.minimize(), unminimize(), and isMinimized() functions to minimize and restore the native app window.clipboard.writeImage() function on Windows.window.exitProcessOnClose configuration option on Windows.window.isFullScreen() function on GNU/Linux-based platforms.os.spawnProcess() function.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.
temp key for the supported directory list of the os.getPath(pathKey) function.filesystem.getAbsolutePath(path) function to let developers get a full path string from a relative path string.filesystem.getRelativePath(path, ?base) function to get a relative path from a path and a base path.filesystem.getPathParts(path) to parse and get path segments like filename, extension, root path, etc.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
--single-page-serve, --enable-native-api and --document-root=<string>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.
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.defaultPath option in system file dialogs on Windows.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.
clipboard.readImage() and clipboard.writeImage(image) functions to work with clipboard image data.clipboard.clear() function to clear system clipboard.clipboard.getFormat() function to check the system clipboard data format. This function returns text, image, and unknown enum values based on existing data on the clipboard.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.app.writeProcessOutput and app.writeProcessError for sending string data to standard output and error streams accordingly.filesystem.createDirectory function.filesystem.copy, filesystem.move, and filesystem.remove functions.{recursive} options object to filesystem.readDirectory(path, options) activate recursive directory listing.os.execCommand function.NL_TOKEN) to connect to the Neutralinojs framework WebSocket server to receive app events.NL_ARCH global variable returns the same value that computer.getArch returns.filesystem.removeFile, filesystem.removeDirectory, filesystem.copyFile, and filesystem.moveFile functions.--nl-port, --nl-token, and --nl-extension-id as command-line arguments. Now the framework sends these via stdin as a JSON 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
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
MACOSX_DEPLOYMENT_TARGET=10.7filesystem.getWatchers function to get all created watchers.filesystem.updateOpenedFile(id, action, data) function. This function implements readBinary and readAllBinary actions and dataBinary output action in the openedFile global event.filesystem.createWatcher if there is an existing active watcher for the given path.os.execCommand(command, options) now supports cwd via the options object and os.spawnProcess(command, cwd) accepts currently working directory via the second string parameter.filesystem.openFile function.window method executions on non-window modes.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.
window.center to center the application window programmatically.modes.window.x and modes.window.y integer config props.modes.window.center boolean config props.--window-center=<true|false>, --window-x=<int> and --window-y=<int>WebView2Loader.dll file.In some scenarios, Neutralinojs app developers need to implement file watchers in their apps. Earlier, Neutralinojs API didn't offer a native file watcher API and developers had to use less-performant workarounds, such as making recursive filesystem.readDirectory calls. The new file watchers API lets you create native, cross-platform, event-based file watchers for filesystem paths with the following functions:
filesystem.createWatcher(path): Creates a new file watcher for a given path and returns the watcher identifier.filesystem.removeWatcher(watcherId): Removes a files watcher based on a file watcher identifier.Whenever a filesystem change occurs, file watcher instances dispatch the watchFile event with the following data:
id: Watcher identifieraction: Filesystem change: add, delete, modified, and moveddir: Directory pathfilename: Modified filearm64 (For Apple M1 and higher devices) and universal binaries with the GitHub workflow.neutralino.config.json file.arm64 systems.Neutralinojs typically stores the client library implementation in a separate file (neutralino.js). This approach makes Neutralinojs app development
process easier with a globally exposed JavaScript object, Neutralino. But, modern web developers use ES modules and they usually like to fetch dependencies from NPM. So, now, developers can load the __neutralino_globals.js internal script (i.e., <script src="__neutralino_globals.js"></script>) to load only globals. Then, they can use the client library implementation via neutralino.mjs with the neu CLI or from @neutralinojs/lib with a Node package manager.
Neutralinojs offers the extensions API to write custom backend code with any programming language, but extensions come with the following drawbacks that affect apps in several scenarios:
Alternatively, a developer can download the framework C++ code, modify it, and re-compile it. But, the developer may face issues while synching upstream code modifications. So, Neutralinojs offers a separate namespace, a function template, inbuilt helper functions (i.e., to get the window handler, validation, etc.), and a developer guide to add custom APIs to the Neutralinojs framework without updating the framework core.
Example:
let res = await Neutralino.custom.fetch('https://neutralino.js.org');
If developers make a custom API that others can use, we motivate them to contribute to the Neutralinojs framework by adding it to the main codebase.
Example:
let res = await Neutralino.net.fetch('https://neutralino.js.org');
If the developer adds a new custom method to the framework, the client library will automatically export it to the Neutralino.custom namespace by using the NL_CMETHODS internal global variable. The Neutralino.custom.getMethods function returns an array of custom methods similar to NL_CMETHODS.
The current Neutralinojs API offers non-stream-based (Promise-based but synchronous-like) functions for working with files. For example, the filesystem.readFile function reads the file content and retrieves data synchronously even though the WebSocket communication mechanism supports asynchronous patterns. However, the synchronous API lets developers work with files in a simple way, but they face the following issues in some scenarios:
To solve this issue, we offer an event-based file stream API with the following functions/events:
filesystem.openFile: Creates a file stream by opening a file.filesystem.updateOpenedFile: Triggers a file read/readAll event or sets the file cursor.filesystem.getOpenedFileInfo: Returns (awaited) information about the file stream (Props: id, eof, pos, and lastRead)openedFile: Occurs per each file read event and whenever the file stream reaches EOF.os.getEnv returns a value for a given environment variable key. Developers had to use alternative methods to retrieve a list of all environment variables with values. The os.getEnvs returns all environment variables as a JavaScript object similar to Node's process.env.
pos and size options for readFile and readBinaryFile methods to set the file cursor position and buffer size respectively.Added the storage.getKeys function to get an array of Neutralinojs storage keys. Now, developers don't need to write their own functions to retrieve storage keys with the filesystem API.
Returns the current mouse cursor position via a JavaScript object that has x and y props. This function is helpful for developing interactive desktop widgets on all supported platforms.
Earlier, we had the getMemoryInfo function in the computer namespace to retrieve system memory statistics. Now, we have added more functions to get details about the CPU, operating system, kernel, and connected displays:
computer.getArch: Returns the CPU architecture. i.e, x64, arm, etc.computer.getKernelInfo: Returns the operating system's kernel details.computer.getOSInfo: Returns the operating system details.computer.getCPUInfo: Returns the CPU details.computer.getDisplays: Returns an array of all connected displays with the resolution, frequency-like information.defaultPath option to showSaveDialog, showOpenDialog, and showFolderDialog functions to set the initial path/filename of system dialogs.armhf framework binary generation issue in the GitHub Actions workflow.--enable-automation flag to the config file if they need the particular command-line switch.We have os.execCommand for launching processes, but it's synchronous, meaning, the developer has to wait until process completion to receive pid, stdOut and stdErr. execCommand is not suitable for long-running processes. The new spawning API offers API functions for handling long-running processes in a multi-threaded way.
os.spawnProcess(command): Spawns a process and returns id (A virtual Neutralino-scoped pid) and pid (Operating system-level pid).os.getSpawnedProcesses(): Returns a list of spawned processes.os.updateSpawnedProcess(id, action, data): Sends an action event for the spawned process. Supports the following actions:
stdIn: Sends a string via the standard input stream. data is the input string.stdInEnd: Closes the standard input stream.exit: Terminates the spawned process.spawnedProcess: Dispatched when there is a change in the spawned process. CustomEvent gets triggered with the following object:{
id: <id>,
pid: <pid>,
action: <action>,
data: <data>
}
Available actions:
stdOut: Outputs standard output data. data contains the standard output payload.stdErr: Outputs standard error data. data contains the standard error payload.exit: Notified when the process terminates. data contains the process exit code.createdAt and modifiedAt JavaScript timestamps via the filesystem.getStats function..storage directory (Neutralinojs storage location) on Windows.index.html?v=2.0 is supported, but caching is not yet implemented.windowFocus and windowBlur native events.nightly version tag.NE_OS_TRAYIER from the os.setTray function for initialization failures.filesystem.writeBinaryFile function. This was fixed by using LF as the line breaker on all platforms as a portable solution. If the developer needs CRLF on Windows (or CR on Darwin), the developer needs to handle it explicitly with NL_OS.NL_COMMIT to hold framework's release commit. This is helpful to find the nightly release's code snapshot.window.getPosition to get the current window coordinates.filesystem.appendFile to append text content to a file. Thrown errors are similar to the filesystem.writeFile function.filesystem.appendBinaryFile to append binary content to a file. Thrown errors are similar to the filesystem.writeBinaryFile function.ayatana-appindicator3-0.1 instead of appindicator3-0.1 (Marked as obsolete in Debian packages)SetProcessDpiAwarenessContext function to support previous Windows versions.NE_RT_NATPRME error payload.tokenSecurity to the configuration to improve the security of NL_TOKEN. Accepted values are none and one-time. If none is set, Neutralinojs server will always expose NL_TOKEN for any application instance, so you can open Neutralinojs apps from browser directly. If one-time (recommended) is set, Neutralinojs server expose NL_TOKEN only once and client persists the token in sessionStorage, so all other clients that acces the app after the initial client will get an auth error message (Displayed to the user via HTML).window.setAlwaysOnTop(bool) was added.window.getSize was added.NL_EXTENABLED which returns true if extensions are enabled. It is used to check extensions status faster during initialization process.--chrome-width, --chrome-height, and --chrome-args.--neu-dev-extension to enable devtools connections (For internal usages with CLI).serverHeaders option.NL_RESMODE to get details about application resources source. Returns bundle if resources are loaded from resources.neu. Otherwise, returns directory.window.getTitle returns the current native window title.NE_OS_ENVNOEX from os.getEnv and return an empty string if environment variable is not defined.chrome mode.modes.chrome. Added height, width, and args specially for the chrome mode.shouldRunInBackground option to background.stdIn as an optional input.stdOut, stdErr, pid, and exitCode.extensions array globally or in a specific mode.extensions array.extension setting has 4 fields: id, command, commandLinux,commandDarwin, and commandWindows.command's (platform-specific command's) value accepts ${NL_PATH} global variable.--nl-port={}, --nl-extension-id={} and --nl-token={}enableExtensions config.documentRoot) via config. Now, it's possible to launch app without a subdirectory in the URL.Now developers can use Neutralinojs as a part of their software with any programming language by spawning Neutralinojs as a child process.
Use exportAuthInfo to write auth details to ${NL_PATH}/.tmp/auth_info.json. Then the parent process can pickup access details there. Note that WebSocket communication needs to be initiated via extensions API/loader.
dispatch: Sends an event to a specific extension.broadcast: Sends an event to all connected extensions. Useful for sending shutdown signals.getStats: Returns details about loaded extensions and connected extensions.checkForUpdates: Send a request to a seed URL (JSON) and fetch update details.install: Install updates based on the currently downloaded manifest.appClientConnect and appClientDisconnect: Occurs when a new app instance is launched and closed respectively.extClientConnect and extClientDisconnect: Occurs when a new extension is connected and disconnected respectively.extensionReady can be used to implement immediate extension calls. This is implemented from the client-side with extensions.getStats and extClientConnect. This event guarantees that it will be triggered regardless of the extension's start time.NE_EX_EXTNOTC: Thrown by extensions.dispatch if the target extension is not connected.NE_UP_CUPDMER: Thrown by updater.checkForUpdates if the JSON update manifest is invalid or applicationId is not matching.NE_UP_CUPDERR: Thrown by updater.checkForUpdates if the updater API cannot fetch the manifest.NE_UP_UPDNOUF: Thrown by updater.install when the update manifest is not loaded.NE_UP_UPDINER: Thrown by updater.install for update installation errors.NL_PORT also becomes 0.writeToLogFile config option. Earlier, the log file was created even this
option is set to false.NL_APPVERSION: Value of the version key in the config file.此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。