Tangram icon indicating copy to clipboard operation
Tangram copied to clipboard

Not able to change user-agent in WhatsApp

Open CleoMenezesJr opened this issue 3 years ago • 12 comments

Trying to switch to user-agent to Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0. Screenshot from 2021-11-09 22-34-10

By writing the command navigator.userAgent in the console the output shows that the user-agent is still the same. Screenshot from 2021-11-09 22-34-35

Tangram version 1.3.2

Linux distribution Fedora 35

Flatpak version 1.12.2

Desktop environment GNOME 41.1 Wayland

CleoMenezesJr avatar Nov 10 '21 01:11 CleoMenezesJr

Can you please try if it works in Edit tab instead of Add tab?

sonnyp avatar Nov 10 '21 07:11 sonnyp

Can you please try if it works in Edit tab instead of Add tab?

I had already tested this and just tested it again to certify. It continues using the default user-agent. :/

CleoMenezesJr avatar Nov 10 '21 23:11 CleoMenezesJr

I'm not sure, I might have same problem with Soundcloud, can't confirm yet.

How did you get to that debug view? Like this ? >>

gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true
GTK_DEBUG=interactive ./run.sh

if yes, I think it's clearer to say debug in README.md. Anyway, not what I'm on a deadline, I'll check this out later

naim5am avatar Nov 15 '21 20:11 naim5am

Do you get anything helpful in the terminal when reproducing the issue?

FYI - you need to reload the tab for the change to take effect

@naim5am

How did you get to that debug view? Like this ? >>

That's the GTK Inspector, the view in the screenshot is the web inspector - you can access it with <Ctrl>Shift+I

sonnyp avatar Nov 20 '21 00:11 sonnyp

I can't reproduce. Please try again with Tangram 1.14 available on Flathub.

sonnyp avatar Nov 21 '21 15:11 sonnyp

I can't reproduce. Please try again with Tangram 1.14 available on Flathub.

Quite weird that. I've actually tested it in many possible ways. I have already uninstalled it with the --delete-data flag to ensure that there is no remnant of the old version, I installed version 1.4.0 which is available on Flathub and finally, besides creating a new tab, I edited it as suggested in your last comment.

The result remains the same. Could you show a video of you playing the same?

edit: it's quite strange because it's just not working with Whatsapp. image

CleoMenezesJr avatar Nov 21 '21 16:11 CleoMenezesJr

https://user-images.githubusercontent.com/19673/142770361-0534cce0-250f-47c9-b7b5-5571d8816ab6.mp4

sonnyp avatar Nov 21 '21 16:11 sonnyp

Ok I think I have found the issue - looks like WebkitGTK has a special user agent quirk for WhatsApp.

Can I ask why you need to change the user agent on WhatsApp ?

sonnyp avatar Nov 21 '21 16:11 sonnyp

For reference

https://github.com/WebKit/WebKit/blob/249d5fd6931d4730efda9e89676591ac3fa02993/Source/WebCore/platform/UserAgentQuirks.cpp#L101

A simple solution would be to disable quirks when user provides a custom user agent but those quirks are usually there to fix problems so I'm not sure it's such a good idea.

sonnyp avatar Nov 21 '21 16:11 sonnyp

Can I ask why you need to change the user agent on WhatsApp ? Message after login

It won't allow attaching photos, videos or recording voice notes unless it recognizes the browser as one of either Google Chrome, Firefor or Opera. Has anyone managed to record voice notes or send photos on WhatsApp via Tangram?

naim5am avatar Dec 20 '21 12:12 naim5am

Taking pictures or recording audio won't work with Tangram anyway - no matter the user agent.

Maybe try Epiphany if it supports it - then it should be trivial to add to Tangram.

sonnyp avatar Dec 20 '21 13:12 sonnyp

Does it still not work?

soumyaDghosh avatar Jan 24 '23 16:01 soumyaDghosh