sys-shim 0.0.1-16 → 0.0.1-20

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.
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>sys-shim page</title>
6
+ </head>
7
+ <script>
8
+ new Sys({
9
+ log: true,
10
+ wsUrl: undefined
11
+ }).then(async main => {
12
+ globalThis.native = main.native
13
+ globalThis.nativeMain = main.nativeMain
14
+ document.body.append(`${globalThis.ext.wsUrl}?token=${globalThis.ext.token}`)
15
+ })
16
+ </script>
17
+ <body>
18
+ <button onclick="native.win.msgbox(`hello`, `title`)">msgbox</button>
19
+ <button onclick="nativeMain.win.quitMessage()">exit</button>
20
+ <hr>
21
+ </body>
22
+ </html>
@@ -1,4 +1,8 @@
1
1
  {
2
2
  "browserArguments": "--disable-web-security --allow-running-insecure-content",
3
+ "form": {
4
+ "right": 1300,
5
+ "bottom": 800
6
+ },
3
7
  "page": "#{page}"
4
8
  }
@@ -1,5 +1,9 @@
1
1
  document.addEventListener(`DOMContentLoaded`, async () => {
2
2
  new window.Sys().then(async main => {
3
3
  window.sys = main
4
+ // 编程式设置窗口图标
5
+ const tabIcon = `./favicon.ico`
6
+ const [, exist] = await window.sys.native.io.exist(tabIcon)
7
+ exist && await window.sys.native.win.image.setIcon(window.sys.hwnd, tabIcon)
4
8
  })
5
9
  })
Binary file