Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: chrome/test/data/extensions/api_test/messaging/externally_connectable/web_connectable/background.js

Issue 16174005: Implement externally_connectable! Web pages can now communicate directly with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: absolute path... Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698