diff --git a/Cargo.toml b/Cargo.toml index 4626962..4bd584b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ version = "0.1.0" crate-type = ["cdylib"] [dependencies] -napi = "2" +napi = { version = "2", default-features = true, features = ["napi9"] } napi-derive = "2" tao = "0.30.2" -wry = { version = "0.45.0", features = ["devtools"] } +wry = { version = "0.45.0", features = ["devtools", "fullscreen"] } [build-dependencies] napi-build = "2" diff --git a/examples/html.js b/examples/html.js index c084c85..1f96706 100644 --- a/examples/html.js +++ b/examples/html.js @@ -1,7 +1,13 @@ -const requireScript = require('node:module').createRequire(__filename); -const { Application } = requireScript('../index.js'); +// const requireScript = require('node:module').createRequire(__filename); +// const { Application } = requireScript('../index.js'); +const { Application } = require('../index.js'); const app = new Application(); + +app.onIpcMessage((data) => { + console.log({ data }); +}); + const window = app.createBrowserWindow({ html: ` @@ -10,6 +16,12 @@ const window = app.createBrowserWindow({