This script enables you to test your Native Messaging setup by allowing you to send arbitrary commands to your executable and to see the response in plain old text.
native.pl [options] -- host_binary [command]
Options:
-h, --help Display a help message
-t, --time Enable output of timing information
- Read from stdin instead of argument list
Where:
host_binary
is a path to your host executable--
separates options from parameterscommand
is the string that will be sent to your host (can contain spaces)
Note: When reading from stdin, currently only the first line is interpreted.
(Using browserpass)
$ ./native.pl ~/browserpass/browserpass {\"action\": \"search\", \"domain\": \"github.com\"}
Request: | {"action": "search", "domain": "github.com"}
Result: | ["github.com\\chrboe"]
Errors: | -
Or reading from stdin (notice how only the first line is evaluated):
$ cat commands.txt
{"action": "search", "domain": "github.com"}
{"action": "search", "domain": "google.com"}
{"action": "search", "domain": "facebook.com"}
{"action": "search", "domain": "twitter.com"}
$ ./native.pl ~/browserpass/browserpass.exe < test.txt
Request: | {"action": "search", "domain": "google.com"}
Result: | ["github.com\\chrboe"]
Errors: | -