@noldova/desktop.electron 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.d.ts +253 -32
- package/api/index.js +1 -0
- package/api/index.js.map +1 -1
- package/interfaces/i-frame-navigation.js +9 -0
- package/interfaces/i-frame-navigation.js.map +1 -0
- package/models/feed-source.js +4 -2
- package/models/feed-source.js.map +1 -1
- package/models/web-view-history.js +19 -0
- package/models/web-view-history.js.map +1 -0
- package/package.json +10 -4
- package/preload.cjs +7 -0
- package/preload.cjs.map +1 -1
- package/resources.js +122 -1
- package/resources.js.map +1 -1
- package/services/electron-web-view-contents.js +10 -0
- package/services/electron-web-view-contents.js.map +1 -1
- package/services/electron-web-view-engine.js +3 -2
- package/services/electron-web-view-engine.js.map +1 -1
- package/services/electron-web-view-session.js +19 -0
- package/services/electron-web-view-session.js.map +1 -1
- package/services/feed-provider.js +4 -3
- package/services/feed-provider.js.map +1 -1
- package/services/feed-updater.js +7 -4
- package/services/feed-updater.js.map +1 -1
- package/services/ipc-router.js +12 -0
- package/services/ipc-router.js.map +1 -1
- package/services/main-process-log.js +9 -7
- package/services/main-process-log.js.map +1 -1
- package/services/main-process-recovery.js +1 -0
- package/services/main-process-recovery.js.map +1 -1
- package/services/main-process.js +17 -2
- package/services/main-process.js.map +1 -1
- package/services/open-web-view.js +213 -33
- package/services/open-web-view.js.map +1 -1
- package/services/runtime-events.js +4 -0
- package/services/runtime-events.js.map +1 -1
- package/services/shown-file-policy.js.map +1 -1
- package/services/squirrel-handoff.js +1 -1
- package/services/squirrel-handoff.js.map +1 -1
- package/services/update-controller.js +2 -2
- package/services/update-controller.js.map +1 -1
- package/services/web-view-attach-guard.js +5 -2
- package/services/web-view-attach-guard.js.map +1 -1
- package/services/web-view-bridge.js +40 -2
- package/services/web-view-bridge.js.map +1 -1
- package/services/web-view-favicon.js +115 -0
- package/services/web-view-favicon.js.map +1 -0
- package/services/web-view-host.js +70 -6
- package/services/web-view-host.js.map +1 -1
- package/services/web-view-origin-check.js +32 -25
- package/services/web-view-origin-check.js.map +1 -1
- package/services/open-web-view.resources.js +0 -13
- package/services/open-web-view.resources.js.map +0 -1
- package/services/web-view-origin-check.resources.js +0 -46
- package/services/web-view-origin-check.resources.js.map +0 -1
package/api/index.d.ts
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
/// <reference types="node" />
|
|
10
|
+
|
|
9
11
|
import type { Stats } from "node:fs";
|
|
10
12
|
import type { Writable } from "node:stream";
|
|
11
13
|
|
|
12
14
|
import type {
|
|
13
|
-
AppDetailsOptions, BrowserWindowConstructorOptions, CustomScheme, MenuItemConstructorOptions, MessageBoxOptions, MessageBoxReturnValue, NotificationConstructorOptions, OpenDialogOptions,
|
|
15
|
+
AppDetailsOptions, BrowserWindowConstructorOptions, CustomScheme, MenuItemConstructorOptions, MessageBoxOptions, MessageBoxReturnValue, NavigationEntry, NotificationConstructorOptions, OpenDialogOptions,
|
|
14
16
|
OpenDialogReturnValue, Rectangle, RenderProcessGoneDetails, SaveDialogOptions, SaveDialogReturnValue, TitleBarOverlayOptions, WindowOpenHandlerResponse
|
|
15
17
|
} from "electron";
|
|
16
18
|
import { type CancellationToken, type Logger, type ProgressInfo, Provider, type ResolvedUpdateFileInfo, type UpdateInfo } from "electron-updater";
|
|
@@ -2106,6 +2108,21 @@ export interface IPreventableEvent {
|
|
|
2106
2108
|
preventDefault(): void;
|
|
2107
2109
|
}
|
|
2108
2110
|
|
|
2111
|
+
/**
|
|
2112
|
+
* A frame about to navigate, as Electron's `will-frame-navigate` event describes it, which a listener may cancel.
|
|
2113
|
+
*/
|
|
2114
|
+
export interface IFrameNavigation extends IPreventableEvent {
|
|
2115
|
+
/**
|
|
2116
|
+
* The address the frame navigates to.
|
|
2117
|
+
*/
|
|
2118
|
+
readonly url: string;
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* Whether the page's own frame navigates, rather than one of its frames.
|
|
2122
|
+
*/
|
|
2123
|
+
readonly isMainFrame: boolean;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2109
2126
|
/**
|
|
2110
2127
|
* The frame an IPC message came from.
|
|
2111
2128
|
*/
|
|
@@ -2134,6 +2151,11 @@ export interface IIpcEvent {
|
|
|
2134
2151
|
* The sending frame; `null` when it is gone.
|
|
2135
2152
|
*/
|
|
2136
2153
|
readonly senderFrame: ISenderFrame | null;
|
|
2154
|
+
|
|
2155
|
+
/**
|
|
2156
|
+
* The answer to a synchronous message, which the sender waits for.
|
|
2157
|
+
*/
|
|
2158
|
+
returnValue?: unknown;
|
|
2137
2159
|
}
|
|
2138
2160
|
|
|
2139
2161
|
/**
|
|
@@ -2968,10 +2990,13 @@ export interface IWebViewEngine {
|
|
|
2968
2990
|
findGuest(contentsId: number): IWebViewGuest | null;
|
|
2969
2991
|
|
|
2970
2992
|
/**
|
|
2971
|
-
* Judges every `<webview>` before it attaches: a page's own is refused, and a window's only when its partition is one the window may use
|
|
2993
|
+
* Judges every `<webview>` before it attaches: a page's own is refused, and a window's only when its partition is one the window may use; an allowed one starts at `about:blank`, whatever address the element carries, such as the page's own once the element moves in the window, unless `claim` takes it, and runs sandboxed and context-isolated, without a preload, Node.js or nested views.
|
|
2994
|
+
* A claimed one loads no page, so the view it replaces can restore its history in it, and `attached` gets its page once it attaches.
|
|
2972
2995
|
*
|
|
2973
2996
|
* @param isAllowed Says whether a window may use a partition.
|
|
2974
2997
|
* @param log Writes a line to the main process's log for each refused `<webview>`.
|
|
2998
|
+
* @param claim Says whether a view of the window with that partition takes the allowed `<webview>` to restore its page in; none does when omitted.
|
|
2999
|
+
* @param attached Gets the page of each allowed `<webview>` of a window as it attaches, right after `claim` judged it.
|
|
2975
3000
|
* @example
|
|
2976
3001
|
* ```ts
|
|
2977
3002
|
* import type { IWebViewEngine } from "@noldova/desktop.electron";
|
|
@@ -2981,7 +3006,8 @@ export interface IWebViewEngine {
|
|
|
2981
3006
|
* }
|
|
2982
3007
|
* ```
|
|
2983
3008
|
*/
|
|
2984
|
-
watchAttach(isAllowed: (windowId: number, partition: string) => boolean, log: (text: string) => void
|
|
3009
|
+
watchAttach(isAllowed: (windowId: number, partition: string) => boolean, log: (text: string) => void,
|
|
3010
|
+
claim?: (windowId: number, partition: string) => boolean, attached?: (windowId: number, contents: IWebViewContents) => void): void;
|
|
2985
3011
|
|
|
2986
3012
|
/**
|
|
2987
3013
|
* Reads a clock that only moves forward, for how long ago a view last had the person's input.
|
|
@@ -3029,6 +3055,12 @@ export interface IWindowOpenDetails {
|
|
|
3029
3055
|
* The referrer the engine would send with it; its address is empty when the page sends none.
|
|
3030
3056
|
*/
|
|
3031
3057
|
readonly referrer: { readonly url: string };
|
|
3058
|
+
|
|
3059
|
+
/**
|
|
3060
|
+
* How the engine would open it: `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
|
|
3061
|
+
* Electron always gives it; without it, the request's event carries none.
|
|
3062
|
+
*/
|
|
3063
|
+
readonly disposition?: string;
|
|
3032
3064
|
}
|
|
3033
3065
|
|
|
3034
3066
|
/**
|
|
@@ -3061,6 +3093,39 @@ export interface IWebViewKeyEvent {
|
|
|
3061
3093
|
readonly modifiers: readonly string[];
|
|
3062
3094
|
}
|
|
3063
3095
|
|
|
3096
|
+
/**
|
|
3097
|
+
* A page's history, as a `<webview>` page restores it on a page that hasn't loaded yet: each entry's address, title and Chromium page state, with its form values and scroll position.
|
|
3098
|
+
*/
|
|
3099
|
+
export declare class WebViewHistory {
|
|
3100
|
+
/**
|
|
3101
|
+
* The entries, oldest first, copied from those the history was given.
|
|
3102
|
+
*/
|
|
3103
|
+
public readonly entries: readonly NavigationEntry[];
|
|
3104
|
+
/**
|
|
3105
|
+
* The current entry's index.
|
|
3106
|
+
*/
|
|
3107
|
+
public readonly index: number;
|
|
3108
|
+
|
|
3109
|
+
/**
|
|
3110
|
+
* Creates the history.
|
|
3111
|
+
*
|
|
3112
|
+
* @param entries The entries, oldest first; the history keeps its own copy.
|
|
3113
|
+
* @param index The current entry's index.
|
|
3114
|
+
* @example
|
|
3115
|
+
* ```ts
|
|
3116
|
+
* import { WebViewHistory } from "@noldova/desktop.electron";
|
|
3117
|
+
*
|
|
3118
|
+
* export const history: WebViewHistory = new WebViewHistory([{ url: "https://example.com/", title: "Example" }], 0);
|
|
3119
|
+
* ```
|
|
3120
|
+
*/
|
|
3121
|
+
public constructor(entries: readonly NavigationEntry[], index: number);
|
|
3122
|
+
|
|
3123
|
+
/**
|
|
3124
|
+
* The current entry's address, or `null` when the index is outside the entries.
|
|
3125
|
+
*/
|
|
3126
|
+
public get currentUrl(): string | null;
|
|
3127
|
+
}
|
|
3128
|
+
|
|
3064
3129
|
/**
|
|
3065
3130
|
* A `<webview>` page a window holds, as the engine finds it.
|
|
3066
3131
|
*/
|
|
@@ -3177,6 +3242,37 @@ export interface IWebViewContents {
|
|
|
3177
3242
|
*/
|
|
3178
3243
|
readHistoryEntry(offset: number): string | null;
|
|
3179
3244
|
|
|
3245
|
+
/**
|
|
3246
|
+
* Reads the page's history with each entry's page state, as Chromium last stored it, for a page that replaces this one to restore.
|
|
3247
|
+
*
|
|
3248
|
+
* @returns The entries and the current one's index.
|
|
3249
|
+
* @example
|
|
3250
|
+
* ```ts
|
|
3251
|
+
* import type { IWebViewContents, WebViewHistory } from "@noldova/desktop.electron";
|
|
3252
|
+
*
|
|
3253
|
+
* export function keep(contents: IWebViewContents): WebViewHistory {
|
|
3254
|
+
* return contents.readHistory();
|
|
3255
|
+
* }
|
|
3256
|
+
* ```
|
|
3257
|
+
*/
|
|
3258
|
+
readHistory(): WebViewHistory;
|
|
3259
|
+
|
|
3260
|
+
/**
|
|
3261
|
+
* Restores a history another page read and loads its current entry, with the entry's form values and scroll position; the page must not have loaded any page before.
|
|
3262
|
+
*
|
|
3263
|
+
* @param history The history to restore.
|
|
3264
|
+
* @returns A promise that settles once the entry has loaded, and rejects when it fails to load.
|
|
3265
|
+
* @example
|
|
3266
|
+
* ```ts
|
|
3267
|
+
* import type { IWebViewContents, WebViewHistory } from "@noldova/desktop.electron";
|
|
3268
|
+
*
|
|
3269
|
+
* export async function resume(contents: IWebViewContents, history: WebViewHistory): Promise<void> {
|
|
3270
|
+
* await contents.restoreHistoryAsync(history);
|
|
3271
|
+
* }
|
|
3272
|
+
* ```
|
|
3273
|
+
*/
|
|
3274
|
+
restoreHistoryAsync(history: WebViewHistory): Promise<void>;
|
|
3275
|
+
|
|
3180
3276
|
/**
|
|
3181
3277
|
* Moves back one entry in the history.
|
|
3182
3278
|
*/
|
|
@@ -3264,25 +3360,54 @@ export interface IWebViewContents {
|
|
|
3264
3360
|
*/
|
|
3265
3361
|
insertText(text: string): Promise<void>;
|
|
3266
3362
|
|
|
3363
|
+
/**
|
|
3364
|
+
* Runs scripts in an isolated world of the page's main frame, which the page's own scripts can't reach.
|
|
3365
|
+
*
|
|
3366
|
+
* @param worldId The isolated world's id.
|
|
3367
|
+
* @param scripts The scripts to run, in order.
|
|
3368
|
+
* @returns A promise that settles with the last script's result once the page's renderer has run them.
|
|
3369
|
+
*/
|
|
3370
|
+
executeJavaScriptInIsolatedWorld(worldId: number, scripts: { code: string }[]): Promise<unknown>;
|
|
3371
|
+
|
|
3267
3372
|
/**
|
|
3268
3373
|
* Listens for a frame about to navigate, which the listener may cancel.
|
|
3269
3374
|
*
|
|
3270
3375
|
* @param event The event's name.
|
|
3271
|
-
* @param listener Receives the cancellable
|
|
3376
|
+
* @param listener Receives the cancellable navigation, with its address and whether the page's own frame navigates.
|
|
3272
3377
|
* @returns Electron's own return value, which the main process does not use.
|
|
3273
3378
|
* @example
|
|
3274
3379
|
* ```ts
|
|
3275
3380
|
* import type { IWebViewContents } from "@noldova/desktop.electron";
|
|
3276
3381
|
*
|
|
3277
3382
|
* export function stayOnOrigin(contents: IWebViewContents, origin: string): void {
|
|
3278
|
-
* contents.on("will-frame-navigate",
|
|
3279
|
-
* if (URL.parse(url)?.origin !== origin)
|
|
3280
|
-
*
|
|
3383
|
+
* contents.on("will-frame-navigate", t => {
|
|
3384
|
+
* if (t.isMainFrame && URL.parse(t.url)?.origin !== origin)
|
|
3385
|
+
* t.preventDefault();
|
|
3281
3386
|
* });
|
|
3282
3387
|
* }
|
|
3283
3388
|
* ```
|
|
3284
3389
|
*/
|
|
3285
|
-
on(event: "will-frame-navigate", listener: (
|
|
3390
|
+
on(event: "will-frame-navigate", listener: (navigation: IFrameNavigation) => void): unknown;
|
|
3391
|
+
|
|
3392
|
+
/**
|
|
3393
|
+
* Listens for a navigation starting in the page or in one of its frames, including one the engine refuses itself before any check, such as the page's own `about:srcdoc`.
|
|
3394
|
+
*
|
|
3395
|
+
* @param event The event's name.
|
|
3396
|
+
* @param listener Receives the navigation, which says whether the page itself starts it.
|
|
3397
|
+
* @returns Electron's own return value, which the main process does not use.
|
|
3398
|
+
* @example
|
|
3399
|
+
* ```ts
|
|
3400
|
+
* import type { IWebViewContents } from "@noldova/desktop.electron";
|
|
3401
|
+
*
|
|
3402
|
+
* export function count(contents: IWebViewContents, starts: { count: number }): void {
|
|
3403
|
+
* contents.on("did-start-navigation", t => {
|
|
3404
|
+
* if (t.isMainFrame)
|
|
3405
|
+
* starts.count++;
|
|
3406
|
+
* });
|
|
3407
|
+
* }
|
|
3408
|
+
* ```
|
|
3409
|
+
*/
|
|
3410
|
+
on(event: "did-start-navigation", listener: (navigation: IWindowNavigation) => void): unknown;
|
|
3286
3411
|
|
|
3287
3412
|
/**
|
|
3288
3413
|
* Listens for a webview being attached to the page, which the listener may cancel.
|
|
@@ -3382,6 +3507,15 @@ export interface IWebViewContents {
|
|
|
3382
3507
|
* @returns Electron's own return value, which the main process does not use.
|
|
3383
3508
|
*/
|
|
3384
3509
|
on(event: "zoom-changed", listener: (event: unknown, direction: string) => void): unknown;
|
|
3510
|
+
|
|
3511
|
+
/**
|
|
3512
|
+
* Listens for the page naming its icons, after a navigation or when it changes them.
|
|
3513
|
+
*
|
|
3514
|
+
* @param event The event's name.
|
|
3515
|
+
* @param listener Receives Electron's event and the icons' addresses, in the page's order.
|
|
3516
|
+
* @returns Electron's own return value, which the main process does not use.
|
|
3517
|
+
*/
|
|
3518
|
+
on(event: "page-favicon-updated", listener: (event: unknown, favicons: string[]) => void): unknown;
|
|
3385
3519
|
}
|
|
3386
3520
|
|
|
3387
3521
|
/**
|
|
@@ -3547,6 +3681,24 @@ export interface IWebViewSession {
|
|
|
3547
3681
|
*/
|
|
3548
3682
|
resolveHostAsync(host: string): Promise<readonly string[]>;
|
|
3549
3683
|
|
|
3684
|
+
/**
|
|
3685
|
+
* Fetches a page's icon in the session, with its cookies and cache, without following a redirect; the session's own request checks still judge the request.
|
|
3686
|
+
*
|
|
3687
|
+
* @param url The icon's address.
|
|
3688
|
+
* @param byteLimit The most bytes it reads.
|
|
3689
|
+
* @param signal Stops the request and the read when it aborts.
|
|
3690
|
+
* @returns The icon's bytes, or null when the answer isn't a success or holds more than `byteLimit` bytes; it rejects when the request fails or `signal` aborts.
|
|
3691
|
+
* @example
|
|
3692
|
+
* ```ts
|
|
3693
|
+
* import type { IWebViewSession } from "@noldova/desktop.electron";
|
|
3694
|
+
*
|
|
3695
|
+
* export function readIconAsync(session: IWebViewSession): Promise<Uint8Array | null> {
|
|
3696
|
+
* return session.readIconAsync("https://example.com/favicon.ico", 1_048_576, AbortSignal.timeout(10_000));
|
|
3697
|
+
* }
|
|
3698
|
+
* ```
|
|
3699
|
+
*/
|
|
3700
|
+
readIconAsync(url: string, byteLimit: number, signal: AbortSignal): Promise<Uint8Array | null>;
|
|
3701
|
+
|
|
3550
3702
|
/**
|
|
3551
3703
|
* Clears the session's cookies, storage and cache.
|
|
3552
3704
|
*
|
|
@@ -4395,6 +4547,22 @@ export interface IMainProcessLog {
|
|
|
4395
4547
|
* ```
|
|
4396
4548
|
*/
|
|
4397
4549
|
write(text: string): void;
|
|
4550
|
+
|
|
4551
|
+
/**
|
|
4552
|
+
* Writes every line still waiting at once, before the main process exits.
|
|
4553
|
+
*
|
|
4554
|
+
* @example
|
|
4555
|
+
* ```ts
|
|
4556
|
+
* import type { IMainProcessLog } from "@noldova/desktop.electron";
|
|
4557
|
+
*
|
|
4558
|
+
* export function recordAndExit(log: IMainProcessLog, exit: () => void): void {
|
|
4559
|
+
* log.write("The main process is exiting.");
|
|
4560
|
+
* log.flush();
|
|
4561
|
+
* exit();
|
|
4562
|
+
* }
|
|
4563
|
+
* ```
|
|
4564
|
+
*/
|
|
4565
|
+
flush(): void;
|
|
4398
4566
|
}
|
|
4399
4567
|
|
|
4400
4568
|
/**
|
|
@@ -7106,15 +7274,16 @@ export declare class WebViewOriginCheck {
|
|
|
7106
7274
|
*
|
|
7107
7275
|
* @param localOrigins The origins the app's settings mark as local addresses, which may connect to a loopback or private address; none by
|
|
7108
7276
|
* default.
|
|
7109
|
-
* @param neverAllowedPorts The loopback ports of the app's own endpoints, refused even when an allowed origin names them
|
|
7277
|
+
* @param neverAllowedPorts The loopback ports of the app's own endpoints, refused even when an allowed origin names them, or a function
|
|
7278
|
+
* read at each check that answers them, or `null` while they are unknown, when every loopback port is refused; none by default.
|
|
7110
7279
|
* @example
|
|
7111
7280
|
* ```ts
|
|
7112
7281
|
* import { WebViewOriginCheck } from "@noldova/desktop.electron";
|
|
7113
7282
|
*
|
|
7114
|
-
* export const check: WebViewOriginCheck = new WebViewOriginCheck([], [4600]);
|
|
7283
|
+
* export const check: WebViewOriginCheck = new WebViewOriginCheck([], () => new Set([4600]));
|
|
7115
7284
|
* ```
|
|
7116
7285
|
*/
|
|
7117
|
-
public constructor(localOrigins?: readonly string[], neverAllowedPorts?: readonly number[]);
|
|
7286
|
+
public constructor(localOrigins?: readonly string[], neverAllowedPorts?: readonly number[] | (() => ReadonlySet<number> | null));
|
|
7118
7287
|
|
|
7119
7288
|
/**
|
|
7120
7289
|
* Classifies an IP address, judging an IPv6 address that carries an IPv4 address, IPv4-mapped, IPv4-compatible or NAT64, as that IPv4
|
|
@@ -8023,11 +8192,6 @@ export interface IUpdateSetup {
|
|
|
8023
8192
|
* Checks for a newer version and downloads it.
|
|
8024
8193
|
*/
|
|
8025
8194
|
export interface IUpdater {
|
|
8026
|
-
/**
|
|
8027
|
-
* The only file a download may give: the target's package in the updater's cache for the installation.
|
|
8028
|
-
*/
|
|
8029
|
-
readonly packagePath: string;
|
|
8030
|
-
|
|
8031
8195
|
/**
|
|
8032
8196
|
* The file the last download in this process gave, or `null` before one has and while a download runs.
|
|
8033
8197
|
*/
|
|
@@ -8052,6 +8216,8 @@ export interface IUpdater {
|
|
|
8052
8216
|
/**
|
|
8053
8217
|
* Downloads the version the last check found and checks it against the release.
|
|
8054
8218
|
*
|
|
8219
|
+
* @param version The version the last check found, which names the only file the download may give,
|
|
8220
|
+
* {@link IUpdater.formatPackagePath}.
|
|
8055
8221
|
* @param onProgress Receives the progress as a whole percentage.
|
|
8056
8222
|
* @returns A promise of the downloaded file; it rejects with an {@link UpdateException} that gives the reason.
|
|
8057
8223
|
* @example
|
|
@@ -8059,11 +8225,28 @@ export interface IUpdater {
|
|
|
8059
8225
|
* import type { IUpdater } from "@noldova/desktop.electron";
|
|
8060
8226
|
*
|
|
8061
8227
|
* export function downloadAsync(updater: IUpdater): Promise<string> {
|
|
8062
|
-
* return updater.downloadAsync(t => console.log(`${t}%`));
|
|
8228
|
+
* return updater.downloadAsync("1.3.0", t => console.log(`${t}%`));
|
|
8063
8229
|
* }
|
|
8064
8230
|
* ```
|
|
8065
8231
|
*/
|
|
8066
|
-
downloadAsync(onProgress: (percent: number) => void): Promise<string>;
|
|
8232
|
+
downloadAsync(version: string, onProgress: (percent: number) => void): Promise<string>;
|
|
8233
|
+
|
|
8234
|
+
/**
|
|
8235
|
+
* Gives the only file a download of a version may give: the version's released package in the updater's cache for
|
|
8236
|
+
* the installation.
|
|
8237
|
+
*
|
|
8238
|
+
* @param version The version.
|
|
8239
|
+
* @returns The package's path.
|
|
8240
|
+
* @example
|
|
8241
|
+
* ```ts
|
|
8242
|
+
* import type { IUpdater } from "@noldova/desktop.electron";
|
|
8243
|
+
*
|
|
8244
|
+
* export function isPackage(updater: IUpdater, file: string): boolean {
|
|
8245
|
+
* return file === updater.formatPackagePath("1.3.0");
|
|
8246
|
+
* }
|
|
8247
|
+
* ```
|
|
8248
|
+
*/
|
|
8249
|
+
formatPackagePath(version: string): string;
|
|
8067
8250
|
|
|
8068
8251
|
/**
|
|
8069
8252
|
* Cancels the download in progress, if any.
|
|
@@ -8599,7 +8782,8 @@ export declare class FeedSource {
|
|
|
8599
8782
|
*/
|
|
8600
8783
|
public readonly channelFile: string;
|
|
8601
8784
|
/**
|
|
8602
|
-
* The package
|
|
8785
|
+
* The package's name without a version, `<product>-<platform>-<arch>.<ext>`, which a feed whose files carry no version
|
|
8786
|
+
* lists for every version.
|
|
8603
8787
|
*/
|
|
8604
8788
|
public readonly packageFile: string;
|
|
8605
8789
|
/**
|
|
@@ -8611,24 +8795,33 @@ export declare class FeedSource {
|
|
|
8611
8795
|
* given another.
|
|
8612
8796
|
*/
|
|
8613
8797
|
public readonly timeout: (milliseconds: number) => AbortSignal;
|
|
8798
|
+
/**
|
|
8799
|
+
* Names the package of a version as the update information lists it and the feed serves it,
|
|
8800
|
+
* `<product>-<version>-<platform>-<arch>.<ext>` for a source {@link FeedSource.create} makes.
|
|
8801
|
+
*/
|
|
8802
|
+
public readonly formatReleasedFile: (version: string) => string;
|
|
8614
8803
|
|
|
8615
8804
|
/**
|
|
8616
8805
|
* Creates the source.
|
|
8617
8806
|
*
|
|
8618
8807
|
* @param feed The feed's URL, ending in `/`.
|
|
8619
8808
|
* @param channelFile The update information's file.
|
|
8620
|
-
* @param packageFile The package
|
|
8809
|
+
* @param packageFile The package's name without a version.
|
|
8621
8810
|
* @param fetchAsync Fetches a URL anonymously, following redirects, until the signal aborts; the signal aborts when the
|
|
8622
8811
|
* feed hasn't answered with the whole information file within 30 seconds.
|
|
8623
8812
|
* @param timeout Gives the signal that aborts a fetch after the milliseconds it takes; `AbortSignal.timeout` by default.
|
|
8813
|
+
* @param formatReleasedFile Names the package of the version the update information names, as it lists it; by default
|
|
8814
|
+
* `packageFile` for every version.
|
|
8624
8815
|
* @example
|
|
8625
8816
|
* ```ts
|
|
8626
8817
|
* import { FeedSource } from "@noldova/desktop.electron";
|
|
8627
8818
|
*
|
|
8628
|
-
* export const source: FeedSource = new FeedSource("http://127.0.0.1:8080/", "latest-linux-x64.yml", "Noldova Desktop Sample-linux-x64.AppImage", (url, signal) => fetch(url, { signal })
|
|
8819
|
+
* export const source: FeedSource = new FeedSource("http://127.0.0.1:8080/", "latest-linux-x64.yml", "Noldova Desktop Sample-linux-x64.AppImage", (url, signal) => fetch(url, { signal }),
|
|
8820
|
+
* undefined, version => `Noldova Desktop Sample-${version}-linux-x64.AppImage`);
|
|
8629
8821
|
* ```
|
|
8630
8822
|
*/
|
|
8631
|
-
public constructor(feed: string, channelFile: string, packageFile: string, fetchAsync: (url: string, signal: AbortSignal) => Promise<IFeedResponse>, timeout?: (milliseconds: number) => AbortSignal
|
|
8823
|
+
public constructor(feed: string, channelFile: string, packageFile: string, fetchAsync: (url: string, signal: AbortSignal) => Promise<IFeedResponse>, timeout?: (milliseconds: number) => AbortSignal,
|
|
8824
|
+
formatReleasedFile?: (version: string) => string);
|
|
8632
8825
|
|
|
8633
8826
|
/**
|
|
8634
8827
|
* Creates the source of a platform and processor: Windows' installer, macOS's ZIP or Linux's AppImage, or its Debian
|
|
@@ -9018,11 +9211,6 @@ export declare class FeedProvider extends Provider<UpdateInfo> {
|
|
|
9018
9211
|
* a prerelease suffix, installs nothing by itself and gives each failure its reason.
|
|
9019
9212
|
*/
|
|
9020
9213
|
export declare class FeedUpdater implements IUpdater {
|
|
9021
|
-
/**
|
|
9022
|
-
* The target's package in electron-updater's cache folder for the installation, the only file a download may give.
|
|
9023
|
-
*/
|
|
9024
|
-
public readonly packagePath: string;
|
|
9025
|
-
|
|
9026
9214
|
/**
|
|
9027
9215
|
* The file the last download in this process gave, or `null` before one has and while a download runs.
|
|
9028
9216
|
*/
|
|
@@ -9081,20 +9269,39 @@ export declare class FeedUpdater implements IUpdater {
|
|
|
9081
9269
|
* Downloads the version the last check found; electron-updater checks its SHA-512, and then the updater checks its
|
|
9082
9270
|
* publisher, deleting a file that fails.
|
|
9083
9271
|
*
|
|
9272
|
+
* @param version The version the last check found.
|
|
9084
9273
|
* @param onProgress Receives the progress as a whole percentage.
|
|
9085
9274
|
* @returns A promise of the downloaded file; it rejects with an {@link UpdateException} that gives the reason, by
|
|
9086
9275
|
* default that the download was interrupted, and with an unexpected error when the file is not
|
|
9087
|
-
* {@link FeedUpdater.
|
|
9276
|
+
* {@link FeedUpdater.formatPackagePath} for the version.
|
|
9088
9277
|
* @example
|
|
9089
9278
|
* ```ts
|
|
9090
9279
|
* import type { FeedUpdater } from "@noldova/desktop.electron";
|
|
9091
9280
|
*
|
|
9092
9281
|
* export function downloadAsync(updater: FeedUpdater): Promise<string> {
|
|
9093
|
-
* return updater.downloadAsync(t => console.log(`${t}%`));
|
|
9282
|
+
* return updater.downloadAsync("1.3.0", t => console.log(`${t}%`));
|
|
9283
|
+
* }
|
|
9284
|
+
* ```
|
|
9285
|
+
*/
|
|
9286
|
+
public downloadAsync(version: string, onProgress: (percent: number) => void): Promise<string>;
|
|
9287
|
+
|
|
9288
|
+
/**
|
|
9289
|
+
* Gives the only file a download of a version may give: the name electron-updater keeps it under, the last part of
|
|
9290
|
+
* the address {@link FeedProvider} gives, the source's {@link FeedSource.formatReleasedFile} for the version, in the
|
|
9291
|
+
* `pending` folder of its cache folder for the installation.
|
|
9292
|
+
*
|
|
9293
|
+
* @param version The version.
|
|
9294
|
+
* @returns The package's path.
|
|
9295
|
+
* @example
|
|
9296
|
+
* ```ts
|
|
9297
|
+
* import type { FeedUpdater } from "@noldova/desktop.electron";
|
|
9298
|
+
*
|
|
9299
|
+
* export function isPackage(updater: FeedUpdater, file: string): boolean {
|
|
9300
|
+
* return file === updater.formatPackagePath("1.3.0");
|
|
9094
9301
|
* }
|
|
9095
9302
|
* ```
|
|
9096
9303
|
*/
|
|
9097
|
-
public
|
|
9304
|
+
public formatPackagePath(version: string): string;
|
|
9098
9305
|
|
|
9099
9306
|
/**
|
|
9100
9307
|
* Cancels the download in progress, if any.
|
|
@@ -10466,8 +10673,8 @@ export declare class MainProcessLog implements IMainProcessLog {
|
|
|
10466
10673
|
public openAsync(): Promise<void>;
|
|
10467
10674
|
|
|
10468
10675
|
/**
|
|
10469
|
-
* Records a line, stamped with the time and redacted, on standard error and, once open, in the file
|
|
10470
|
-
* cannot take a line, later lines go to standard error only, and the log records why there.
|
|
10676
|
+
* Records a line, stamped with the time and redacted, on standard error at once and, once open, in the file without
|
|
10677
|
+
* waiting for the disk. When the file cannot take a line, later lines go to standard error only, and the log records why there.
|
|
10471
10678
|
*
|
|
10472
10679
|
* @param text What happened.
|
|
10473
10680
|
* @example
|
|
@@ -10514,6 +10721,20 @@ export declare class MainProcessLog implements IMainProcessLog {
|
|
|
10514
10721
|
* ```
|
|
10515
10722
|
*/
|
|
10516
10723
|
public writeShared(text: string): void;
|
|
10724
|
+
|
|
10725
|
+
/**
|
|
10726
|
+
* Writes the lines still waiting for the file at once, in order, as when the main process is about to quit or exit.
|
|
10727
|
+
*
|
|
10728
|
+
* @example
|
|
10729
|
+
* ```ts
|
|
10730
|
+
* import type { MainProcessLog } from "@noldova/desktop.electron";
|
|
10731
|
+
*
|
|
10732
|
+
* export function finish(log: MainProcessLog): void {
|
|
10733
|
+
* log.flush();
|
|
10734
|
+
* }
|
|
10735
|
+
* ```
|
|
10736
|
+
*/
|
|
10737
|
+
public flush(): void;
|
|
10517
10738
|
}
|
|
10518
10739
|
|
|
10519
10740
|
/**
|
package/api/index.js
CHANGED
|
@@ -73,6 +73,7 @@ export { MainProcessSettings } from "../models/main-process-settings.js";
|
|
|
73
73
|
export { DetachedStartReply } from "../models/detached-start-reply.js";
|
|
74
74
|
export { DetachedStartRequest } from "../models/detached-start-request.js";
|
|
75
75
|
export { FeedSource } from "../models/feed-source.js";
|
|
76
|
+
export { WebViewHistory } from "../models/web-view-history.js";
|
|
76
77
|
export { FileGrantRequest } from "../models/file-grant-request.js";
|
|
77
78
|
export { FilePathChoice } from "../models/file-path-choice.js";
|
|
78
79
|
export { IssuedFiles } from "../models/issued-files.js";
|
package/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.electron/src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.electron/src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyEH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3G,OAAO,EAAE,mCAAmC,EAAE,MAAM,2DAA2D,CAAC;AAChH,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,kCAAkC,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CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-frame-navigation.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.electron/src/interfaces/i-frame-navigation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/models/feed-source.js
CHANGED
|
@@ -13,12 +13,14 @@ export class FeedSource {
|
|
|
13
13
|
packageFile;
|
|
14
14
|
fetchAsync;
|
|
15
15
|
timeout;
|
|
16
|
-
|
|
16
|
+
formatReleasedFile;
|
|
17
|
+
constructor(feed, channelFile, packageFile, fetchAsync, timeout = t => AbortSignal.timeout(t), formatReleasedFile = () => packageFile) {
|
|
17
18
|
this.feed = feed;
|
|
18
19
|
this.channelFile = channelFile;
|
|
19
20
|
this.packageFile = packageFile;
|
|
20
21
|
this.fetchAsync = fetchAsync;
|
|
21
22
|
this.timeout = timeout;
|
|
23
|
+
this.formatReleasedFile = formatReleasedFile;
|
|
22
24
|
}
|
|
23
25
|
static create(feed, productName, platform, architecture, fetchAsync, isDebianPackage = false) {
|
|
24
26
|
const target = Resources.updateTargets.get(platform);
|
|
@@ -26,7 +28,7 @@ export class FeedSource {
|
|
|
26
28
|
return null;
|
|
27
29
|
const [name, extension] = target;
|
|
28
30
|
const packageExtension = isDebianPackage && platform === Resources.linuxPlatform ? Resources.debianPackageExtension : extension;
|
|
29
|
-
return new FeedSource(feed, Resources.formatChannelFile(name, architecture), Resources.formatPackageFile(productName, name, architecture, packageExtension), fetchAsync);
|
|
31
|
+
return new FeedSource(feed, Resources.formatChannelFile(name, architecture), Resources.formatPackageFile(productName, name, architecture, packageExtension), fetchAsync, undefined, t => Resources.formatReleasedPackageFile(productName, t, name, architecture, packageExtension));
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
//# sourceMappingURL=feed-source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-source.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.electron/src/models/feed-source.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,UAAU;IACL,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,WAAW,CAAS;IACpB,UAAU,CAA+D;IACzE,OAAO,CAAwC;
|
|
1
|
+
{"version":3,"file":"feed-source.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.electron/src/models/feed-source.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,UAAU;IACL,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,WAAW,CAAS;IACpB,UAAU,CAA+D;IACzE,OAAO,CAAwC;IAC/C,kBAAkB,CAA8B;IAEhE,YAAmB,IAAY,EAAE,WAAmB,EAAE,WAAmB,EAAE,UAAwE,EACjJ,UAAiD,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,qBAAkD,GAAG,EAAE,CAAC,WAAW;QACjJ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,IAAmB,EAAE,WAAmB,EAAE,QAAgB,EAAE,YAAoB,EAAE,UAAwE,EAC7K,kBAA2B,KAAK;QAChC,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC5G,OAAO,IAAI,CAAC;QACd,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC;QACjC,MAAM,gBAAgB,GAAG,eAAe,IAAI,QAAQ,KAAK,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC;QAChI,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,CAAC,EAAE,UAAU,EACrK,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,yBAAyB,CAAC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC/G,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
export class WebViewHistory {
|
|
9
|
+
entries;
|
|
10
|
+
index;
|
|
11
|
+
constructor(entries, index) {
|
|
12
|
+
this.entries = [...entries];
|
|
13
|
+
this.index = index;
|
|
14
|
+
}
|
|
15
|
+
get currentUrl() {
|
|
16
|
+
return this.entries[this.index]?.url ?? null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=web-view-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-view-history.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.electron/src/models/web-view-history.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,OAAO,cAAc;IACT,OAAO,CAA6B;IACpC,KAAK,CAAS;IAE9B,YAAmB,OAAmC,EAAE,KAAa;QACnE,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC;IAC/C,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noldova/desktop.electron",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Noldova Desktop's Electron main process and preload: it starts and connects to the runtime, opens the window, and owns the tray, notifications from the operating system, the menu bar on macOS, shutdown and updates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"registry": "https://registry.npmjs.org/"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@noldova/desktop.protocol": "0.0.
|
|
36
|
-
"@noldova/desktop.runtime": "0.0.
|
|
35
|
+
"@noldova/desktop.protocol": "0.0.3",
|
|
36
|
+
"@noldova/desktop.runtime": "0.0.3",
|
|
37
37
|
"electron-updater": "6.8.9"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -41,8 +41,14 @@
|
|
|
41
41
|
"@noldova/context.exceptions": ">=0.0.7 <0.1.0",
|
|
42
42
|
"@noldova/context.json": ">=0.0.7 <0.1.0",
|
|
43
43
|
"@noldova/context.text": ">=0.0.7 <0.1.0",
|
|
44
|
+
"@types/node": ">=26.6.6 <27.0.0",
|
|
44
45
|
"electron": "44.9.1"
|
|
45
46
|
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"@types/node": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
46
52
|
"noldova": {
|
|
47
53
|
"coverageExclusions": [
|
|
48
54
|
{
|
|
@@ -71,5 +77,5 @@
|
|
|
71
77
|
}
|
|
72
78
|
]
|
|
73
79
|
},
|
|
74
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "4d7955e6086c27667752d6692ecfd1771be5a753"
|
|
75
81
|
}
|