OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 document.body.innerHTML = ""; | 5 document.body.innerHTML = ""; |
6 | 6 |
7 function addButton(name, cb) { | 7 function addButton(name, cb) { |
8 var a = document.createElement("button"); | 8 var a = document.createElement("button"); |
9 a.innerText = name; | 9 a.innerText = name; |
10 a.onclick = cb; | 10 a.onclick = cb; |
(...skipping 30 matching lines...) Expand all Loading... |
41 chrome.extension.onMessage.addListener(function(msg, _, sendResponse) { | 41 chrome.extension.onMessage.addListener(function(msg, _, sendResponse) { |
42 log("Got message from background page: " + msg); | 42 log("Got message from background page: " + msg); |
43 }); | 43 }); |
44 | 44 |
45 var logDiv = document.createElement("div"); | 45 var logDiv = document.createElement("div"); |
46 logDiv.style.border = "1px dashed black"; | 46 logDiv.style.border = "1px dashed black"; |
47 document.body.appendChild(document.createElement("br")); | 47 document.body.appendChild(document.createElement("br")); |
48 document.body.appendChild(logDiv); | 48 document.body.appendChild(logDiv); |
49 | 49 |
50 log("Ready."); | 50 log("Ready."); |
OLD | NEW |