Index: chrome/common/extensions/docs/examples/api/messaging/timer/popup.js |
diff --git a/chrome/common/extensions/docs/examples/api/messaging/timer/popup.html b/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js |
similarity index 76% |
copy from chrome/common/extensions/docs/examples/api/messaging/timer/popup.html |
copy to chrome/common/extensions/docs/examples/api/messaging/timer/popup.js |
index e20e799a5e98a08bc498005bc59f8d31458f6cc1..c213baf18b0827d4a3a03f2157df1476627d2af1 100644 |
--- a/chrome/common/extensions/docs/examples/api/messaging/timer/popup.html |
+++ b/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js |
@@ -1,15 +1,7 @@ |
-<head> |
-<style> |
-tr { |
- white-space: nowrap; |
-} |
-.results { |
- text-align: right; |
- min-width: 6em; |
- color: black; |
-} |
-</style> |
-<script> |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
if (!chrome.benchmarking) { |
alert("Warning: Looks like you forgot to run chrome with " + |
" --enable-benchmarking set."); |
@@ -61,17 +53,10 @@ function testConnect() { |
}); |
}); |
} |
-</script> |
-</head> |
-<body> |
-<table> |
- <tr> |
- <td><button onclick="testRequest()">Measure sendRequest</button></td> |
- <td id="resultsRequest" class="results">(results)</td> |
- </tr> |
- <tr> |
- <td><button onclick="testConnect()">Measure postMessage</button></td> |
- <td id="resultsConnect" class="results">(results)</td> |
- </tr> |
-</table> |
-</body> |
+ |
+document.addEventListener('DOMContentLoaded', function() { |
+ document.querySelector('#testRequest').addEventListener( |
+ 'click', testRequest); |
+ document.querySelector('#testConnect').addEventListener( |
+ 'click', testConnect); |
+}); |