Facebook messenger privacy with Google Chrome.

Among my friends I’m known for two things — making websites work really fast, and also not trusting Chrome extensions. So when friend of mine asks me to check if Chrome extensions is worth installing, I open my CRX Viewer and check the code for suspicious stuff. If friend is asking for an extension, I usually write one and publish it open-source.

So I was approached with a request for light Chrome extension that works on Facebook and prevents the other side seeing when you’re typing, or seen a message.

I monitored the requests Facebook is making while using the messenger and noticed two interesting get requests:

https://www.facebook.com/ajax/mercury/change_read_status.php?dpr=1

https://www.facebook.com/ajax/messaging/typ.php?dpr=1

The names and the payloads looked promising, so I decided to test what will happen if I block the requests. It worked.

With this data as a starting point, I started thinking how to block the requests in Chrome. It turns out that Chrome developer tools are supporting request blocking, but not out of the box. There are few steps for revealing the menu:

Navigate to chrome://flags/#enable-devtools-experiments and enable devtools experiments. Relaunch Chrome.

Open Developer tools. Open Settings panel ( Hit F1, or fn+F1 on Mac ). Now there should be brand new “experiments” panel.

Next step may look a little bit weird for a web developer ( Android developers will not be surprised ), but hit Shift key six times. Now you should see “hidden” developer tools, including the one we need — request blocking. So, check request blocking.

Now, go to facebook.com and open devtools. Request blocking panel should appear next to the console. Add these patterns, using the + sign in the bottom left:

*://*.facebook.com/*change_read_status*
*://*.messenger.com/*change_read_status*
*://*.facebook.com/*typ.php*
*://*.messenger.com/*typ.php*

If you cant see the panel, find it by pressing Cmd+Shift+P ( on mac ) and search for “blocking”

Once the patterns are added, Chrome will block requests that match the patterns:

That’s all! As time of writing ( May 2017 ) this method is working for my friend. I cannot guarantee that it will work with you by the time of reading.

Note that the blocking is valid only for the current session, so if you want the functionality to be persistent, Chrome extension or editing .host file would be a better option.

In the next article I will tell you little bit more of how I wrote future proof Instagram downloader in just 5 lines of JavaScript code, so if you are interested — like and subscribe.