Linux Showroom

My daily dosis of linux usage

How to add a custom user-agent string to Konqueror

Posted in Howto, KDE by Fabio on the March 29th, 2008

You can easily set a custom user-agent string for a specific site through a predefined list of user-agent strings. If you want to define your own custom user-agent string I did not find a gui for that. The solution I found is the following. Launch your favorite text editor and open the file

~/.kde/config/kio_httprc

Just add two lines to the file. Here is an example. I wanted Konqueror to identify as an iPhone for m.podcast.de. The original iPhone has the following user-agent string:

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3

So I added  the following two lines to the file

[m.podcast.de]

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3

That’s all. Save the file. Relaunch Konqueror and you are done!