1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Content script that echoes back all messages.
6 // Posting a message with "GET" returns the name and # of connections opened.
9 chrome.runtime.onConnect.addListener(function onConnect(port) {
11 port.onMessage.addListener(function onMessage(msg) {
13 port.postMessage({"name": port.name, "connections": connections});
15 port.postMessage(msg);
20 chrome.extension.onRequest.addListener(function(request, sender, respond) {