OLD | NEW |
(Empty) | |
| 1 // Copyright 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. |
| 4 |
| 5 // The test extension for externally_connectable just echos all messages it |
| 6 // gets. The test runners are in the sites/ directory. |
| 7 |
| 8 chrome.runtime.onMessageExternal.addListener(function(message, sender, reply) { |
| 9 reply({ message: message, sender: sender }); |
| 10 }); |
| 11 |
| 12 chrome.runtime.onConnectExternal.addListener(function(port) { |
| 13 port.onMessage.addListener(function(message) { |
| 14 port.postMessage({ message: message, sender: port.sender }); |
| 15 }); |
| 16 }); |
OLD | NEW |