Discussion:
Navigating URL in a particular tab
veeru
2010-03-31 11:04:32 UTC
Permalink
Hi,

I am developing an extension in javascript. I want to block certain
web pages, after navigation is completed. I have implemented
nsIWebProgressListener, and I am checking the URL when I receive
STATE_STOP, here if I get the blocked site, I want to replace it with
my custom page.

The problem occurs when multiple tabs are opened and when I use
loadURI of nsIWebNavigation, it loads page in currently selected tab.

So my question is that how can we load a page in a particular tab?

Please help me out. I am stuck here.

Thank you.
Srirang Doddihal
2010-03-31 16:15:30 UTC
Permalink
Post by veeru
Hi,
I am developing an extension in javascript. I want to block certain
web pages, after navigation is completed. I have implemented
nsIWebProgressListener, and I am checking the URL when I receive
STATE_STOP, here if I get the blocked site, I want to replace it with
my custom page.
The problem occurs when multiple tabs are opened and when I use
loadURI of nsIWebNavigation, it loads page in currently selected tab.
So my question is that how can we load a page in a particular tab?
Each tab has a <browser> element which exposes this nsIWebNavigation as a
property. You can use the corresponding nsIWebNavigation to load your custom
page in that tab. This document has information and code snippets on dealing
with the tabbed browser :
https://developer.mozilla.org/en/Code_snippets/Tabbed_browser
Post by veeru
Please help me out. I am stuck here.
Thank you.
_______________________________________________
dev-tech-dom mailing list
https://lists.mozilla.org/listinfo/dev-tech-dom
--
Regards,
Srirang G Doddihal
Brahmana.

The LIGHT shows the way.
The WISE see it.
The BRAVE walk it.
The PERSISTENT endure and complete it.

I want to do it all ALONE.
veeru
2010-04-01 14:59:58 UTC
Permalink
Post by Srirang Doddihal
Post by veeru
Hi,
I am developing an extension in javascript. I want to block certain
web pages, after navigation is completed. I have implemented
nsIWebProgressListener, and I am checking the URL when I receive
STATE_STOP, here if I get the blocked site, I want to replace it with
my custom page.
The problem occurs when multiple tabs are opened and when I use
loadURI of nsIWebNavigation, it loads page in currently selected tab.
So my question is that how can we load a page in a particular tab?
Each tab has a <browser> element which exposes this nsIWebNavigation as a
property. You can use the corresponding nsIWebNavigation to load your custom
page in that tab. This document has information and code snippets on dealing
with the tabbed browser :https://developer.mozilla.org/en/Code_snippets/Tabbed_browser
Post by veeru
Please help me out. I am stuck here.
Thank you.
_______________________________________________
dev-tech-dom mailing list
https://lists.mozilla.org/listinfo/dev-tech-dom
--
Regards,
Srirang G Doddihal
Brahmana.
The LIGHT shows the way.
The WISE see it.
The BRAVE walk it.
The PERSISTENT endure and complete it.
I want to do it all ALONE.
Thanks

Continue reading on narkive:
Loading...