What is the simplest way to send text data from chro开发者_运维技巧me's javascript (running in a extension) and my external app? I saw XHR, but I don't want to use it cause it can be blocked by firewalls.
XHR is the way to go. It shouldn't be blocked by any firewall because it comes as a regular browser request, similar to retrieving external js file or image. Using anything else would look rather fishy.
You can implement HTML5 WebSockets. http://www.html5rocks.com/tutorials/websockets/basics/
On your external app, you define the WebSocket server (many many implementations out there for many languages). And you just connect through it in your Extension. You can specify any port you please by allowing your WebSocket to listen to it.
精彩评论