Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Check for support | |
|
Mike West
2012/01/27 16:06:32
Copyright.
| |
| 2 if (window.chrome && window.chrome.app && window.chrome.app.isInstalled) { | |
| 3 document.getElementById('supported').className = ''; | |
| 4 } else { | |
| 5 document.getElementById('unsupported').className = ''; | |
| 6 } | |
| 7 var bgWinUrl = "background.html#yay"; | |
| 8 var bgWinName = "bgNotifier"; | |
| 9 | |
| 10 function openBackgroundWindow() { | |
| 11 window.open(bgWinUrl, bgWinName, "background"); | |
| 12 } | |
| 13 | |
| 14 function closeBackgroundWindow() { | |
| 15 var w = window.open(bgWinUrl, bgWinName, "background"); | |
| 16 w.close(); | |
| 17 } | |
| 18 | |
| 19 document.addEventListener('DOMContentLoaded', function() { | |
| 20 document.querySelector('#openBackgroundWindow').addEventListener( | |
| 21 'click', openBackgroundWindow); | |
| 22 document.querySelector('#closeBackgroundWindow').addEventListener( | |
| 23 'click', closeBackgroundWindow); | |
| 24 }); | |
| OLD | NEW |