javascript - Making Chrome App interact with Chrome Extensions -
well question pretty proper way listen tcp server in chrome extension
but problem question above not answered, , questions persists.
so, there way make chrome app interact chrome extension. purposes question referenced above, in resume it's building tcp server , manage content in tab web page.
well far know there's no way of doing that, because chrome app not have access web page content , chrome extensions not allowed use sockets.
so ideas welcome. in advance.
despite being called "cross-extension messaging", works between extensions , apps.
presumably, you'll want long-lived connections; can use:
// in 1 app/extension initiates connection // (probably app upon new client connecting) var port = chrome.runtime.connect(secondid); // in other app/extension chrome.runtime.onconnectexternal.addlistener(function(port) { port.onmessage.addlistener(function(msg) { // see other examples sample onmessage handlers. }); });
remember want make sure connection comes trust. while imperfect defense, should check originator's extension/app id - whether in code or filtering rest out externally_connectable
manifest key (default permissive).
Comments
Post a Comment