15

How do I disable Facebook chat availability? My chat is offline and I am using Windows 7 with Firefox. When I login with my other account through my mobile Facebook and open a chat conversation I see the account that I use on my computer is active "just now" whenever I move the mouse or refresh the page.

How do I disable that? Is there some specific heartbeat message that is possible to be blocked through AdBlock Plus or something?

11

Okay I have found the solution to block this status.

Basically Facebook uses a timer and so it will send a heartbeat message to their servers with the idle time every x minutes.

Here is an example of such web request:

https://1-edge-chat.facebook.com/pull?channel=userid&seq=0&partition=-2&clientid=18ae8ecc&cb=ie3k&idle=117&qp=y&cap=8&msgs_recv=0&uid=userid&viewer_uid=userid&msgr_region=FRC&state=offline

If you read that link you'll see that &idle=117 is the total seconds the account has been idle for. The state=offline stands for whether the chat is active or offline

Note that I have replaced my userid which is a number of 15 digits.

So to disable this just add the following rule in your AdBlock filters:

https://*-edge-chat.facebook.com

One drawback of this method is that you will not receive messages in real time. You must refresh the page to get the messages.

  • 1
    Would something like this work in Safari with iOS 9 content blockers? – user13779 Oct 20 '15 at 13:23
0

Since I'm providing additional details, I'm writing my own answer based on the original (instead of editing it).

Yes, there is a way to do this, but this method works only for the web-based Facebook and Messenger; you can't do something similar for the mobile apps.

Basically, Facebook uses timed requests on the server side to check if the client is still available. So the front end (loaded Facebook web page) will periodically send an HTTP request (XHR) with the idle time to their servers.

Here's an example of such request:

https://1-edge-chat.facebook.com/pull?channel=p_<UserID>&seq=0&partition=-2&clientid=18ae8ecc&cb=ie3k&idle=117&qp=y&cap=8&msgs_recv=0&uid=userid&viewer_uid=userid&msgr_region=FRC&state=offline

Note: I've replaced the user ID which normally would be a number.

If you read the URL above, you'll see the part saying idle=117. This denotes the total number of seconds the account has been idle for. The state=offline stands for whether the chat is turned on or off.

So, to disable this, just add the following rule to your ad blocker's custom list of filters:

||*-edge-chat.facebook.com^$xmlhttprequest

To disable on both, Facebook and Messenger, you can add the following two lines:

||*-edge-chat.facebook.com^$xmlhttprequest
||*-edge-chat.messenger.com^$xmlhttprequest

Or the single line, using regex:

/^https?\:\/\/\d+-edge-chat\.(facebook|messenger)\.com\/?/$xmlhttprequest

A few drawbacks of this method are that you'll not be able to receive messages in real time and you'll not appear online even if the chat is on. You'll have to refresh the page to receive new messages.

In order to avoid both of these drawbacks, here's one workaround. You can add this line instead:

/^https?\:\/\/\d+-edge-chat\.facebook\.com\/pull\?.*state=offline/$xmlhttprequest

Or, add this for both, Facebook and Messenger:

/^https?\:\/\/\d+-edge-chat\.(facebook|messenger)\.com\/pull\?.*state=offline/$xmlhttprequest

The end result of this will be the following:

  1. When your chat is off, you'll not appear online, your last activity won't be reported, and you won't be able to receive messages in real time.
  2. When your chat is on, you will appear online, your last activity will be reported, and you'll be able to receive messages in real time.

Unfortunately, there seems to be no other solution since Facebook's front end can fetch messages only when the client periodically reports that they're active, hence the fetching is done once the last activity is reported. Both of these actions are made possible by a single back-end script (*-edge-chat.facebook.com/pull), through the same request; therefore, you can't have one without the other.

-2

I reset Chrome which disabled my extensions and works fine now.

protected by Community Nov 16 '17 at 0:20

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.