tomer8007 / whatsapp-web-incognito

A Chrome extension that disables read receipts and presence updates on WhatsApp Web
MIT License
313 stars 74 forks source link

WhatsApp Standalone Support #7

Closed timea-techgirl closed 3 years ago

timea-techgirl commented 4 years ago

Hello,

Thanks for this tool. Can you support whatsapp standalone client?

Or can I unpack app.asar and inject these extension files to it? Would it work?

tomer8007 commented 4 years ago

I never worked with the Electron framework, but looks like there are plentry of resources on the internet for trying to insert Chrome extensions into Electron apps (like this, this and more).

I don't know whether or not the DOM is the same in the standalone app, though. That's an important question.

I can tell you that at least if you're trying to inject these files without Chrome-specific adaptations you'd have to fiddle with core_injection.js and background.js.

core_injection.js is the first file that runs as a content script and injects the other scripts to the real DOM, and it's using the chrome.extension API (so you'll need to change this line).

background.js uses Chrome APIs too to save the settings of the user persistently, so an alternative way of doing that would be needed.

Also it's important to make the overall injection so that core_injection.js will run before any other WhatsApp script, otherwise the WebSocketinterception won't work.

timea-techgirl commented 4 years ago

The app.asar can be found in the nupkg. https://web.whatsapp.com/desktop/windows/release/x64/WhatsApp-0.3.4479-full.nupkg

I opened it with winrar and extracted the app.asar with node.

What do I need to check and find out if it's the same. If it's not the same, you can close this issue. Not worth it.

tomer8007 commented 4 years ago

I would start by running document.getElementsByClassName("_3j8Pd") in the javasciprt console and see if I get all the menu items at the top.

If you get them, I think it's a pretty good indication it's the same.

timea-techgirl commented 4 years ago

Oh, I don't know how to do that, I'm not programmatically well-versed.