acandylevey / nativemessaging Goto Github PK
View Code? Open in Web Editor NEWC# Chome Native Messaging Library
License: MIT License
C# Chome Native Messaging Library
License: MIT License
Hi ..
I saw that the code getting messages from chrome and response to the message
but , is it possible to send messages to the chrome seperatly?
Regards
Yuval
Should this
var buffer = new char[BitConverter.ToInt32(lengthBytes, 0)];
be
var buffer = new char[BitConverter.ToUInt32(lengthBytes, 0)];
The buffer char array if pretty large and hence while converting it to string in the Jsonconverter parameter getting an exception out of memory.
will this make it possible to add extensions to uwp webview2 app
As per title, can the nuget package be updated (or a new submission made if updating that one is not possible) to include the fact that Dotnet6 is supported?
The current nuget version actually seems to work ok, but I'm getting warnings in vscode because it doesn't declare that it supports dotnet6, e.g. the microsoft C# plugin reports errors on load and outputs:
Error: Package 'NativeMessaging 2.0.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0-windows7.0'. This package may not be fully compatible with your project.
and dotnet build
gives:
warning NU1701: Package 'NativeMessaging 2.0.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,V
ersion=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the
project target framework 'net6.0-windows7.0'. This package may not be fully compatible with your project.
Thanks!
Is there any plan to add support for Firefox?
The example code for main should contain
Host.SupportedBrowsers.Add(ChromiumBrowser.GoogleChrome);
Host.SupportedBrowsers.Add(ChromiumBrowser.MicrosoftEdge);
In order to function.
There are tab open, tab close, tab update events, that we can send the events to host app. Is it possible to sent the click events that we click in the browser to the c# host app?
Hi - I didn't know how else to contact you. This link on the homepage:
results in a not found error. Is that example somewhere to be found?
Thank you
I've created a .net 7 console app using your package, but when I call GenerateManifest
it's registering my dll instead of my exe:
"path": "C:/Source/Repos/HAVA Card/HAVACard.Server/bin/Debug/net7.0/HAVACard.Server.dll",
I have made a few modifications to port NativeMessaging to .Net 6 for a small project. They are here: https://github.com/AlbertoPa/NativeMessaging. If you think they are useful or want to merge them, let me know and I can make a PR.
I also plan to add a small example of extension, since the one linked in the code is not available anymore.
Thanks for your work!
The .exe gets launched when I use the example chrome extension and press "connect" but when I press send the c# program doesn't do anything
public class ChromeServerHost : Host
{
private const bool SendConfirmationReceipt = true;
public override string Hostname
{
get { return "com.google.chrome.example.echo-manifest.json"; }
}
public ChromeServerHost() : base(SendConfirmationReceipt)
{
}
protected override void ProcessReceivedMessage(JObject data)
{
Console.WriteLine("HELLO");
SendMessage(data);
}
}
Then in main I have
ChromeServerHost host = new ChromeServerHost();
host.Listen();
It is registered correctly,
private JObject Read()
{
Utils.LogMessage("Waiting for Data");
var stdin = Console.OpenStandardInput();
var lengthBytes = new byte[4];
Console.WriteLine("HELLO1");
stdin.Read(lengthBytes, 0, 4);
Console.WriteLine("HELLO2");
var buffer = new char[BitConverter.ToInt32(lengthBytes, 0)];
using (var reader = new StreamReader(stdin)) while (reader.Peek() >= 0) reader.Read(buffer, 0, buffer.Length);
return JsonConvert.DeserializeObject<JObject>(new string(buffer));
};
Hello1 gets printed but not hello2, also the logger never logs "Data Received:"
I really like what you have done here but could you provide a sample console application that uses this library to communicate with the example Chrome extension that you made? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.