| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // This is the content page script. This runs in the context of the browser |
| 6 // page, and communicates with the background page by relaying an getMessages |
| 7 // request, and the forwarding the messages back to the browser page as a |
| 8 // gotMessages message. |
| 9 window.addEventListener("message", function(event) { |
| 10 if (event.source == window && event.data == "getMessages") { |
| 11 chrome.extension.sendRequest({command: "getMessages"}, function(messages) { |
| 12 window.postMessage({ "type": "gotMessages", "messages" : messages}, "*"); |
| 13 }); |
| 14 } |
| 15 }, false); |
| 16 |
| OLD | NEW |