Signed-off-by: Bill Erickson <berickxx@gmail.com>
}
/**
+ * Respond to 'ping' requests to let the browser know we exist.
+ */
+chrome.runtime.onMessageExternal.addListener(
+ function(request, sender, sendResponse) {
+ if (request && request.ping) {
+ console.debug("Got 'ping' request from tab: " + sender.tab.id);
+ sendResponse({pong : true});
+ }
+ return true;
+ }
+);
+
+/**
* Called when a browser tab opens a connection to this extension.
*/
chrome.runtime.onConnectExternal.addListener(function(port) {