LeoIannacone / goopg

GPG for Gmail in Chrome and Chromium
http://leoiannacone.github.io/goopg/
GNU General Public License v3.0
53 stars 5 forks source link

Write the firefox extension #8

Open LeoIannacone opened 9 years ago

LeoIannacone commented 9 years ago

It seems that calling py is possible also in firefox

Extension examples:

Here a snip on how to call Py:

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5894533-write-the-firefox-extension?utm_campaign=plugin&utm_content=tracker%2F2238151&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2238151&utm_medium=issues&utm_source=github).
LeoIannacone commented 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 ?

davesteele commented 7 years ago

If you modify the host, consider adding error message text to the info sent back to the browser, for presentation.