Replies: 2 comments 1 reply
-
|
Deno 2.9.2 Haven't got an answer but getting the same thing. win.bind("openPdfWin", ({id: number}) => { await bindings.openPdfWin('id: 0'); I get bindings is not defined although the docs suggest that bindings is exposed by default. If I specify something like const bindings = 'bindings'; then I get bindings.openPdfWin is not a function Just seems to be no way to call the win.bind process. |
Beta Was this translation helpful? Give feedback.
-
|
From the current desktop code, the binding has to be registered from Deno-side code that is actually executed, not from the Next/browser bundle. The built-in framework path creates the initial native window first, then the first const win = new Deno.BrowserWindow();
win.bind("setTitle", (title: string) => {
win.setTitle(title);
});In the webview, call it as I don't see a documented hook in the auto-detected Next framework mode for "run this desktop setup module". If you need menus/tray/bindings today, use an explicit desktop entrypoint that starts Next and also registers the bindings, instead of relying on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm building a Next.js application with Deno Desktop and I'm trying to understand the recommended way to expose desktop APIs to the webview.
I can successfully start the application using:
deno desktop --hmr .Following the bindings documentation, I tried creating a BrowserWindow and registering bindings:
However, in framework mode (
deno desktop --hmr .), this file is never executed, and in the webview:await bindings.setTitle("Dashboard");results in:
ReferenceError: bindings is not definedFrom reading the documentation, bindings are registered per BrowserWindow, which makes sense. My confusion is about framework mode:
deno desktop .automatically creates the application window.The bindings examples assume I create the
BrowserWindowmyself.I couldn't find documentation explaining how these two approaches work together.
What is the recommended way to:
Register bindings when using the built-in Next.js integration?
Access or customize the automatically created BrowserWindow?
Execute custom desktop initialization code (menus, bindings, tray, etc.) in framework mode?
If this isn't currently supported, I'd be happy to help improve the documentation once I understand the intended architecture.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions