@nemigo/electron 2.0.2 → 2.2.0
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/dist/security.d.ts +0 -1
- package/dist/security.js +4 -3
- package/package.json +9 -11
package/dist/security.d.ts
CHANGED
package/dist/security.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
// oxlint-disable no-console
|
|
1
3
|
import { extractUrlOrigin } from "@nemigo/helpers/url";
|
|
2
4
|
import { app, shell } from "electron";
|
|
3
5
|
/**
|
|
@@ -45,14 +47,14 @@ export class NetworkSecurity {
|
|
|
45
47
|
return this;
|
|
46
48
|
}
|
|
47
49
|
__handleNavigation(contents) {
|
|
48
|
-
contents.on("will-navigate", (
|
|
50
|
+
contents.on("will-navigate", (event, url) => {
|
|
49
51
|
if (url.startsWith("file://"))
|
|
50
52
|
return;
|
|
51
53
|
const { origin } = new URL(url);
|
|
52
54
|
if (!origin)
|
|
53
55
|
return;
|
|
54
56
|
if (!this.allowedInternalOrigins.has(origin)) {
|
|
55
|
-
|
|
57
|
+
event.preventDefault();
|
|
56
58
|
console.warn(`Blocked navigating to disallowed origin: ${origin}`);
|
|
57
59
|
}
|
|
58
60
|
});
|
|
@@ -72,4 +74,3 @@ export class NetworkSecurity {
|
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
|
-
export default NetworkSecurity;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nemigo/electron",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Vlad Logvin",
|
|
@@ -12,14 +12,12 @@
|
|
|
12
12
|
"pnpm": ">=10.9.0"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "svelte-package && rimraf .svelte-kit",
|
|
15
|
+
"build": "bunx --bun svelte-package && bunx --bun rimraf .svelte-kit",
|
|
16
16
|
"check": "bunx --bun tsc --noemit",
|
|
17
17
|
"eslint": "bunx --bun eslint ./",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"lint:fix:unsafe": "biome lint --fix --unsafe",
|
|
22
|
-
"format": "biome check --write --linter-enabled=false"
|
|
18
|
+
"oxlint": "bunx --bun oxlint --config .././../oxlintrc.jsonc --ignore-path ../configs/.eslint.ignore ./",
|
|
19
|
+
"bilint": "bunx --bun biome lint",
|
|
20
|
+
"format": "bunx --bun biome check --write --linter-enabled=false"
|
|
23
21
|
},
|
|
24
22
|
"exports": {
|
|
25
23
|
"./security": {
|
|
@@ -28,12 +26,12 @@
|
|
|
28
26
|
}
|
|
29
27
|
},
|
|
30
28
|
"peerDependencies": {
|
|
31
|
-
"@nemigo/helpers": ">=2.
|
|
32
|
-
"electron": ">=
|
|
29
|
+
"@nemigo/helpers": ">=2.2.0",
|
|
30
|
+
"electron": ">=39.0.0"
|
|
33
31
|
},
|
|
34
32
|
"devDependencies": {
|
|
35
|
-
"@nemigo/configs": "2.
|
|
36
|
-
"@nemigo/helpers": "2.0
|
|
33
|
+
"@nemigo/configs": "2.2.0",
|
|
34
|
+
"@nemigo/helpers": "2.2.0",
|
|
37
35
|
"electron": "39.2.3"
|
|
38
36
|
}
|
|
39
37
|
}
|