Phantomjs page.onConsoleMessage doesn't log warnings
问题 I'm using Phantomjs to detect errors/warnings on my pages by hooking console messages : page.onConsoleMessage = function(msg, line, source) { console.log(msg); } page.open(page.address, function (status) { if (status !== 'success') { console.log('Fail to load the address'); } else { for(var i=0;i<page.errors.length;i++) { console.log(page.errors[i]); } } phantom.exit(); }); It works fine with the errors, but it does not record the warnings. By errors and warnings, I mean what Chrome console