Discussions » Demandes de création de scripts

Change firefox user agent on whatsapp web

§
Posté le: 2015-02-03

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
§
Posté le: 2015-02-03

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
§
Posté le: 2015-04-25
Édité le: 2015-04-25

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'
});
§
Posté le: 2017-07-01

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

§
Posté le: 2017-07-02
Édité le: 2017-07-02

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.

Poster une réponse

Connectez-vous pour poster une réponse.