Discussions » Creation Requests

Change firefox user agent on whatsapp web

§
Posted: 03 Februari 2015

Change firefox user agent on whatsapp web

i tried to change firefox user agent on whatsapp web:
// ==UserScript==
// @name Change User-Agent for WhatsappWeb
// @version 1
// @match https://web.whatsapp.com/
// @user-agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.35 Safari/537.36
// ==/UserScript==

but it didnt work any ideas??

woxxomMod
§
Posted: 03 Februari 2015

Greasemonkey API documentation doesn't mention @user-agent tag. As far as I know, the only solution is to use an addon, for example, UAControl.

woxxomMod
§
Posted: 25 April 2015
Edited: 25 April 2015

The code you found should work on Chrome with Tampermonkey.

For Firefox try using this:

// ==UserScript==
// @name Change User-Agent for WhatsappWeb
// @version 1
// @match https://web.whatsapp.com/*
// ==/UserScript==

Object.defineProperty(navigator, 'userAgent', {
    value: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.35 Safari/537.36'
});
§
Posted: 01 Juli 2017

It doesn't work for me. Matching this with http://whatsmyuseragent.org/ doesn't change the result on that site.

§
Posted: 02 Juli 2017
Edited: 02 Juli 2017

I don't think you need a user-script for this. You should be able to change your user agent on websites by going to about:config and making an entry like "general.useragent.override.google.com" to use google as an example, with a string value of the user agent you want. Or just "general.useragent.override" if you want to change it universally.

Post reply

Sign in to post a reply.