content-encoding, stream converters, and such

2002-12-07 Thread Boris Zbarsky
I've been thinking about stream converters, content-encoding, and the interaction of necko with consumers for a bit now... and I'm somewhat at a loss for ideas, so I thought I'd float what I have so far and see what people think. So: Goal: The necko consumer should havecontrol over the

Re: Use of nsIContentHandler in Mozilla

2002-12-31 Thread Boris Zbarsky
1. Can I use aWindowTarget to display the results in the correct window? Would I do a QueryInterface on it to get some kind of window object? If so, which interface would I use? Are you creating a DOM tree and then trying to attach it to a window? I don't think that's possible yet... 2.

Providing channels with a content-type hint

2003-01-03 Thread Boris Zbarsky
I've been thinking about a few issues we have with content-type detection: 1) Our internal detection is not too reliable (for file://, ftp://, etc). 2) There is often context at channel open that could provide a better guess at the type (eg the type attribute of link, a, or script). At the

Re: nsIUploadChannel and nsIFileChannel

2003-01-03 Thread Boris Zbarsky
var nsIURI Components.classes[ @mozilla.org/network/standard-url;1 ].createInstance(Components.interfaces.nsIURI); nsIURI.spec = file:///tmp/test.file; This is the wrong way to create a URI and in particular it creates a file:// uri that does not know that it's a file uri (does not QI to

Re: How can I get mozilla to USE THE CACH!?!?!

2003-02-06 Thread Boris Zbarsky
Chris Sobotkiewicz wrote: However, sometimes things go nuts and a single user can cause my server to grind to a halt. What do I do? I'd hate to deny Netscape users access to the play button, but its getting to that point! So your server grinds to a halt because of requests to see whether the

Re: file:// and content type sniffing

2003-08-10 Thread Boris Zbarsky
Darin Fisher wrote: Another option would be to have necko automagically wedge an instance of nsUnknownDecoder between the file channel and its listener. This is already done for HTTP (and elsewhere i think). BZ might even have a bug filed about doing this. Not really. One interesting related

Re: file:// and content type sniffing

2003-08-11 Thread Boris Zbarsky
Also, is there any context in which you want to know the file type but not actually use it? Yes. For example, when implementing the accept attribute of input type=file. More to the point, there are many cases where you need to know the file type in one part of the code and actually use the

Re: file:// and content type sniffing

2003-08-14 Thread Boris Zbarsky
I was worried this would appear next week. :-) To me, the accept attribute seems to be designed by someone who thinks that a name defines an object, which is silly. Where do names appear? It's designed by someone who assumes that given an object you can get meta-information about its type

Re: file:// and content type sniffing

2003-08-14 Thread Boris Zbarsky
I hope you're just being theoretical. Do you really want mozilla to open every file it doesn't understand just to see what's in it? And what do you do with a mime type you don't know about? This whole discussion is theoretical so far. The question is what theory we should select and put into

Re: Documentation: Mozilla and MIME Types, and Helper Applications

2003-08-29 Thread Boris Zbarsky
So I decided to write a short document about it, and put it up at http://stud4.tuwien.ac.at/~e0225227/MozillaMIMETypes.html Comments welcome. Hopefully, it will be useful to someone. First, thanks a ton for doing this. Second, we should consider putting this on mozilla.org and linking to

Re: Documentation: Mozilla and MIME Types, and Helper Applications

2003-08-31 Thread Boris Zbarsky
(changed the things I did not commetn on. document still at http://stud4.tuwien.ac.at/~e0225227/MozillaMIMETypes.html) One issue with the first paragraph -- it uses content type and mime [sic] type to mean the same thing. I would use MIME type both places. The target audience is mostly web

Re: Documentation: Mozilla and MIME Types, and Helper Applications

2003-09-02 Thread Boris Zbarsky
OK, how about I put this document at: http://www.mozilla.org/docs/web-developer/mimetypes.html And link to it from http://www.mozilla.org/docs/web-developer/ (in the Writing for Mozilla section) and http://www.mozilla.org/projects/netlib/ (the core documentation section) and maybe

Re: file:// and content type sniffing

2003-09-02 Thread Boris Zbarsky
It's not a matter of the wrong mime type, it's a matter of the wrong file. Agreed. That should indeed be addessed. Not very easy to do, though... I wouldn't object to associated types as long as there's a distinction between a stream of unknown type which is treated as a default type and a

Re: file:// and content type sniffing

2003-09-03 Thread Boris Zbarsky
Let's assume that mozilla uses application/octet-stream for any file it doesn't understand. That's the default type. I'm saying that treating a file (or any object) as application/octet-stream is different from knowing the file is application/octet-stream and mozilla should keep these cases

Re: cache search application

2003-09-14 Thread Boris Zbarsky
However, even after scouring the header files, I can't figure out how nsICacheEntryDescriptor structure is formatted. That's not a structure; that's an interface defined in http://lxr.mozilla.org/seamonkey/source/netwerk/cache/public/nsICacheEntryDescriptor.idl Hope that helps, Boris -- A

Re: Windows and .url files and nsILocalFileWin

2003-11-19 Thread Boris Zbarsky
Christian Biesinger wrote: That requires code to get from a .url file to the URL it links to. I assume that's not covered by the existing symlink stuff on nsIFile? string instead of nsIURI because this is xpcom (= no necko), and because the current callers want a string. So. this is my

Re: What async IO interface for sockets is best for cross version use?

2003-11-25 Thread Boris Zbarsky
[EMAIL PROTECTED] wrote: Yeah, this is a good theory, but as far as I can tell 1.2.1 doesn't have enough frozen interfaces to do async socket IO reading and writing with only frozen interfaces... That's unfortunately correct. And unless I am missing something, it looks like there are STILL not

Re: How to open stripped down Chrome window for user-defined content types

2003-12-01 Thread Boris Zbarsky
Raj Saini wrote: 1. I write a implentation of the nsIURIContentListener and register with nsIURILoader during xomponent registration. Or even just register with the category manager... see http://www.mozilla.org/docs/docshell/uri-load-start.html#CategoryManager 2. Use the DoContent method of

Re: Conent type notification

2003-12-01 Thread Boris Zbarsky
Raj Saini wrote: I have written a component. I am looking for some notification where I can get the conent type of a request. For what request? It's not clear to me what exactly you are trying to do -Boris ___ Mozilla-netlib mailing list [EMAIL

Re: How to open stripped down Chrome window for user-defined content types

2003-12-02 Thread Boris Zbarsky
Raj Saini wrote: For the second part that is diabling some of UI operations, what I want is open a new window when the contents types are text/x-html-encrypted arrives. my converter should decrypt the contents and pump them to the new browser window for rendering. The problem is that there is

Re: Filtering at the Necko level

2003-12-03 Thread Boris Zbarsky
Andrew Van Uitert wrote: I need to have my filter sit at a level where it sees all http requests before they hit the socket. The reason I have to sit so low, is that many of the porn sites use re-directs to pay other sites for their listings. At the XPCOM embed level I can only see the original

Re: Filtering at the Necko level

2003-12-06 Thread Boris Zbarsky
Doug Turner wrote: What is the bug number? Bug 191839 -Boris ___ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib

Re: Hooking up an nsIStreamListener in nsIURIContentListener's doContent

2004-01-01 Thread Boris Zbarsky
Christian Biesinger wrote: How about this: * codefalse/code if the URI Loader should * continue handling the load and call the returned streamlistener's methods. Yeah, looks good. r=me (sr too, if you want). -Boris

Re: Can an instance of nsIURIContentListener tell the target of the requested load?

2004-01-10 Thread Boris Zbarsky
Matthew Wilson wrote: And then the converter creates a new nsIChannel with the correct content type, and passes that to the listener which the converter recieved during AsyncConvertData - is that right? Well, it doesn't necessarily create a new channel. It may SetContentType on the old channel

Re: about mozilla save as

2004-02-13 Thread Boris Zbarsky
Nanjun Hu wrote: Can I use nsIWebBrowserPersist to do such save as? That's what the browser UI uses... See http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/contentAreaUtils.js#691 then call persist-SaveDocument? Yep. I tried to do it in the above, but it fails. So any

Re: about mozilla save as

2004-02-14 Thread Boris Zbarsky
lasco wrote: Could you give me an example how to make a valid path passing to InitWithPath? suppose I want to save the page as b.html and pics in b_files. InitWithPath takes an absolute path. -Boris ___ Mozilla-netlib mailing list [EMAIL PROTECTED]

Re: about mozilla save as

2004-02-15 Thread Boris Zbarsky
But will using saveURI get the HTML text from server again or using the loaded copy, since the webpage is already loaded? Depends on the cache flags you set on the persistence object. Boris -- Washington [D.C.] is a city of Southern efficiency and Northern charm. --

Re: about mozilla save as

2004-02-15 Thread Boris Zbarsky
I searched in the source tree, but I am afraid that I didn't find the caller of saveDocument and saveURL. So would you...? thanks!!! I'm afraid, no. Please make sure that you searched the .xul and .js files. Boris -- Washington [D.C.] is a city of Southern efficiency and Northern charm.

Re: when the nsIWebBrowser::SaveDocument returns

2004-02-17 Thread Boris Zbarsky
Nanjun Hu wrote: After calling nsIWebBrowser::SaveDocument method There is no such method on nsIWebBrowser. -Boris ___ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib

Re: nsIHttpNotify and threads

2004-03-04 Thread Boris Zbarsky
maybe you can use the address of the nsIChannel object? And get notified on redirects, right? Boris -- Bradley's Bromide: If computers get too powerful, we can organize them into a committee -- that will do them in. ___ Mozilla-netlib mailing

Re: Multiple requests problem

2004-03-05 Thread Boris Zbarsky
It seems that mozilla asks for files in parallel (which is ok), but until at least start of next file arrives, it does not read other streams either (which is questionable, imho). Script file: document.write('boo'); HTML file: html body Hey script src=boo.js! /body /html Note that we can't

Re: Is there a way to make a tree of HTTPRequest ?

2004-03-09 Thread Boris Zbarsky
What I didnt' find by looking in the Mozilla's network code is a way to uniquely identify a request and be able to find its parent. necko does not know what the parent is, in general (and it's not really well-defined in many cases anyway). We need to somehow fix that, but that's a huge

Re: nsIHttpNotify and threads

2004-03-17 Thread Boris Zbarsky
Yes, but I would like to avoid that. If page has 2 identical pictures, then I want onModifyRequest/onExamineResponse calls for every of them, regardles of their source (network, local cache). With the image cache, what actually happens is that the load request is never even sent to necko. The

Re: trouble registering uri component twice...

2004-04-12 Thread Boris Zbarsky
Phil Hühn wrote: Can I get some help? I'm doing file (web page) processing - I create an object which needs to validate the page URL (as is done for 'save page as'). So this object implements component: @mozilla.org/network/urichecker;1 So your object registers itself for this contract,

Re: trouble registering uri component twice...

2004-04-12 Thread Boris Zbarsky
Phil Hühn wrote: So your object registers itself for this contract, overriding the Mozilla urichecker? Yes, it does register itself for this contract 'override the Moz urichecker'?? Is there one already (that I can use)? Well, what does calling createInstance() on that contractid give you

Re: Jar Redirect Problem

2004-04-12 Thread Boris Zbarsky
Bryan White wrote: I have put togehter a stripped down version here: http://pg2.arcamax.com/cgi-bin/redirtest Thanks. This is a bug in the XULDocument code in Mozilla, unfortunately. See http://bugzilla.mozilla.org/show_bug.cgi?id=240358. You may be able to work around it in the interim by

Re: Jar Redirect Problem

2004-04-13 Thread Boris Zbarsky
Bryan White wrote: You may be able to work around it in the interim by using a client-side redirect (meta refresh); I _think_ that won't set the originalURI to anything untoward, unlike this case. Could you explain this a little, I don't know what you mean here. What happens is that on HTTP

Re: trouble registering uri component twice...

2004-04-13 Thread Boris Zbarsky
Phil Hühn wrote: I'm actually modifying the code in contentAreaUtils.js - when I started this message thread I thought I'd try to leave out stuff like that to simplify the question but maybe I made it worse ;-) Heh. ;) So the 'this' value is (should be!) a different nsHeaderSniffer object in

Re: Jar Redirect Problem

2004-04-14 Thread Boris Zbarsky
Bryan White wrote: Sorry the location should be: jar:https://secure.arcamax.com/moztest/moztest2.jar!/test.xul OK, there I get (in the JS console): Signature Verification Error: the signature on test.xul is invalid because the digital signature (*.RSA) file is not a valid signature of the

Re: trouble registering uri component twice...

2004-04-16 Thread Boris Zbarsky
Phil Hühn wrote: Two dialogs pop up (i.e one for each tab) Mm... that could be uncool. Which OS is this? You're testing on? Or do you mean that even if you suppress the filepickers things still don't work? -Boris ___ Mozilla-netlib mailing list

Re: trouble registering uri component twice...

2004-04-16 Thread Boris Zbarsky
Phil Hühn wrote: Yes, I suppress the file pickers and things don't work. OK. Is this in Seamonkey or Firefox? Or both? In either case, file a bug please; it sounds like things are racing for access to some sort of shared resource, with bad side-effects. Attach whatever diffs are needed to

Re: Jar Redirect Problem

2004-04-19 Thread Boris Zbarsky
Bryan White wrote: Sorry the location should be: jar:https://secure.arcamax.com/moztest/moztest2.jar!/test.xul Bryan, could you put the enablePrivelege() call back? I thought I'd broken something with a patch to fix one of the problems you raised, since it wasn't coming up, but it looks like

Re: nsIInputStream::available

2004-05-09 Thread Boris Zbarsky
Darin Fisher wrote: Call, Read and check what it returns. If it returns NS_OK and zero bytes read, then that means EOF. We should really document that in the IDL -Boris ___ Mozilla-netlib mailing list [EMAIL PROTECTED]

Re: Pluggable Protocols in Mozilla

2004-04-28 Thread Boris Zbarsky
Brett Goodman wrote: Can you tell me if Mozilla uses pluggable protocols It does. and if so, is it similar to IE. I don't know what IE's looks like, so... Can you point me to some docs that describe how to implement one? http://www.mozilla.org/projects/netlib/new-handler.html is a start.

Re: Pluggable Protocols in Mozilla

2004-04-28 Thread Boris Zbarsky
Brett Goodman wrote: Does it matter that this PPH will only be for the Windows platform, and that the code will be proprietary? I'm not a lawyer, but as far as I understand the answer is no. So I wouldn't be checking in any code, just distributing the DLL. Right. All that really means is that

Re: Content-location possible regression in 1.7b: may 'fail' on many servers

2004-04-29 Thread Boris Zbarsky
Olivier Cahagne wrote: After fix for bug 109553 was committed, one major server failed because of HTTP content-location badly configured: bug 231072. Content-location support has been backed out due to the number of servers that break with it and the fact that it breaks anchor traversals in

Re: Howto send XML to Moz/Gecko from my C++ Win32 app??

2004-05-17 Thread Boris Zbarsky
David Herron wrote: But in .../ipc/src/nsIPipeTransport.h it has this code which bombs the compile #ifdef MOZILLA_VERSION public nsIInputStreamNotify, public nsIOutputStreamNotify #else // Mods for Mozilla version prior to 1.3b

Re: Launching chromes via nsIContentHandler

2005-01-28 Thread Boris Zbarsky
Andre Pang wrote: What would be the best way to go about doing this? (Sorry, I'm a bit new to Mozilla development practices.) Should I submit a bug report now, or use the mailing lists (such as this one) to discuss possible solutions first before submitting one? Either one works fine, really.

Re: Using 'ext-to-type-mapping' to handle files served without MIME type

2005-02-10 Thread Boris Zbarsky
naltrexone wrote: Oh, one other observation-- I think the mapping *does* work for files on the local machine. Just not for files on remote servers. The extension to type mapping is only used when there is no MIME type provided for the data. The servers are almost certainly providing the data

Re: How to replace HTML file upload form with JavaScript ?

2005-02-21 Thread Boris Zbarsky
Bjorn Thor Jonsson wrote: file = files.getNext() .QueryInterface(Components.interfaces.nsILocalFile); jsFile = new File(file.path); // JSLib file jsFile.open(); Er... why not just create an input stream here? var sData = clientfile= + encodeURIComponent( jsFile.read()

Re: XMLHttpRequest notificationCallbacks fails

2005-04-30 Thread Boris Zbarsky
Christian Biesinger wrote: That won't work, apparently - XMLHTTPRequest overwrites the notification callbacks you set. I filed bug 292391 on making it do so in a less destructive way. Neil, could maybe you test the patch I posted and let me know whether it resolves your problem? -Boris

Re: XMLHttpRequest notificationCallbacks fails

2005-05-03 Thread Boris Zbarsky
Neil Stansbury wrote: Interestingly enough though, it doesn't work... or rather it does but the events fire all in one go after the request is finished! It's almost like the thread the events are on is blocking. Are you doing a sync or async XMLHttpRequest? -Boris

Re: missing STATUS messages for Javascript nsiWebProgressListener::onStatusChange()

2005-05-17 Thread Boris Zbarsky
LeRoyK wrote: I am working on Javascript instrumentation for Firefox 1.0x using a chrome extension. How are you registering your nsIWebProgressListener? I have never recorded the STATUS_SENDING_TO event. Does that one still occur? The socket transport still sends it, yes -Boris

Re: missing STATUS messages for Javascript nsiWebProgressListener::onStatusChange()

2005-05-18 Thread Boris Zbarsky
LeRoyK wrote: I do not see the nsIWebProgressListener interface used at all when the loadGroup is null. Right. The docloader is hooked up to channels through the loadgroup. I really don't know what the problem you're running into is... :( -Boris ___

Re: missing STATUS messages for Javascript nsiWebProgressListener::onStatusChange()

2005-05-19 Thread Boris Zbarsky
LeRoyK wrote: Would the next logical step be to create a simple test case and submit it as a bug, or are there other options I might try first? If you can create a simple testcase that shows the problem, that sounds like the best next step, yes. -Boris

Re: adding preference network.http.status.coalesce

2005-06-01 Thread Boris Zbarsky
LeRoyK wrote: This change would slow down every nsHttpTransaction:Init() call by the time it takes to check a preference. Actually, if you cached the pref value (on nsHttpHandler, probably, and made sure the pref is observed by the handler by adding things in nsHttpHandler::Init as needed),

Re: Convert HTML string into DOM document for manipulation

2005-07-03 Thread Boris Zbarsky
Ken Theng wrote: Hi all , issit possible to load this nsIDOMDocument into the nsiWebNavigation ? Cos i need to render the nIDOMDocument i gotten I don't believe you can stick a DOMDocument into a given nsIWebNavigation at the moment -Boris

Re: Convert HTML string into DOM document for manipulation

2005-07-04 Thread Boris Zbarsky
Ken wrote: Do you know of anyway to render the DOMDocument i gotten ? There isn't one, really. You can move its documentElement into another document (the one in the webnavigation), but that's not guaranteed to work right, especially in 1.7 and earlier builds. -Boris

Re: Firefox and multipart

2005-07-26 Thread Boris Zbarsky
Andrea wrote: I think that firefox does not support multipart http responses. Is it correct? What makes you think that? We have code to support multipart responses, and it works fine last I checked (for example, bugzilla query results are multipart responses). -Boris

Re: Firefox and multipart

2005-07-26 Thread Boris Zbarsky
Andrea wrote: Hi, I took a look at the bugzilla query results, which is a multipart response and works fine. But, the type of multipart support that I was talking about is rendering of images included in the http response with multipart. You mean that the image and the HTML are all part of the

Re: nsIChannel.contentChannel

2005-09-13 Thread Boris Zbarsky
Michael Vincent van Rantwijk wrote: It's available at any time. If you're asking at what point it could depend on what the server returned, that's after OnStartRequest or after open() returns. I hoped that, but that's not the case because it throws JS errors on the JS console if you try to

Re: nsIChannel.contentChannel

2005-09-13 Thread Boris Zbarsky
Michael Vincent van Rantwijk wrote: I don't think that there's anything guaranteed to work in this huge and constantly changing code base, but at least it works right now. The things that are guaranteed to work are documented as such with frozen interfaces or frozen contracts. -Boris

Re: nsIChannel.contentChannel

2005-09-13 Thread Boris Zbarsky
Michael Vincent van Rantwijk wrote: Yikes, I assumed to be using some random fake domain name There are standard fake domain names to use, as documented in the DNS RFCs (eg example.com) if you need a fake domain name. -Boris ___ Mozilla-netlib

Re: getting file size info

2005-11-09 Thread Boris Zbarsky
Tomaz Nolêto wrote: When mozilla starts dealing with a not renderizable file using nsExternalHelperAppService, I need to get file size info after the Show() method is called from a nsIHelperAppLauncherDialog. Can I do it inside Show() itself? What are the ways to do it? First problem is that

Re: loadURI

2005-12-06 Thread Boris Zbarsky
zen wrote: I writting a simple XPCOM with the following code but the server script cannot detect the postdata. Could anyone please help? Is this a bug since the loadURI is actually doing the POST but the server cannot detect any postdata. Does Gecko send the data to the server? Can you

Re: loadURI

2005-12-06 Thread Boris Zbarsky
zen wrote: FYI, loadURI() construct the postdata (*refer code from 1st posting) as HTTP data while form action=POST construct as Line-based text data (both monitored from ethereal). I'm not sure what that means. Since you have a \r\n at the beginning of your string, the data should end up

Re: loadURI

2005-12-06 Thread Boris Zbarsky
zen wrote: Yes, the data end up in the header, i think it not consider as the content of that particular HTTP post. Please refer screenshot attached. loadURI_post.gif - capture during loadURI performing post form_post.gif - capture during form action=post submited The main difference I

Re: Implementing an nsIChannel

2005-12-08 Thread Boris Zbarsky
I had figured out that channels are a single shot data connection. So I need to handle the concept of being connected in my channel. Yes, channels are single-shot things. SOAP doesn't appear to use channels, or stream listeners so I'm some what forcing a square peg into round hole. I think

Re: Implementing an nsIChannel

2005-12-09 Thread Boris Zbarsky
Neil Stansbury wrote: Oh ok, I couldn't find a SOAP method that gave me access to those interfaces. I'll look again. There might well not be one I'm still trying to understand your setup. You're implementing a protocol handler, right? Yep an XML message/rpc protocol, using (usually)

Re: alternative to loadURI

2005-12-11 Thread Boris Zbarsky
zen wrote: is there any alternative method that similar to loadURI which can accept postdata as argument and is a FROZEN interface? No. -Boris ___ Mozilla-netlib mailing list Mozilla-netlib@mozilla.org http://mail.mozilla.org/listinfo/mozilla-netlib

Re: Implementing an nsIChannel

2005-12-12 Thread Boris Zbarsky
Neil Stansbury wrote: I don't want to have to implement multiple Message.Delete() methods for each underlying XML format. I wanted to transfer a generic request of Delete() to the channel for that connection, and then have it handle the Delete() specifics for that connection type. This