On Mar 1, 1:50 am, [EMAIL PROTECTED] wrote:
> Thnx Peter. Okay..now lets see if I've understood you.
>
> In the normal case when I use FTP through Firefox I use an FTP API
> which is natively available in Mozilla/Firefox.
>
> But Firefox doesn't have an API at all for Sftp..which means that I'll
> have to write an API for it. So is it ok if I use "sshlib" or some
> other third party library, use C++ to use the API's it offers and
> write the entire code to access the Sftp server in C++.Okay...so now I
> have the entire code ..completely independent from Firefox in C++. So
> I can invoke this code and can get connected to the Sftp
> server...right???
>

The whole point of using the Mozilla platform available through XPCOM
is portability and code re-usability.  Theoretically, you an write
your external code and just invoke it from the Mozilla/Firefox
platform.  However, I find it hard to believe that this will be easy
for you to do.  I mean, theoretically, you could just use the Gecko
module to invoke a request, pass it to your external code that has
nothing to do with Firefox, and then pass the result back to Gecko to
display it in your browser's window.  However, this is so ugle that I
wouldn't dream of doing it.  Also, if portability is important to you,
you have to guarantee yourself that your sftp external code is
portable.


> The next thing now is to make Mozilla somehow understand that it has
> to just try and call this C++ code. No SFTP functionality will be
> written here. As soon as the user enters "username" and "password" and
> hits "GO" the entire C++ code is called and I'm connected.Is there an
> interface to achieve this?
>
> So I'm not writing any of the Sftp functionality in Firefox itself.
> I'm telling Firefox..."Just call the C++ code".
>

Yeah, as timeless indicated, you will need to implement your own
protocol handler and channel classes that would be invoked when the
user makes a request through the Firefox GUI.  This is the minimum
that Necko needs to provide for every kind of request to be made
through Firefox.  You can see the interface definitions for these
modules here:

http://www.xulplanet.com/references/xpcomref/ifaces/nsIProtocolHandler.html
http://www.xulplanet.com/references/xpcomref/ifaces/nsIProxiedProtocolHandler.html
http://www.xulplanet.com/references/xpcomref/ifaces/nsIChannel.html

> Does this make any sense and if it is will the code be portable?

It makes sense in a weird way but you are trying to do something very
unnatural - make some Necko functionality interface with code external
to Mozilla.  There can be any number of things goign wrong here, but I
don't know - it might be doable.  As for portability - if you use
Mozilla code, this will ensure portability.  If you don't, you need to
provide your own means of portability (unless the external code is a
library that already provides portability).

By the way, this mailing list is the wrong place for this discussion.
The right mailing list is mozilla.dev.tech.network, which is where the
Necko maintainers and developers hang around.

Regards,
Peter

_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to