Open LeoIannacone opened 9 years ago
We may need to change the host to get plugin work properly with Firefox.
It seems Firefox does not have a simple "pipe" process API (that's what we do in chrome/ium), so we cannot simple write/read to the stdin/stdout of a Process. Some code has been written here https://github.com/bit/subprocess to handle with this scenario, but I prefer to look for another solution rather than include that in our code.
So, the other solution could be, instead of read/write (pipe) the goopg_native_process, make a HTTP server which parses the request URL and serves the result into socket.
For instance, extension does a GET over:
http://localhost:40094/gmail/command=verify&id=123456789abcdef
the host (the http_server) parse the URL, handles the command, and return the result in a JSON format
{
"command": "verify",
"id": "123456789abcdef"
"result": {
// Here the result
}
}
Messages are already exchanged in JSON fomat, so what we have to do is just modify the host/*main.py script...
Thoughts ?
If you modify the host, consider adding error message text to the info sent back to the browser, for presentation.
It seems that calling py is possible also in firefox
Extension examples:
Here a snip on how to call Py: