Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 function canXhr(url) { | |
|
not at google - send to devlin
2015/02/05 22:40:23
you might get a copyright header presubmit fail if
Devlin
2015/02/06 18:59:53
Done.
| |
| 2 var xhr = new XMLHttpRequest(); | |
| 3 xhr.open('GET', url, false); | |
| 4 var success = true; | |
| 5 try { | |
| 6 xhr.send(); | |
| 7 } catch(e) { | |
| 8 success = false; | |
| 9 console.error(e); | |
|
not at google - send to devlin
2015/02/05 22:40:23
Do you really want to be logging this?
(also same
Devlin
2015/02/06 18:59:53
Nope!
| |
| 10 } | |
| 11 return success; | |
| 12 } | |
| 13 | |
| 14 document.addEventListener('DOMContentLoaded', function() { | |
| 15 chrome.runtime.sendMessage({message:'xhr'}, function(response) { | |
| 16 var success = canXhr(response.url); | |
| 17 chrome.runtime.sendMessage({success:success}); | |
| 18 }); | |
| 19 }); | |
| OLD | NEW |