scottb
Antoine Drochon wrote:
Hi Mozilla Guru's
I'm looking for a way to add customized HTTP header to a request.
I already use User Agent Switcher and Live Http Header to monitor headers but i want to add new one (to emulate mobile operator requests)
Any idea ?
var oNotifyRequest = new NotifyRequest();
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.addObserver(oNotifyRequest, "http-on-modify-request", false);
// to disable
observerService.removeObserver(oNotifyRequest, "http-on-modify-request");
function NotifyRequest() { }
NotifyRequest.prototype = { onModifyRequest : function (oHttp) { oHttp.setRequestHeader("myCustomHeader", "aValue", true); } }
Thanks for your help,
Antoine
PS: i'm using firefox 0.8 _______________________________________________ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib
_______________________________________________ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib