How do I use JavaScript to store “XHR finished loading” messages in the console in Chrome?
问题 I'm looking for a way to use JavaScript to store debug messages that appear in the Chrome console when xmlhttprequests are performed. Example output provided below: Thanks in advance! 回答1: You cannot read console messages from JavaScript. You will not be able to read these messages. However, using the same general concept as John Culviner's answer to Add a “hook” to all AJAX requests on a page, you can detect the events in JavaScript that cause these messages to appear. (function() { var