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 // This function is called by common.js when the NaCl module is
7 function moduleDidLoad() {
8 // Once we load, hide the plugin. In this example, we don't display anything
9 // in the plugin, so it is fine to hide it.
12 // After the NaCl module has loaded, common.naclModule is a reference to the
13 // NaCl module's <embed> element.
15 // postMessage sends a message to it.
16 common.naclModule.postMessage('hello');
19 // This function is called by common.js when a message is received from the
21 function handleMessage(message) {
22 var logEl = document.getElementById('log');
23 logEl.textContent += message.data;