how to reference of frame window

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how to reference of frame window

Hitesh Khamesra
Hi ,

 

In my application I need reference of mozilla window from nsiHTTPChannel
object. For that I am using following piece of code.

I do get reference of mozilla window and then I can access document object
from this window. Now my problem is that, if channel

correspond to frame request then also I get the reference of top window
object. And I endup with top level document object.  But

I need document object of frame's request.

 

How can I get document object of frame's request? Do mozilla have frame
window(pane in window) concept. Is there any way to get

reference of frame window. Can I change something in following piece of code
to get the reference of frame window.

 

<CODE>

var ir = /* nsIInterfaceRequestor */ channel.notificationCallbacks;

var docshell = /* nsIDocShell */
ir.getInterface(Components.interfaces.nsIDocShell);

chromeWindow =
docshell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).

 
getInterface(Components.interfaces.nsIWebNavigation).

 
QueryInterface(Components.interfaces.nsIDocShellTreeItem).

                               rootTreeItem.

 
QueryInterface(Components.interfaces.nsIInterfaceRequestor).

 
getInterface(Components.interfaces.nsIDOMWindow);

</CODE>

 

Thanks,

Hitesh.

_______________________________________________
dev-planning mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-planning
Reply | Threaded
Open this post in threaded view
|

Re: how to reference of frame window

Christian Biesinger
Hitesh Khamesra wrote:
> var ir = /* nsIInterfaceRequestor */ channel.notificationCallbacks;

So, why not just:

   var win = ir.getInterface(Components.interfaces.nsIDOMWindow);

That should do what you want.
_______________________________________________
dev-planning mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-planning
Reply | Threaded
Open this post in threaded view
|

RE: how to reference of frame window

Hitesh Khamesra
I tried this
>>   var win = ir.getInterface(Components.interfaces.nsIDOMWindow);

It doesn't give me reference of frame window.

-Hitesh

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Christian
Biesinger
Sent: Tuesday, May 02, 2006 2:52 PM
Cc: [hidden email]; [hidden email];
[hidden email]
Subject: Re: how to reference of frame window

Hitesh Khamesra wrote:
> var ir = /* nsIInterfaceRequestor */ channel.notificationCallbacks;

So, why not just:

   var win = ir.getInterface(Components.interfaces.nsIDOMWindow);

That should do what you want.
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network

_______________________________________________
dev-planning mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-planning
Reply | Threaded
Open this post in threaded view
|

Re: how to reference of frame window

Christian Biesinger
Hitesh Khamesra wrote:
> I tried this
>>>   var win = ir.getInterface(Components.interfaces.nsIDOMWindow);
>
> It doesn't give me reference of frame window.

What does it give you?


[Setting reply-to to [hidden email], no point
discussing this on the lists where this is very offtopic]
_______________________________________________
dev-planning mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-planning
Reply | Threaded
Open this post in threaded view
|

Re: how to reference of frame window

Hitesh Khamesra

> What does it give you?
it gives reference to top window. If I access window.content.document, then
it gives me DOM for of top level request. but I need DOM of frame request,
whch is inside of that that top level DOM. I can access that frame DOM by
traversing that top level DOM, but it may be error prone. Thus I am
expecting reference of that frame window(or child window), such that I can
directly access frame request DOM. Is that possible ??

-Hitesh.


> Hitesh Khamesra wrote:
>> I tried this
>>>>   var win = ir.getInterface(Components.interfaces.nsIDOMWindow);
>>
>> It doesn't give me reference of frame window.
>
> What does it give you?
>
>
> [Setting reply-to to [hidden email], no point
> discussing this on the lists where this is very offtopic]
> _______________________________________________
> support-general mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/support-general
>


_______________________________________________
dev-planning mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-planning
Reply | Threaded
Open this post in threaded view
|

Re: how to reference of frame window

Christian Biesinger
[hidden email] wrote:
>> What does it give you?
> it gives reference to top window. If I access window.content.document, then
> it gives me DOM for of top level request. but I need DOM of frame request,
> whch is inside of that that top level DOM.

Yeah... so the interface requestor, when asked for an nsIDOMWindow,
gives you the toplevel window? That's odd...


Please don't reply to all the lists. Reply to just one. I suggest
[hidden email], even though that's also a bad one.
_______________________________________________
dev-planning mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-planning