nexfep 0.7.0 → 0.7.2

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/cli/build.mjs CHANGED
@@ -101,7 +101,7 @@ export default async function build(args) {
101
101
  const typerForBuild = new TimeTyper("Building...");
102
102
  const result = await new Promise((resolve) => {
103
103
  const child = child_process.spawn(
104
- `npx --yes nexfpack@0.4.2 ${path.join(NexfpackConfig.output, "nexfpack.config.json")}`,
104
+ `npx --yes nexfpack@0.5.1 ${path.join(NexfpackConfig.output, "nexfpack.config.json")}`,
105
105
  { shell: true },
106
106
  );
107
107
  child.on("close", (code) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexfep",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "A desktop application framework based on @webviewjs/webview",
5
5
  "keywords": [
6
6
  "@webviewjs/webview",
@@ -51,6 +51,7 @@ declare class WindowPool {
51
51
  private windowCount;
52
52
  private freeWindowCount;
53
53
  private localProxys;
54
+ private webContext?;
54
55
  global: Map<string, any>;
55
56
  constructor(app: Application, options: {
56
57
  WindowsWebview2UserDataFolder?: string;
@@ -156,6 +156,7 @@ class WindowPool {
156
156
  windowCount;
157
157
  freeWindowCount;
158
158
  localProxys;
159
+ webContext;
159
160
  global;
160
161
  constructor(app, options) {
161
162
  if (os.platform() === "win32") {
@@ -164,7 +165,9 @@ class WindowPool {
164
165
  if (!fs.existsSync(userDataDir)) {
165
166
  fs.mkdirSync(userDataDir, { recursive: true });
166
167
  }
167
- process.env.WEBVIEW2_USER_DATA_FOLDER = userDataDir;
168
+ this.webContext = app.createWebContext({
169
+ dataDirectory: userDataDir,
170
+ });
168
171
  }
169
172
  this.onCustomMessage = (window, message, data) => {
170
173
  console.log("Get Custom Message:", message, data, "from window", window.id);
@@ -402,7 +405,9 @@ class WindowPool {
402
405
  this.__registryLocalProxy(window, proxy.protocolName, proxy.localPath);
403
406
  });
404
407
  this.freeWindowCount++;
405
- const webview = window.createWebview();
408
+ const webview = window.createWebview({
409
+ webContext: this.webContext,
410
+ });
406
411
  const windowObj = new Window(window, webview, ++this.windowCount, this);
407
412
  this.windows.push(windowObj);
408
413
  webview.onIpcMessage((data) => {