--- Boris Zbarsky <[EMAIL PROTECTED]> wrote:
> > > Do you know how to create data: uri from
> > original uri? I am clueless on it. Any idea?
> 
> You'd basically have to URL-escape all the data as
> it came in and build 
> up this huge string....
> 
> It's not a very good solution.  :(

Yes, I feel it is not the elgant solution. Let me try
to put what I need and how I am trying to proceed. You
may through some light on it :-)

I am working on project where contents sent by server
are encrypted with Content-Type header
text/x-html-encrypted. I need to decrypt those
contents and pump into Mozilla UI. Now, when the
contents are rendered in the browser window, some of
the browser operation must be disabled to secure the
contents i.e users should not be able to copy, cut,
print, view source, save or save as the contents.
Acrobat Reader have this features where a pdf have
file can only be read and not copy, or saved to
protect IP right of the authors. There are many books
who allows the user to read them on computer screen
but if they want the hard copy, they must buy it. I
want to achieve the same thing for a HTML page. 

For the first part i.e. decryption of contents, I have
written a stream converter, implementation of
nsIStreamConverter. And I am glad it is working fine.

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.

To achieve the above, I have implemented a
nsIWebProgressListener interface and try to intercept
the content-type in in the
nsIWebProgressListener::OnStrateChange(...) method.
The content-type I get in the above method is always
text/html (that is what the text/x-html-encrpted
changed to after decryption).

Now, I am trying to figure out how can I get the
original content  types from the channel or how can I
set some flag which can indicate the original content
type to nsIWebProgressListener:OnStateChange(...)
method.

Another thing I am exploring is how to open a new
browser window in C++ code. In JS I can simple use the
window.openDialog(...)  to open a new window. 

Regards,

Raj Saini 

> 
> -Boris


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
_______________________________________________
Mozilla-netlib mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to