Viewing HTML response from Ajax call through Chrome Developer tools?

后端 未结 6 2004
生来不讨喜
生来不讨喜 2021-01-03 23:33

So in my javascript I\'m making an ajax call to a service on my website. Whoops, something fails. No problem. Here\'s what I\'d do in Firefox:

  1. Open the fire
6条回答
  •  有刺的猬
    2021-01-04 00:14

    You could download autohotkey and write a quick macro to do the steps needed to see the XHR response in a browser window...

    Here's a script I wrote in autohotkey that if you press the middle mouse button (mousewheel button) inside that response window in Chrome's Developer Tools > Network tab, it will do these steps:

    1. Right click...click save as
    2. Paste file location into file prompt and press Enter
    3. Open the file (uses default browser)
    4. Delete the file

      MButton::
      MouseClick, right
      MouseGetPos, xpos, ypos
      xpos := xpos + 5
      ypos := ypos + 5
      MouseMove, xpos, ypos
      MouseClick, left
      Sleep, 500
      ClipSaved := ClipboardAll
      Clipboard := "C:\Users\David\Desktop\temp_xhr_response.html"
      Send, ^v  {Enter}
      Clipboard = %ClipSaved%
      sleep, 500
      Run, open "C:\Users\David\Desktop\temp_xhr_response.html"
      sleep, 1000
      FileDelete, C:\Users\David\Desktop\temp_xhr_response.html
      return
      

    This should hold you over til Google releases an update for better viewing for HTML responses. I'm not using FF's FireBug anymore, it's become incredibly slow!

提交回复
热议问题