win_webview2 1.1.17 → 1.1.19

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.
@@ -39,6 +39,13 @@ async function downloadModuleFile(platform) {
39
39
  }
40
40
  await (0, downloader_1.downloadFile)(url, filePath);
41
41
  }
42
+ async function sleep(n) {
43
+ return new Promise((r, x) => {
44
+ setTimeout(() => {
45
+ r(null);
46
+ }, n);
47
+ });
48
+ }
42
49
  async function downloadModuleAndExtract(platform) {
43
50
  await downloadModuleFile(platform);
44
51
  let modulePath = (0, dirnameTool_1.getWWVNodeModuleFolder)();
@@ -46,7 +53,7 @@ async function downloadModuleAndExtract(platform) {
46
53
  let fileName = platform + ".zip";
47
54
  let filePath = node_path_1.default.join(winlibPath, fileName);
48
55
  extractZip(filePath, node_path_1.default.join(winlibPath, platform));
49
- await (0, promises_1.unlink)(filePath);
56
+ await sleep(1000);
50
57
  }
51
58
  function getCurrentPlatform() {
52
59
  let result = "x64";
@@ -71,7 +71,7 @@ async function ww2_CreateServer(arg) {
71
71
  });
72
72
  });
73
73
  let ww2Module = await (0, winwebview2_1.getModule)();
74
- let server = app.listen(port, async (err) => {
74
+ let server = app.listen(port, '127.0.0.1', async (err) => {
75
75
  let add = server.address();
76
76
  if (add == null) {
77
77
  console.log("build server failed : " + err);
@@ -79,7 +79,7 @@ async function ww2_CreateServer(arg) {
79
79
  }
80
80
  let addr = add;
81
81
  let resultPort = addr.port;
82
- let url = `http://localhost:${resultPort}`;
82
+ let url = `http://127.0.0.1:${resultPort}`;
83
83
  console.log(url);
84
84
  console.log("open UI");
85
85
  let uiConfig = arg.uiConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "win_webview2",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/nnttoo/win_webview2"