Intercepting URL updates

View: New views
7 Messages — Rating Filter:   Alert me  

Intercepting URL updates

by Yeti-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.

I'm willing to intercep URL updates using the nsIURIContentListener
interface and its OnStartURIOpen method.

The listener seems to be correctly added to the browser, but the
method is never called and I don't know why...

Did anyone run into that issue and maybe found any workaround?

Thanks!
_______________________________________________
dev-embedding mailing list
dev-embedding@...
https://lists.mozilla.org/listinfo/dev-embedding

Re: Intercepting URL updates

by Tristan Van Berkom-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 24, 2008 at 10:36 AM, Yeti <troubleshouting@...> wrote:
> Hi.
>
> I'm willing to intercep URL updates using the nsIURIContentListener
> interface and its OnStartURIOpen method.
>
> The listener seems to be correctly added to the browser, but the
> method is never called and I don't know why...
>
> Did anyone run into that issue and maybe found any workaround?

Yes. I ran into the issue using a build of release tag 2-0-0-12 (I think
that was the one), then I updated and integrated my sources with
the new embedding stuff and the content listener started working.
On the other hand, I did have a situation where I wasnt using
a nsCOMPtr to hold the content listener, and that I guess caused it
to silently go out of scope causing similar symtoms.

Cheers,
                    -Tristan

Note: I think the nsIURIContentListener stuff is already merged in and available
in the embedding repo here
http://hg.mozilla.org/users/blassey_mozilla.com/embedding/
_______________________________________________
dev-embedding mailing list
dev-embedding@...
https://lists.mozilla.org/listinfo/dev-embedding

Parent Message unknown Re: Intercepting URL updates

by Yeti-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your answer.

I use a quite recent version of the source code based on firefox3, but
it still doesn't work...

I don't use any nsCOMPtr to hold the listener, given I put listener as
global, I may try that.



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

Re: Intercepting URL updates

by Yeti-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

After looking deeper into the SetParentURIContentListener code, I
figured out that the DocShell is NULL :
http://mxr.mozilla.org/firefox/source/embedding/browser/webBrowser/nsWebBrowser.cpp#400

I can't find any reason for that
_______________________________________________
dev-embedding mailing list
dev-embedding@...
https://lists.mozilla.org/listinfo/dev-embedding

Re: Intercepting URL updates

by pjohnsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You may wanna check this earlier thread about using nsIURIContentListener:

http://groups.google.com/group/mozilla.dev.embedding/browse_thread/thread/3d5f3c6a6fa9a0ac

Hope that helps,

  -Pelle

Yeti wrote:
> After looking deeper into the SetParentURIContentListener code, I
> figured out that the DocShell is NULL :
> http://mxr.mozilla.org/firefox/source/embedding/browser/webBrowser/nsWebBrowser.cpp#400
>
> I can't find any reason for that
_______________________________________________
dev-embedding mailing list
dev-embedding@...
https://lists.mozilla.org/listinfo/dev-embedding

Re: Intercepting URL updates

by Boris Zbarsky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeti wrote:
> After looking deeper into the SetParentURIContentListener code, I
> figured out that the DocShell is NULL :
> http://mxr.mozilla.org/firefox/source/embedding/browser/webBrowser/nsWebBrowser.cpp#400
>
> I can't find any reason for that

When exactly are you making this call?

-Boris
_______________________________________________
dev-embedding mailing list
dev-embedding@...
https://lists.mozilla.org/listinfo/dev-embedding

Re: Intercepting URL updates

by Yeti-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks to the link you gave previously I succeeded in throwing the URI
opening event, I guess I was doing the call much too early.

Thanks Boris!
_______________________________________________
dev-embedding mailing list
dev-embedding@...
https://lists.mozilla.org/listinfo/dev-embedding
LightInTheBox - Buy quality products at wholesale price