Simple way to change Firefox Useragent

1 post in this topic

Simple changing Firefox User-Agent using "FF.au3" without manual edit "prefs.js"

#Include <FF.au3>

If _FFConnect() Then
   ;Default User-Agent
   ;Set new User-Agent
   FFSetUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36")
   ;Reset to default User-Agent
   MsgBox(0, "", "Can't connect to FireFox!")

Func FFResetUserAgent()

Func FFSetUserAgent($useragent)
   _FFCmd("Ci=Components.interfaces;Cc=Components.classes;string=Cc[';1'].createInstance(Ci.nsISupportsString);'" & $useragent & "';Cc[';1'].getService(Ci.nsIPrefService).getBranch('general.useragent.').setComplexValue('override',Ci.nsISupportsString,string);")


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now