SteveSandersonMS / WebWindow

.NET Core library to open native OS windows containing web UI on Windows, Mac, and Linux. Experimental.
Apache License 2.0
1.99k stars 215 forks source link

Support of hosting as control #87

Open kant2002 opened 4 years ago

kant2002 commented 4 years ago

I would like to migrate Electron application to WebWindow, but currently as it is lacking support for the menu creation. I for example can host application in Windows Forms, or create menu if I somehow embed WebWindow in WinForms or WPF.

@SteveSandersonMS can I have you opinion what can be done as part of this project, and what can be done outside of it. I willing to contribute if needed.

kant2002 commented 4 years ago

Ok. Seems to be I'm self -solve the issue, but figuring out that there Hwnd property which allow me to do some magic. But I have another question. Seems to be session information does not preserved across different application launches. This seems strange and not intuitive. What is available for persisting data inside browser? Do I need to customize something?

SteveSandersonMS commented 4 years ago

Hey @kant2002!

If you're interested in adding support for native OS menus then please feel free to go ahead. I'd be happy to merge a PR as long as it's reasonably consistent with the code already here, and supports Windows, macOS, and Linux.

Seems to be session information does not preserved across different application launches.

Do you mean the cookie collection?

Or do you mean sessionStorage? If you do mean sessionStorage, then try localStorage instead, since that persists beyond a single usage session.

kant2002 commented 4 years ago

@SteveSandersonMS Thanks. Let me summarize my thought on the issues which I have

SteveSandersonMS commented 4 years ago

Do you want similar configuration like in Electron, where some abstraction over standard menu would be part of WebWindow API ? Or I can better work on example how WebWindow can be embedded into WinForms/WPF?

Yes, it would need to be an abstraction.

There's is no WinForms or WPF in here. The Windows implementation is pure Win32, and of course on Mac/Linux it's something else.

jspuij commented 4 years ago

@kant2002 Take a look at https://github.com/jspuij/BlazorWebView