jdiamond / chrome-native-messaging Goto Github PK
View Code? Open in Web Editor NEWTransform streams for writing Chrome App native messaging hosts in Node.js
Transform streams for writing Chrome App native messaging hosts in Node.js
Sorry if this seems naive,
I've read: https://github.com/jdiamond/chrome-native-messaging/blob/master/host/my_host.js
and implemented it in code and the application runs ok, but doesn't seem to output anything when I run it just stays open
How do I get my node app to output a single message to chrome extension that meets the criteria of "JSON, UTF-8 encoded and is preceded with 32-bit message length in native byte order" using this package?
When I run connectNative, And then run sendNativeMessage.
Nothing happen!
Can you tell me how to debug my_host.js?
I see 100% CPU usage when connected and keep the connection open on a process node
Do we have any work around for that?
When I use my_host.js
, occur error: Failed to connect: Native host has exited.
Currently this only works on Mac as far as I can tell.
This is one of the coolest projects I've seen in a while. If you have any thoughts on how to make this work on Windows and Linux I'd love to hear!
Hi,
Sample is not working in mac. Do we need any special permisison ???
-Manivannan
node test.js
results in:
TAP version 13
# Input
(node:9368) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
ok 1 should be equal
C:\Projects\NativeMessaging\New\node_modules\tape\index.js:75
throw err
^
TypeError: Cannot read property 'foo' of null
at Input.<anonymous> (C:\Projects\NativeMessaging\New\test.js:18:21)
at Input.emit (events.js:182:13)
at emitReadable_ (_stream_readable.js:534:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Tests work with Node 8.11. I haven't tried running the application though.
In the example host
directory, the windows manifest file points to a my_host.bat
script that fires my_host.js
. I'm attempting to replace my_host.bat
with a myservice.exe
Windows Service created with node-windows. i.e., rather than using a one-off script as the wrapper around my native messaging my_host.js
script, I'm trying to use a long-running windows service.
I'm able to create the service and register it as a host after modifying and running host\register.bat
(and also main.js
in the app/
folder). But when I try to "connect" to the host from the example app, a Windows permissions warning pops up:
"do you want to allow this app from an uknown publisher to make changes to your device?"
<my_service_executable.exe>
Program location: "C:\Users\me\code\chrome-native-messaging\daemon\my_service_executable.exe --parent-window=3998946 chrome-extension://<id>/`
Once I approve, the chrome extension disconnects from the host and subsequent attempts return the same result.
This isn't exactly an issue with this library, so apologies for the tangent and feel free to close the issue if it's totally irrelevant. Just thought I'd solicit some feedback here in case anybody has attempted something similar. I'd be happy to submit a PR if that would be helpful in solving my issue. Thanks!
Hi!
Glad to be able to get this working on general webextensions.
Sorry, I'm a little green with streams...
I'd be grateful for any clarification on whether and how one can send messages from a Node native messaging app back to the browser when not in response to a message from the browser.
I see that this works:
const output = new nativeMessage.Output();
output.end('some msg');
output.pipe(process.stdout);
...but I'm wondering whether there are:
end
and just calling write
as long as the extension is open? (I intend to have a server or socket which can listen for the user opening a desktop file with a Node executable, and when it receives such a command, pass on the file data into the browser add-on which will pass it onto a designated webapp, allowing one to have desktop files opened directly into web apps without a need for drag-and-drop)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.