OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
Devlin
2015/10/30 01:21:43
nit: no (c)
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 var port = chrome.runtime.connect(); | |
6 port.postMessage('Hello from content script'); | |
7 port.disconnect(); | |
8 | |
9 chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { | |
Devlin
2015/10/30 01:21:43
this seems like a subtle race condition - can we r
robwu
2015/10/30 10:15:49
This can't race because the message has to go to a
Devlin
2015/10/30 16:03:51
Generally in testing, though, we don't want to rel
| |
10 sendResponse('Reply here'); | |
Devlin
2015/10/30 01:21:43
Is it worth verifying the message? Probably not n
| |
11 }); | |
OLD | NEW |