UserAgent in KHTML

Waldo Bastian bastian at kde.org
Tue Jul 6 13:42:18 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue July 6 2004 14:27, Baumann, Thomas wrote:
> Hi there,
>
> does anyone know how to change the UserAgent KHTML uses?? We tried to to
> manipulate the MetaData of KParts::URLArgs in our version of
> KHTMLPart::open(), which was successful for all Documents.
>
> > KParts::URLArgs myargs;
> > QMap<QString, QString> & metaData = myargs.metaData();
> > metaData["UserAgent"] = "My UserAgent";
>
> Unfortunately, the images and all other stuff seem to be loaded using
> anything else, but not KHTMLPart::open() (which is good, of course ;)) )
>
> We also had a look at KProtocolManager, but there was just a possibility to
> get varios kinds of Konqueror-agents (You know, the ones with or without
> architechture, os etc.).
>
> Now we are completeley lost in the KDE-sources. There has to be a point to
> change the Agent globaly, isn't there?? So, can anyone help us changing the
> UserAgent to any string??
>
> Please help!!

See SlaveConfig in kio/slaveconfig.h Listen for the configNeeded() signal and 
when you get it call setConfigData with the right MetaData.

By default the MetaData is being read from share/config/kioslaverc 
and /share/config/<protocol>rc but this is how you can override that from 
your program.

Cheers,
Waldo
- -- 
bastian at kde.org  |   KDE Community World Summit 2004  |  bastian at suse.com
bastian at kde.org  | 21-29 August, Ludwigsburg, Germany |  bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFA6p4qN4pvrENfboIRArqqAJ9S7U82Ae2zqZEk+8tbgAbIrVbMYQCcDECb
Q3LX3u1Z4jUOt/UIXmffCiQ=
=5JNX
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list