Re: Intercepting URL in Firefox extension

2007-06-27 Thread Boris Zbarsky
Ashish Motivala wrote: var wnd = window.QueryInterface( Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShell) .QueryInterface(Components.interfaces.nsIInterfaceRequestor)

Re: Intercepting URL in Firefox extension

2007-06-27 Thread Ashish Motivala
I got it to work, with wnd.parentContentListener = myListener; The odd behavior, I see is that the listener gets called multiple times. Its different for different sites and is also somtimes +/-1 callback for the same site. And this doesn't seem to be related to the number of resources URIs

Re: Intercepting URL in Firefox extension

2007-06-27 Thread Boris Zbarsky
Ashish Motivala wrote: I got it to work, with wnd.parentContentListener = myListener; The odd behavior, I see is that the listener gets called multiple times. Which method on the listener? I'd expect multiple calls to CanHandleContent, possibly. -Boris

Re: Intercepting URL in Firefox extension

2007-06-27 Thread Ashish Motivala
onStartURIOpen() is called multiple times. i.e. mysimon.com gets called 5-6 times. -ashish On 6/27/07, Boris Zbarsky [EMAIL PROTECTED] wrote: Ashish Motivala wrote: I got it to work, with wnd.parentContentListener = myListener; The odd behavior, I see is that the listener gets called

Re: Intercepting URL in Firefox extension

2007-06-20 Thread Ashish Motivala
On Dec 19 2006, 9:54 am, Andrei Korostelev [EMAIL PROTECTED] wrote: On Dec 19, 3:58 pm, Boris Zbarsky [EMAIL PROTECTED] wrote: Andrei Korostelev wrote: // I set up the content listener: attempt 1 var wnd = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)

Intercepting URL in Firefox extension

2006-12-19 Thread Andrei Korostelev
I need a Firefox extension which performs some actions (redirect and others) before the URL is open. Simply using Mozilla's window.addEventListener(load, Handler, ..) does not work since I have to catch the URL *before* the page is loaded. Not too exotic task on my thought. I also read a couple of

Re: Intercepting URL in Firefox extension

2006-12-19 Thread Boris Zbarsky
Andrei Korostelev wrote: // I set up the content listener: attempt 1 var wnd = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShell)