View the response body of a COMET event with Chrome Developer Tools - scala

Is it currently possible to view the body of the message being sent by a COMET event using Chrome Developer tools? I'm simply looking at COMET Clock sample here by Play Framework - http://www.playframework.com/documentation/2.2.x/Samples. When I enable the developer tools and go to the event-stream object, I can only see the request and response headers. No body or message can be viewed anywhere. Is this currently even possible? Nothing shows up under WebSockets, but I'm fairly sure this example is not using WebSockets, so that makes sense.

No. It is not possible for HTTP streaming (which I think it is your case) as March 2014 (hopefully they change this in the future)
Google Devtools only shows the response when the connection is closed.
In the case of web-sockets you do see live data.
But! modern versions of Firebug can show live data streaming. So I recommend you get Firefox and install the Firebug addon.
((Ahh firebug, it used to be all we had. Poor forgotten guy. But it still has nice things Chrome lacks!))
Cheers.

You can inspect the response from any HTTP request using the DevTools Network tab. To make finding your Comet request easier, select the XHR filter button at the bottom of the Network tab panel. You may need to reload the page after opening the Network tab to refresh the list of requests. Sometime it is necessary to switch back and forth between the All and XHR filters to see new requests that have been initiated since selecting the XHR filter. Once you have identified the request item, click to select it. On the right panel choose
Response from the taps at the top

Related

DevTools of Google Chrome. Hide all HTTP requests with 200 status in the Network tab

Is it possible to hide all HTTP requests with 200 status in the Network tab of DevTools in Google Chrome?
I want to control broken or problem requests while doing some modifications in Web sites.
The DevTools Network tab looks pretty well to have such filtering in place.
You can type -status-code:200 (notice the -) to give you the requests not with status code 200. The - negates the expression. For reference documentation on the filter you can check this and also read this tutorial.

Origin of AJAX request is DevTools

When I am debugging code I did not write in Chrome DevTools I look in the Network tab for XHR requests sent. Then I try to find where in the JS code the request is made.This is usually a pain and requires a lot of text searches to find where the request was made in the code. Is there a way jump to the line of code where the XHR request was made from the Network tab?
In developers console, under network tab you have initiator column. That should do the trick.

Is there any way to hide xmlhttprequest log from chrome console

In my project I'm sending GET request to the server and what I found my every request is displaying in the xmlhttprequest log (attached screenshot) and when you open this with the browser it will show all the data. I'm going to create an API key method for my rest API, While it also takes time, for now, I want to hide logs from the console. So my question is how to hide such types of the log from my chrome console.
From my point of view it is not possible to hide any request your are sending with ajax, and another thing is that it is not compulsory to use chrome browser to use, user can use different browser, showing console log is like this is in-build functionality, normal user will not see console log. if your are worried about developers there are many plugin(like firebug) which they can use to monitor your request/response flow. so if you find any way to hide them it's not 100% solution.
my advice would be you use server side method to call your API if possible.
or second thing you can do is call console.clear(); function after calling ajax function(possible after success/fail).
you can hide such messages in Chrome in Console > Settings
(F12 > F1)
Tick [x] Hide network messages
Untick [] Log XMLHttpRequests
You can change it in the Console Settings > Hide Network
Hide Network on Console Settings

google analytics receiving data vs. redirecting that causes NS_BINDING_ABORTED

Okay so first off, sorry if the title doesn't make much sense...I'm not sure how else to summarize it!
So here's the issue:
I am using jQuery to attach a click event to my form's submit button. The jQuery click event triggers some GA code to track a virtual page view so I can use it as a step in a Goal funnel.
But what happens is that there's no delay between the GA code executing and the submit, so I'm concerned that GA isn't actually getting the data.
When I look at what's happening in firebug or httpfox (browser addons that look at the requests/response) vs. charles proxy (external sniffer, separate from browser) I am seeing two different things.
With firebug/httpfox I see the GET request to GA but status of 0 and it is showing up as
(Aborted) NS_BINDING_ABORTED
...though it does show bytes having been sent etc.. just nothing for response.
But with charles proxy, I am seeing the same GET request with a status of 200 and the 1x1 pixel response.
So my theory here is that GA is receiving the data, but that the browser is moving on before it gets the actual response - which I'm okay with, as long as GA is getting the data, I'm okay with this. But it is just my theory and I don't know...
I know I can write the code to simply delay the execution of the submit by 500ms or whatever as insurance, but I don't wanna have to do that if it's not necessary..
And I know if nothing else I can just see if the data is showing up in GA but GA has a 24-48 hour delay on data so it is hard to QA.
Does anybody know or have any suggestions from experience...has anybody else experienced this "abort" thing and can say one way or the other if it is necessary to delay the submit or whatever?
HTTPFox is not a real sniffer. It just tries to mimic one. So the data you see on it is not always what is really happening in the background. Charles should get you a better picture. If you're seeing the 200 code in Charles. So the chances are that the hit is going through.
The bad news is that when you fire hits at the time the page unloads. (Outbound clicks, insite link clicks, form submissions, window.unload, etc) they won't go through every now and then. This happens because the Google Analytics JS Call basically appends a GIF to the page. And it returns after that. Than the browser will load the gif. When the code returns the browser is free to go, and if it goes away from the page it will cancel any pending requests that it may have, including that small GIF image. So the browser might haven't sent the tracking code, or might have sent it, but the TCP connection didn't go through and the browser would need to resend the package, but he's not willing to do it anymore.
So if accuracy is a need for you, you should add a 200-500 ms delay to it. But remember that Google analytics is not an Accuracy Tool, and if some events don't go through it won't probably affect the final outcome of your analysis.
According to the informatin on this page: Sending Data to Google Analytics there is a possibility that your data is not really being sent (the bad news, as Eduardo said). Transcribing the most important information of that page, related to your doubts:
Many browsers stop executing JavaScript as soon as the page starts
unloading, which means your analytics.js commands to send hits may
never run.
An example of this is when you want to send an event to Google
Analytics to record that a user clicked on a form's submit button. In
most cases, clicking the submit button will immediately start loading
the next page, and any ga('send', ...) commands will not run.
The solution to this is to intercept the event to stop the page from
unloading. You can then send your hit to Google Analytics as usual,
and once the hit is done being sent, you can resubmit the form
programmatically.

Preventing browser loading indicator with Chrome + GWT-rpc

I'm writing a ajax chatting webapp, just to test working with GWT.
To simulate server side push of chat messages from the server to the browser, I have a XHR request running behind. It all works fine - except on Chrome, the browser is displaying a loading icon (a spinner) because of the XHR request on background.
Is there any way to avoid this? I've tested it in Firefox, and it doesn't display such behavior.
EDIT - I found the solution. http://groups.google.com/group/google-web-toolkit/browse_thread/thread/a0330cb47e05c485?fwc=2
quoting the GWT groiup post:
Chrome shows the loading indicator if connection was made immediately
from the "body onload()", i.e. from onModuleLoad().
Chrome shows the loading indicator if connection was made immediately from the "body onload()", i.e. from onModuleLoad().
No, there is now way to disable this.
All AJAX requests cause Chrome to display this. I'm guessing it's for security reasons. (The user is aware of any AJAX requests that he/she might not be aware of.) Also, it indicates that data is being fetched - a type of status indicator.