carglue wrote:
> Boris Zbarsky wrote:
>> I don't believe 2.0.0.12 has the nsICachingChannel.LOAD_NO_NETWORK_IO 
>> flag.
>>
>> LOAD_ONLY_FROM_CACHE should work, though.  I'm pretty surprised that 
>> it doesn't....  Would you mind getting an HTTP log, following the 
>> instructions at 
>> <http://www.mozilla.org/projects/netlib/http/http-debugging.html>?
> 
> My apologies Boris.  It appears now after doing some more re-testing 
> that the proper combination of flags I needed was this:
> 
> channel.loadFlags |= nsICachingChannel.LOAD_ONLY_FROM_CACHE | 
> nsIRequest.VALIDATE_NEVER;
> 
> And yes, it works correctly as you had stated.  You are also correct 
> that the LOAD_NO_NETWORK_IO flag doesn't appear to be working/supported 
> in this FF version.  I think I somehow had an additional flag in my 
> earlier tests that was causing the pull-from-cache-only behavior to not 
> work as expected.  Must be the burnout factor.
> 
> Anyway, for the short term, if raw source is unavailable in cache, we 
> may use a fallback approach of assembling the html source via the 
> less-than-ideal approach of taking the results of a set of innerHTML 
> calls against top-level child elements of the document object and 
> getting it that way.  Its intended as a diagnostic feature anyway, and 
> any information (constructed or otherwise) would be better than none.
> 
> Sorry for the misdirection there.  Happy to see it working now.
Hi,
I have a couple questions:

1. How do you use the getURLSource function?  I'm not sure how you 
create a browser to be passed into the function.  I tried writing the line:

var src = getURLSource(this.browser);

...and it doesn't seem to work.

2. How do you write the output of getURLSource to a file?  It's a 
string, correct? Because I tried googling writing to a file in XPCOM and 
all I seemed to be able to find was writing to a file with a stream, not 
a string.  I'm hoping to be able to write to a file just like if you had 
pressed "View > Page Source" and had saved the results to a file.

I'm new to javascript, and any help would be greatly appreciated!

Cheers!
Chris
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to