How Facebook Chat Stays Open and in the Same Place When You Navigate Pages

How Facebook Chat Stays Open and in the Same Place When You Navigate Pages

Please, before answering:

1-I know Ajax well, and the current implementation on Facebook is not normal Ajax , as it was in the past.

2 - the page URL does not completely change part of the hash, and the whole page reloads, but not the chat window or panel.

I found that the URL changes through this part of JS:

history.pushState({},"New Title Goes Here","http://facebook.com/Something"); 

But what about the data itself, how does it fail? Network-> XHR in Firebug or Chrome doesn't display anything in XHR. so I think this is not Ajax.

+7
source share
1 answer

Looks like a lot of ajax to me.

enter image description here

They are selective when they reload the chat window. That is: if you go to your account settings and other pages with less travel.

To load the chat window itself, I am sure that they use a long poll (comet).

+1
source

All Articles