Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 (function() { | |
|
rlarocque
2012/03/29 22:54:27
I don't think this is good style, though I'm not s
lipalani1
2012/03/29 23:58:37
ha ha I dont know either. I just copied from other
akalin
2012/03/30 01:55:04
This is the 'Javascript way' of avoiding pollution
| |
| 6 var trafficToTextButton = document.getElementById('traffic-to-text'); | |
| 7 var trafficDump = document.getElementById('traffic-dump'); | |
| 8 trafficToTextButton.addEventListener('click', function(event) { | |
| 9 chrome.sync.getClientServerTraffic(printData); | |
| 10 }); | |
| 11 | |
| 12 function printData(trafficRecord) { | |
| 13 var traffic_data = ''; | |
| 14 traffic_data += '===\n'; | |
| 15 traffic_data += 'Client Server Traffic\n'; | |
| 16 traffic_data += '===\n'; | |
| 17 traffic_data += JSON.stringify(trafficRecord, null, 2); | |
| 18 traffic_data += '\n'; | |
| 19 | |
| 20 trafficDump.textContent = traffic_data; | |
| 21 } | |
| 22 })(); | |
| OLD | NEW |