Viewing HTML response from Ajax call through Chrome Developer tools?

后端 未结 6 2052
生来不讨喜
生来不讨喜 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:13

    Since I noticed the right-click "save as" ability is no longer there on the Network>XHR>response tab ...I created a new auto-hotkey script: (click middle mouse button on the response text)

    MButton::
    MouseClick, left
    ClipSaved := ClipboardAll
    Send, ^a^c
    sleep, 500
    FileName := "C:\Users\David\Desktop\temp_xhr_response.html"
    file := FileOpen(FileName, "w")
    if !IsObject(file)
    {
    MsgBox Can't open "%FileName%" for writing.
    return
    }
    StringGetPos, pos, Clipboard, HeadersPreviewResponseCookiesTiming
    if pos = -1
    {
    pos = 0 
    }
    TestString := SubStr(Clipboard, pos+38)
    file.Write(TestString)
    file.Close()
    Run, open "C:\Users\David\Desktop\temp_xhr_response.html"
    Clipboard = %ClipSaved%
    sleep, 1000
    FileDelete, C:\Users\David\Desktop\temp_xhr_response.html
    return
    

提交回复
热议问题