Releases: neutralinojs/neutralinojs
Neutralinojs nightly release
What's new
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.
Update the config file option cli.binaryVersion
with nightly
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v6.1.0 released!
What's new
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_LOCALE
to get the user locale name, e.g.,en_US.UTF-8
- Add
NL_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_CONPILERNAME}\\\"",
Update the config file option cli.binaryVersion
with 6.1.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v6.0.0 released!
What's new
API: clipboard
- Implement
clipboard.writeHTML(html)
andclipboard.readHTML()
functions to write/read HTML strings
API: os
- Adding
envs
key-value pair parameter to theoptions
of 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 theoptions
object 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 thewatchFile
event'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_TOKEN
generation algorithm to strengthen security using the C++std::mt19937
random number generator.
Improvements/bugfixes
- Fix framework crashing when creating the
.tmp
directory 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 ifbin
output"ä\xA9ü"
)
Update the config file option cli.binaryVersion
with 6.0.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v5.6.0 released!
What's new
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_RESMODE
isdirectory
. - 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.neu
files.
DevOps
- Fix minor string formatting issues in the BuildZri automation script.
- Fix various test suite failure scenarios.
Update the config file option cli.binaryVersion
with 5.6.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v5.5.0 released!
What's new
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
dataLocation
config 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 ifsystem
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 theNL_DATAPATH
global variable. - Implement the
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. Ifsystem
is used, the framework will use the platform-specific standard data directory. In bothapp
andsystem
modes, the framework will use the.storage
sub-directory for storage files.
Improvements/bugfixes
- Search and load WebKitGtk functions dynamically from the available webkit2gtk library:
libwebkit2gtk-4.0-37
orlibwebkit2gtk-4.1-0
. - Fix the auto-reload issue during app development.
Update the config file option cli.binaryVersion
with 5.5.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v5.4.0 released!
What's new
API: resources
- Implement
getFiles()
,extractFile(path, dest)
,readFile(path)
, andreadBinaryFile(path)
functions via theresources
module for reading the files embedded in theresources.neu
resources bundle. These functions works only if the framework loaded resources from the resource bundle -- they will throwNE_RS_APIRQRF
if 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.exitProcessOnClose
configuration 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.
Update the config file option cli.binaryVersion
with 5.4.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v5.3.0 released!
What's new
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
temp
key 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
Update the config file option cli.binaryVersion
with 5.3.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v5.2.0 released!
What's new
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-api
and--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
defaultPath
option in system file dialogs on Windows.
Update the config file option cli.binaryVersion
with 5.2.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v5.1.0 released!
What's new
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
, andunknown
enum values based on existing data on the clipboard.
Update the config file option cli.binaryVersion
with 5.1.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀
Neutralinojs v5.0.0 released!
What's new
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.writeProcessOutput
andapp.writeProcessError
for sending string data to standard output and error streams accordingly.
API: filesystem
- Enable default recursive behavior in the
filesystem.createDirectory
function. - Add
filesystem.copy
,filesystem.move
, andfilesystem.remove
functions. - Add
{recursive}
options object tofilesystem.readDirectory(path, options)
activate recursive directory listing.
API: os
- Accept stdin with the background mode of the
os.execCommand
function.
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_ARCH
global variable returns the same value thatcomputer.getArch
returns.
Deprecations
- Removed
filesystem.removeFile
,filesystem.removeDirectory
,filesystem.copyFile
, andfilesystem.moveFile
functions. - Extensions won't receive
--nl-port
,--nl-token
, and--nl-extension-id
as command-line arguments. Now the framework sends these via stdin as a JSON string.
Update the config file option cli.binaryVersion
with 5.0.0
and enter neu update
to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀