Re: Forcing every request from a docShell to use LOAD_ANONYMOUS

Boris Zbarsky <[email protected]> Tue, 20 Aug 2013 12:03:42 -0400
Newsgroups gmane.comp.mozilla.devel.netlib
Message-ID <[email protected]>
On 8/20/13 2:26 AM, Mark Hammond wrote:
> I experimented a little with this, and it (almost) works.  I initially did:
>
>    docShell.loadGroup.defaultLoadRequest.loadFlags |=
> Ci.nsIChannel.LOAD_ANONYMOUS;

What you want is a flag you set on the docshell which causes it to set 
the LOAD_ANONYMOUS flag on the requests it makes (like Brian suggested 
eariler in this thread).

> I have verified that using an nsIWebProgress listener does seem to work
> though - I just look for all notifications with STATE_START |
> STATE_IS_REQUEST and set the flag at that time - and this also doesn't
> need the tweak to MergeLoadFlags.  Seeing as we already need a progress
> listener for a different bug, this seems the most pragmatic way forward.

This feels like a fragile hack to me, honestly...  :(

-Boris