Code Monkey home page Code Monkey logo

webwindow's Introduction

Important

I'm not directly maintaining or developing WebWindow currently or for the forseeable future. The primary reason is that it's mostly fulfilled its purpose, which is to inspire and kickstart serious efforts to make cross-platform hybrid desktop+web apps with .NET Core a reality. Read more at #86.

People who want to build real cross-platform hybrid desktop+web apps with .NET Core should consider the following alternatives:

  • Photino, which is based on this WebWindow project and is the successor to it. Photino is maintained by the team at CODE Magazine and the project's open source community. It supports Windows, Mac, and Linux, along with UIs built using either Blazor (for .NET Core) or any JavaScript-based framework.
  • Official support for Blazor hybrid desktop apps coming in .NET 6.

WebWindow

For information, see this blog post.

Usage instructions

Unless you want to change the WebWindow library itself, you do not need to build this repo yourself. If you just want to use it in an app, grab the prebuilt NuGet package or follow these 'hello world' example steps.

Samples

For samples, open the WebWindow.Samples.sln solution

These projects reference the prebuilt NuGet package so can be built without building the native code in this repo.

How to build this repo

If you want to build the WebWindow library itself, you will need:

  • Windows, Mac, or Linux
  • Node.js (because WebWindow.Blazor.JS includes TypeScript code, so the build process involves calling Node to perform a Webpack build)
  • If you're on Windows:
    • Use Visual Studio with C++ support enabled. You must build in x64 configuration (not AnyCPU, which is the default).
    • If things don't seem to be updating, try right-clicking one of the testassets projects and choose Rebuild to force it to rebuild the native assets.
  • If you're on macOS:
    • Install Xcode so that you have the whole gcc toolchain available on the command line.
    • From the repo root, run dotnet build src/WebWindow/WebWindow.csproj
    • Then you can cd testassets/HelloWorldApp and dotnet run
  • If you're on Linux (tested with Ubuntu 18.04):
    • Install dependencies: sudo apt-get update && sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev
    • From the repo root, run dotnet build src/WebWindow/WebWindow.csproj
    • Then you can cd testassets/HelloWorldApp and dotnet run
  • If you're on Windows Subsystem for Linux (WSL), then as well as the above, you will need a local X server (example setup).

webwindow's People

Contributors

berrysoft avatar clancey avatar davidglassborow avatar jlgaffney avatar sclaire-1 avatar stevesandersonms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webwindow's Issues

HttpClient and general questions.

I see the demo is reading a file instead of doing an http request. It makes sense since it's a desktop app loading data from itself, but I tried to do an actual http request using the blazor specific HttpClient (Microsoft.AspNetCore.Blazor.HttpClient) without luck.

Is this something currently not working? I'm interested to understand why. Also, I see no error on output nor console of the "broswer". Is there anyway to actually see errors ?

Thanks!

Setting window.Title crashes on Mac

In the vue file explorer app, on a Mac, when clicking around and going from folder to folder and back up again, the app keeps crashing (mostly when going to /bin and then back /..)

Weirdly it crashes on the line window.Title = path; but there is no exception thrown, the app just stops dead. I changed it to a static string and it did not crash, so definitely that line.

I'm guessing the native stuff needs more error checking...

Would using an external ServiceCollection be possible?

Justification

We have a number of applications where it is useful to serve the same UI both locally and remotely. (e.g. equipment with touch-panel displays which can also be used remotely)

At present we tend to do this by running a web server and then using a full-screen browser locally to render a local copy of the UI. This is invariably a pain - all the browser kiosk modes are crapulous to some degree, and multi-monitor support is particularly grim.

So the BlazorDesktop stuff would be great for us - we could render the UI into WebWindow on the local machine, and serve exactly the same server-side Blazor experience remotely via ASP.Net/Kestrel.

Issue

I played around with this "local + web" idea with the WinForms BlazorDesktop demo a couple of weeks ago, and it wasn't very difficult to get working, but there's one fly in the ointment, which is that the all-in-one ComponentsDesktop.Run method creates its own ServiceCollection, which is a different collection to the one which ASP.Net creates in WebHostBuilder. This means that DI'd state is not shared between the local and remote UI, which would be a bit sad in real life (one would need to create some other mechanism for sharing state).

How sensible would it be to refactor ComponentsDesktop so that it could (optionally, of course) be called with a pre-existing ServiceCollection, so that 'local' (WebWindow) and 'remote' (ASP.Net / Server-side Blazor) worlds could share a DI container?

I have had a go at this and it's quite a significant change because of the relationship between the service collection build and the window initialisation - I guess I'm just trying to see if anyone else thinks this is in the slightest bit worthwhile, or if I could perhaps promote a slightly more modular design of ComponentsDesktop.

Run Browser Engine with --disable-web-security

Hi,

config.SchemeHandlers.Add("app", (string url, out string contentType) =>
works only on header script.

config.SchemeHandlers.Add("myOwnHandler", (string url, out string contentType) =>
is not processed by a href="" or iframe or xhr call.

Ajax call might work with "disable-web-security".

index.html:34 Access to XMLHttpRequest at 'app-pdf://test/me.pdf' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, edge, https.

config.SchemeHandlers.Add("ftp", (string url, out string contentType) =>
works, but not in iframe =>

Subresource requests using legacy protocols (like ftp:) are blocked. Please deliver web-accessible resources over modern protocols like HTTPS. See https://www.chromestatus.com/feature/5709390967472128 for details.

Any other cool idea how to call a handler to read a in memory generated pdf file?
(actually do not want to base64 over js window call, better file read over handler)

Also pressing F12 or Shortcut Keys resolve here in Exceptions. May add also
an overwriteable KeyDown Handler to hook into certain keys.

Kind regards. Otto.

Is there anyway to force a window to quit without closing it manually

I was playing around with this library and I am launching multiple windows in their own thread and tracking them in a dictionary. I just found out .net core removed thread.abort();

I am trying to find a way to force the window to close by the main program but at the moment there doesn't seem to be one. Would you be able to suggest any method?

I would also appreciate it if you could suggest any reading or some way to get me up to speed with what you are doing I would like to start contributing I have several ideas, but I am not very familiar with C++ interop.

Allow supplying JavaScript to the WebWindow

During startup of the app/WebWindow, I would like to inject JavaScript code from .NET. Afaik there is no way to do this without also having some initial JavaScript running on the loaded web assets.

Scenario: I have built a library that enables some built-in features for calling between JavaScript and .NET, but I'd like to be able to allow consumers of the library to simply call window.EnableNativeApi() and it should inject not only the .NET handling, but also a small JavaScript that maps the calls. This would avoid having to explain to consumers to copy the JavaScript into their wwwroot folder.

testassets/HelloWorldApp: Scheme Handlers.Add do not work correct

The application works. Except adding SchemeHandlers. The application opens but no message box is displayed. But that should be the case.
Because:

<script src="app://something.js"></script>

When I open the developer tools and look in the console, I see the following:
something.js/:1 Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME

I USE:
Microsoft Edge
Microsoft Edge is up to date.
Version 81.0.389.2 (Official build) dev (64-bit)

Microsoft Visual Studio Professional 2019 Preview
Version 16.5.0 Preview 1.0

use of HttpClient

Hi Steve, and thanks for your work, its amazing again.

I try to convert my blazor app to include it in your webWindow but im facing on some problems on the dependency injection.

when it register my services where a HttpClient is inject on the constructor, there is an error (launch in a separate window)

Unable to resolve service for type "System.Net.HttpClient" While attempting to activate MyService

I try to install the package Microsoft.Extensions.Http and add services.AddHttpClient(); on the beginning of ConfigureServices in the Startup, but still not work.

You have an idea on whats happen ?

thanks !

Julien

PS : it can be nice on the error view to have a scrollbar and can select text inside. actually if the stack is too long wee don't see all the exception.

Please add License file

This looks amazing - can you please add a license file so others can actually use it? (Hoping for MIT or if not then Apache 2.0 or BSD or whatever reflects your intent and preferences)

Running error on windows

Console program running error
static void Main(string[] args) { var window = new WebWindow("My first WebWindow app"); window.NavigateToString("test"); window.WaitForExit(); }
System.AccessViolationException
HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=<无法计算异常源>
StackTrace:
<无法计算异常堆栈跟踪>

Linux build instructions fail

OS: Ubuntu 18.04
dotnet sdk: 3.1.100

The build instructions:

sudo apt-get update && sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev
cd testassets/HelloWorldApp
dotnet run

yield:

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'WebWindow.Native' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libWebWindow.Native: cannot open shared object file: No such file or directory
   at WebWindows.WebWindow.WebWindow_ctor(String title, IntPtr parentWebWindow, OnWebMessageReceivedCallback webMessageReceivedCallback)
   at WebWindows.WebWindow..ctor(String title, Action`1 configure) in /home/duncan/Projects/github/WebWindow/src/WebWindow/WebWindow.cs:line 133
   at HelloWorldApp.Program.Main(String[] args) in /home/duncan/Projects/github/WebWindow/testassets/HelloWorldApp/Program.cs:line 12

The build doesn't fail:

dotnet clean
dotnet build

Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 18.67 ms for /home/duncan/Projects/github/WebWindow/src/WebWindow/WebWindow.csproj.
  Restore completed in 21.41 ms for /home/duncan/Projects/github/WebWindow/testassets/HelloWorldApp/HelloWorldApp.csproj.
  WebWindow -> /home/duncan/Projects/github/WebWindow/src/WebWindow/bin/Debug/netstandard2.1/WebWindow.dll
  HelloWorldApp -> /home/duncan/Projects/github/WebWindow/testassets/HelloWorldApp/bin/Debug/netcoreapp3.0/HelloWorldApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

But it doesn't build the native library as the readme claims. I was going to be surprised if it did because I don't expect dotnet core to build vcxproj files. Trying to build the native project directly generates an expected error:

cd src/WebWindow.Native
dotnet build

Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/home/duncan/Projects/github/WebWindow/src/WebWindow.Native/WebWindow.Native.vcxproj(30,3): error MSB4019: The imported project "/Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "/Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.

Build FAILED.

Add IE support?

Although the initial idea is to get use of modern browser technology, is there any plan to use IE as back-end on Windows? Some may prefer this because their app may intend to support Windows 7/8.1, and it is heavy to install Edge (Chromium) or download a Chromium core.

Native: Linux resized/moved callbacks SIGSEGV

WebWindow::_movedCallback and WebWindow::_resizedCallback fields should be initialized to nullptr in beginning of constructor. I got callbacks called before they was set and got SIGSEGV because callbacks contains random address.

Blazor not working on Windows Edge Version 80.0.355.1

My OS was upgraded this morning and now BlazorDesktopApp sample is not working.

I have several other Blazor based samples I was working with and they all stopped working at the same time:
image

New version of Edge chromium?

ProjectName.WebView2 folder. Is it required?

I'm currently testing out the project, however I've noticed some odd behavior when it comes to the folder "ProjectName.WebView2" (ProjectName being the name of your Project). This folder is automatically created upon a build, however it is not created if it's published as a Single Executable.

Now. It's about to get weirder.

In the case of the Single Executable, when I start the executable, the folder "ProjectName.WebView2" is created with lots of content inside it. As long as the program is open, you cannot delete this folder.

However after you've done these steps, and then close the program and delete the folder "ProjectName.WebView2", and then re-execute the program, the folder does NOT reappear/recreate- itself, meaning it is not required?

If this really IS required. Is it possible to include it into the Single Executable somehow?

Sample not working

I got this message :

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at WebWindows.WebWindow.WebWindow_NavigateToUrl(IntPtr, System.String)
   at WebWindows.WebWindow.WebWindow_NavigateToUrl(IntPtr, System.String)
   at WebWindows.WebWindow.NavigateToUrl(System.String)
   at WebWindows.WebWindow.NavigateToLocalFile(System.String)
   at HelloWorldApp.Program.Main(System.String[])

OS : Win10 (1809)
dotnet : 3.0.100

Sample not working on Windows -- This article tells you how to resolve it

There are several issues in this site that mention the same problem (#1, #6, #42): it's not apparent how to get started with WebView in Windows. When you first try to run the samples, you get exception right from the WebWindow constructor.

All the resolved issues mention that you have to install Edge Beta from here https://www.microsoftedgeinsider.com/en-us/. Well, this is just a part of the solution.

I suggest to add this information to README:

Running WebWindow on Windows has these prerequisites, as of this writing:

  1. Edge Beta, as WebWindow uses the new Chromium-based Edge via webview2
  2. Microsoft Visual C++ 2015-2019 Redistributable

Those developers who use Visual Studio 2019 for .NET desktop development without the Desktop development with C++ workload installed, will still get the WebWindow constructor exception.

Follow these steps to run samples on your Windows machine:

  1. If you've installed Visual Studio 2019 on your computer, ensure that the Desktop development with C++ workload installed.
  2. Altentatively, if you do not want to install that workload, install Microsoft Visual C++ 2015-2019 Redistributable (x86: https://aka.ms/vs/16/release/vc_redist.x86.exe, x64: https://aka.ms/vs/16/release/vc_redist.x64.exe)
  3. Install Edge Beta (https://www.microsoftedgeinsider.com/en-us/.)

Now, the samples should work when running them from Visual Studio 2019/.NET CLI

Similar project

Hi,

stumbled upon your blog recently and realized how similar my project is: https://github.com/JBildstein/SpiderEye
I took a bit a different approach tough and used only C# (and don't have anything Blazor specific).

Could be fun to collaborate/exchange on this subject a bit :)

The system cannot find the file specified.

Error running webwindow.samples.
Constructor prompt error:
The system cannot find the file specified.
Exception:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
screenshot

Implement InvokeScript ==> IWebView2WebView supports ExecuteScript

Hi there,
IWebView2WebView supports ExecuteScript. So it would be niche to implement this.
I try it on Windows and it works fine.

WebWindow.Natvie:

//WebWindow.h
typedef void (*ScriptResponseCallback)(HRESULT hr,AutoString ideintifier, AutoString message);
void InvokeScript(AutoString caller,AutoString identifier, ScriptResponseCallback result);
//WebWindow.Windows.cpp
void WebWindow::InvokeScript(AutoString caller,AutoString identifier, 
    ScriptResponseCallback callback)
{
	
	this->_webviewWindow->ExecuteScript(caller, 
                Callback<IWebView2ExecuteScriptCompletedHandler>(
		[this,identifier,callback](HRESULT errorCode, 
                 LPCWSTR resultObjectAsJson) -> HRESULT {
			callback(errorCode,identifier,resultObjectAsJson);
			return S_OK;
		}).Get());

}
//Exports.cpp
EXPORTED void WebWindow_InvokeScript(WebWindow* instance, 
   AutoString scriptText, AutoString identifier,ScriptResponseCallback callback)
{
   return instance->InvokeScript(scriptText, identifier,callback);
}

DotNet - Side => WebWindow:

//Delegate
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ScriptResponseCallback(uint hr, IntPtr identifier, IntPtr result);
//Declare
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public static extern void WebWindow_InvokeScript(IntPtr instance, 
   string scriptText, string identifier, ScriptResponseCallback callback);
//Event
public event EventHandler<ScriptResultEventArgs> OnScriptInvoced;
//Implementation
public string InvokeScript(string scriptText)
{
   string identifier = Guid.NewGuid().ToString();
   NativeFunctions.WebWindow_InvokeScript(this._nativeWebWindow, 
       scriptText,identifier, (a,   b,c) =>
       {
          string id = Marshal.PtrToStringUni(b);
          string str = Marshal.PtrToStringUni(c);
          RaiseOnScriptInvoked(a,id, str);
        });

   return identifier;
 }
private void RaiseOnScriptInvoked(uint hr, string identifier,string resultValue)
{
   bool isError = hr != 0x0000;
    if (this.ResultList.ContainsKey(identifier))
    this.ResultList.Remove(identifier);
    this.ResultList.Add(identifier,new ScriptResult(identifier, resultValue, isError));
    if (OnScriptInvoced != null)
    {

      ScriptResultEventArgs args = new ScriptResultEventArgs(identifier,resultValue, isError);
            OnScriptInvoced.Invoke(this, args);
     }
            
}

//ScriptResultEventArgs.cs
public class ScriptResultEventArgs : EventArgs
{
	public string IdentiFier{get;set;}
	public string ResultMessage{get;}
	public bool IsError{get;}

	public ScriptResultEventArgs(string identifier,
	   string resultMessage, bool isError)
	{
		this.IdentiFier = identifier;
		this.ResultMessage = resultMessage;
		this.IsError = isError;
	}
}

Client Side:

window.OnScriptInvoced += (snnder, e) =>
{
	if (e.IsError)
	{
		window.ShowMessage("error:" + e.IdentiFier, e.ResultMessage);
	}
	else
	{
		window.ShowMessage("Result:" + e.IdentiFier, e.ResultMessage);
	}
};

//Calling a script
string id = window.InvokeScript($"document.getElementById('{rpc.objId}').innerHTML='{rpc.param}'");

The InvokeScript function returns an ID that can be used to identify a return value.
The only question is whether this also works on Mac and Linux. Unfortunately I don't have the possibility to test it. I also don't know if this function is available for Mac and Linux at all? So it would be good if one could do this.

Best regards

Dark Theme and TitleBar Customization

Hey, first of all awesome work you have here! I have been following you since when Blazor was still pretty experimental! I have no doubt this will be a major success as-well as Blazor!

Anyway my question is, how easy would it be to adapt or force a current theme in a specific OS? Lets say Windows Dark Theme, so for example I would have dark theme title bar or just customize it in general!

I know its pretty early but I'm just wondering if this was something trivial or I might need to go into C++ / Objective C world or wait for the project to mature?

Thanks!
You are really changing the world Steve, keep it up!

Implement IWebView2WebView5->AddRemoteObject

Hi There,
WebView2 inteface IWebView2WebView5 supports AddRemoteObject. this can be a ComVisible DotNet-Class. So it would be nice to implement it.

I try it on WebWindow.Windows.cpp and it works:

//WebWindow.h
void AddRemoteObject(AutoString name, IDispatch* obj);
void RemoveRemoteObject(AutoString name);
//WebWindow.Windows.cpp
void WebWindow::AddRemoteObject(AutoString name, IDispatch* obj)
{
	VARIANT v ={};
	v.pdispVal = obj;
	v.vt = VT_DISPATCH;

	HRESULT rs = _webviewWindow5->AddRemoteObject(name, &v);
	if(rs == S_OK)
	{
		printf("OK");
	}
	else
	{
		printf("NOK");
	}
}
void WebWindow::RemoveRemoteObject(AutoString name)
{
	_webviewWindow5->RemoveRemoteObject(name);
}

//Exports.cpp
EXPORTED void WebWindow_AddRemoteObject(WebWindow* instance,AutoString name, 
      IDispatch* obj)
{
      instance->AddRemoteObject(name, obj);
}
EXPORTED void WebWindow_RemoveRemoteObject(WebWindow* instance,AutoString name)
{
      instance->RemoveRemoteObject(name);
}

Dotnet Site:

//Declare
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
#pragma warning disable 618
public static extern void WebWindow_AddRemoteObject(IntPtr instance, 
           string name,
           [In][MarshalAs(UnmanagedType.IDispatch)] object obj);
#pragma warning restore 618

public void AddRemoteObject(string name, object obj)
{
   WebWindow_AddRemoteObject(this._nativeWebWindow, name, obj);
   _remoteObjectList.Add(name);
}
//~WebWindow
string[] remoteNames = this._remoteObjectList.ToArray();
foreach (string name in remoteNames)
{
   try
   {
      this.RemoveRemoteObject(name);
   }
   catch (Exception )
   {
      //
   }
}

Client side:

//the Script Object
    [ComVisible(true)]
    [Guid("21A6CC64-8E9A-4659-85AA-32A07B2BDA0B")]
    public class TestObject
    {
        public string FirstMessage {get;set;}
        public string SencondMessage{get;set;}

        public int GetStringLen(string input)
        {
            return input.Length;
        }
    }

//program.cs
 class Program
    {
        private static TestObject _TestObj;
        static void Main(string[] args)
        {

            _TestObj = new TestObject();
            _TestObj.FirstMessage = "This is a message from Com!";
          var window = new WebWindow("My great app", options =>
            {  ...

            //At the end!
             window.AddRemoteObject("testObject", _TestObj);
            window.NavigateToLocalFile("wwwroot/index.html");
            window.WaitForExit();
        }
... 

The only question is whether this also works on Mac and Linux. Unfortunately I don't have the possibility to test it. I also don't know if this function is available for Mac and Linux at all? So it would be good if one could do this.

Best regards

Unable to load DLL 'WebWindow.Native'

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'WebWindows.WebWindow' threw an exception.
Source=WebWindow
StackTrace:
at WebWindows.WebWindow..ctor(String title)
at HelloWorldApp.Program.Main(String[] args) in D:\WebWindow-master\samples\HelloWorldApp\Program.cs:line 10

内部异常 1:
DllNotFoundException: Unable to load DLL 'WebWindow.Native' or one of its dependencies: 找不到指定的程序。 (0x8007007F)

Suggestion: Window resize event on monitor change

Moving the window from one screen to another with a different DPI, won't resize the app. A quick resize of the window and the app resizes (font-size, etc.).

Perhaps the WebWindow should auto-trigger a single resize event (or similar to cause re-render) when it notices a movement from one screen to another?

WebWindow Size & Positioning

Please consider adding support for changing/setting height/width and top/left of the WebWindow as well as z-ordering of the WebWindow.

It would also IMHO be good to have support for multi-monitor so to open WebWindow on a given monitor

System.TypeInitializationException Message=The type initializer for 'WebWindows.WebWindow' threw an exception.

When running any of the sample apps on Windows 10 I'm getting this exception:

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'WebWindows.WebWindow' threw an exception.
Source=WebWindow
StackTrace:
at WebWindows.WebWindow..ctor(String title)
at VueFileExplorer.Program.Main(String[] args) in C:\repos\Karl Personal\WebWindow\samples\VueFileExplorer\Program.cs:line 14

Inner Exception 1:
DllNotFoundException: Unable to load DLL 'WebWindow.Native' or one of its dependencies: The specified module could not be found. (0x8007007E)

Thank you for looking into this.

Does not work with p:PublishSingleFile

First of all: This is a great tool, thanks! But when i am building the app like this dotnet publish -c Release --framework netcoreapp3.0 --runtime win-x64 /p:PublishSingleFile=true the index.html file cannot be reached. I don't know if this is a problem with the bundler or in the application when the file is being resolved.

Suggestion: OnExit Event

This would be another event which would fire upon window exit and would be useful to handle events for the closing of a window rather than having to depend upon WaitForExit()

PublishSingleFile, including wwwroot?

Hi! Would it be feasible to make the web assets an embedded resource and extract on first load? Or even mimic a virtual file system to the browser? Interested in .Net Core single-file publishing for copy-paste portable desktop apps.

Benefit over PWAs?

I am wondering what is the benefit over PWA Blazor apps? Is this project not limited to the browser api too and can't access the system functions like disks and tasks?

Edit: Nice, this allows full system access. Even in the razor files!

Some keyboard keys not working on input fields

Arrow keys for navigation through the text do not work on input and textarea fields. Also "control + a" does not work. So there is no possibility for selecting or navigating through the text with keyboard only.

Tested on Windows 10.

Cycle Detected with dotnet add

I am trying to use the pre-built nuget package, and when I add it via the CLI, I get

Error NU1108 Cycle detected.
WebWindow -> WebWindow (>= 0.1.0-20191120.6). WebWindow C:\dev\WebWindow\WebWindow\WebWindow.csproj 1

Not sure what could be the cause of this. I have node and C++ installed

Support for ARM/ ARM64

Greetings,

and thank you for this amazing project.

Would it be possible for you to add support for ARM/ ARM64? Currently only native artifacts for linux-x64, osx-x64 and win-x64 are generated, making it impossible for usage on devices such as a Raspberry Pi.

Thanks in advance and best regards
-Simon

Windows OS versions support

Attempting to run on Windows Server 2016 Datacenter with Edge Beta installed. I have not logged in/out and restarted the server after installing the Edge browser. Does that matter? Is it suppose to work on Windows Server 2016?

What OS versions has been tested and verified to work?

System.DllNotFoundException: Unable to load DLL 'WebWindow.Native' or one of its dependencies: The specified module could not be found.

Can't get the blazor sample to work

I can't seem to get the blazor sample to work. the other sampes (normal html and vue.js) work just fine. but when i open the blazor one the it show's the edge bug :

Hmmm… can't reach this page
It looks like the webpage at https://app/ might be having issues or it may have moved permanently to a new web address.
ERR_NAME_RESOLUTION_FAILED

what to do?

Supporting mobile

What about mobile (Android / iOS)? Could this technology be adapted to also support building mobile apps. It would be exciting if one could build existing Blazor app to mobile app.

It would be a sort of alternative to PWA. The PWA experience is still not super great on most platforms. Hopefully it will get there so there would be no need for alternate solutions but oh well.

Multiple windows

I've been playing around with the library, and I can't get a second window to display correctly. It can show the second window, but will only attempt to navigate after the main window is closed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.