You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constructs a Unix-like path from a Windows path for cross-platform usage by replacing `\\` with `/`. This function only works on Windows and returns the same input
460
+
string on non-Windows platforms.
461
+
462
+
### Parameters
463
+
464
+
-`path` String: Windows-specific path.
465
+
466
+
### Return String (awaited):
467
+
Unix-like path.
468
+
469
+
```js
470
+
let path =awaitNeutralino.filesystem.getNormalizedPath('.\\myFolder\\main.js');
471
+
console.log(path); // `./myFolder/main.js`
472
+
```
473
+
474
+
## filesystem.getUnnormalizedPAth(path)
475
+
Reverts a Unix-like path created with `filesystem.getNormalizedPath(path)` to a Windows-specific path by replacing `/` with `\\`. This function only works on Windows
476
+
and returns the same input string on non-Windows platforms.
477
+
478
+
### Parameters
479
+
480
+
-`path` String: Unix-like path.
481
+
482
+
### Return String (awaited):
483
+
Windows-specific path.
484
+
485
+
```js
486
+
let path =awaitNeutralino.filesystem.getUnnormalizedPath('./myFolder/main.js');
Copy file name to clipboardExpand all lines: docs/api/window.md
+35-4Lines changed: 35 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,16 +184,31 @@ Converts a given DOM element to a draggable region. The user will be able to dra
184
184
185
185
### DraggableRegionOptions
186
186
187
-
-`alwaysCapture` Boolean (optional): If set to `true`, the region will always capture the pointer, ensuring that dragging is not interrupted when moving the pointer quickly. Note that it prevents child elements from receiving any pointer events. Defaults to `false`.
188
-
-`dragMinDistance` Number (optional): The minimum distance between cursor's starting and current position after which dragging is started. This helps prevent accidental dragging while interacting with child elements. Defaults to `10` and is measured in CSS pixels.
187
+
-`exclusions` String[] | HTMLElement[] (optional): DOM element identifiers that should be excluded from the draggable region surface, i.e., window control buttons
188
+
189
+
190
+
### Return Object (awaited):
191
+
-`exclusions` DraggableRegionExclusions: Add or remove draggable region exclusions.
192
+
193
+
### DraggableRegionExclusions
194
+
195
+
-`add(...domIds: String | HTMLElement)`: Add new elements to exclusions.
196
+
-`remove(...domIds: String | HTMLElement)`: Remove elements from exclusions.
Displays the native print dialog for the current page. Developers can use this function instead of the built-in web `window.print()` function as a cross-platform solution
396
+
since macOS webview doesn't pre-implement `window.print()`.
397
+
398
+
```js
399
+
awaitNeutralino.window.print();
400
+
```
401
+
402
+
## window.beginDrag()
403
+
Starts dragging the native window if the left mouse button is pressed. The draggable region API in the Neutralinojs client library uses this function internally to move
Copy file name to clipboardExpand all lines: docs/configuration/neutralino.config.json.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -316,6 +316,10 @@ the client library manually via the `neutralino.js` file or from the `@neutralin
316
316
Injects a preload JavaScript file to the webview instance from the app bundle. This script file will be executed before webapp resources and after `window.injectGlobals`
317
317
and `window.injectClientLibrary` scripts, so you can write initialization scripts using Neutralinojs API within this source file.
318
318
319
+
### `modes.window.webviewArgs: string`
320
+
Additional browser arguments (i.e., `--user-agent=<string>`) for the WebView2 instance on Windows. See all supported arguments from the official
Copy file name to clipboardExpand all lines: docs/release-notes/client-library.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,39 @@ toc_max_heading_level: 2
5
5
6
6
## Unreleased
7
7
8
+
## v6.2.0
9
+
10
+
### API: draggable region API
11
+
The new draggable region API implementation uses native, platform-specific window dragging event via the `window.beginDrag()` function, so now draggable regions behave the same as native window dragging with features such as window snapping, unlike the previous draggable region implementation.
12
+
13
+
The new draggable region API lets developers exclude specific elements (i.e., window control buttons) from the registered draggable region DOM element:
Copy file name to clipboardExpand all lines: docs/release-notes/framework.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,30 @@ toc_max_heading_level: 2
5
5
6
6
## Unreleased
7
7
8
+
## v6.2.0
9
+
10
+
### API: window
11
+
- Add `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.
12
+
- Introduce the `window.beginDrag()` function to trigger native window dragging. The new draggable region API implementation uses this function internally.
13
+
14
+
### API: filesystem
15
+
- Add `filesystem.getJoinedPath(...paths: string[])` to create a single path by joining multiple path strings.
16
+
- Add `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.
17
+
18
+
### Configuration
19
+
- Implement the `window.webviewArgs` configuration option to pass additional browser arguments to the WebView2 instance on Windows:
20
+
```js
21
+
"modes": {
22
+
"window": {
23
+
// ....
24
+
"webviewArgs":"--user-agent=\"Custom user agent\""
25
+
}
26
+
}
27
+
```
28
+
29
+
### Improvements/bugfixes
30
+
- 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.
0 commit comments