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 function StartRequest() {
6 var plugin = document.getElementById("plugin");
7 var filename = document.getElementById("filename").value;
8 plugin.postMessage(filename);
11 function HandleMessage(message_event) {
12 document.getElementById("content").value = message_event.data;
15 document.addEventListener('DOMContentLoaded', function () {
16 // Attach a listener for the message event. This must happen after the plugin
17 // object was created.
18 document.getElementById("plugin")
19 .addEventListener("message", HandleMessage, false);
21 document.getElementById("start")
22 .addEventListener("click", StartRequest, false);