|
|
|
date: Fri, 9 Jun 2006 07:32:02 -0700,
group: microsoft.public.inetsdk.programming.scripting.jscript
back
Re: how to distinguish n ie instances which are opened with Ctrl+N
Hi Igor,
I am working on an web-based app. That web app requires when user closes the
browser, the app release records and log the user out . For this I creates a
watchdog (a child window) of the main app window. When user closes the main
window, the child window does the log out and close itself. Everything works
as expected, except while in the middle of the flow, the user MAY hit ctrl-n
to open another secondary main window. Right now if the user closes the
secondary main window, it releases records and logs user out. I would want to
control not log a user out unless they close the primary main window.
Since I don't know how IE behaves when user clicks ctrl-n, I think someone
here may give me hints or info into this: how to distinguish the primary ie
window and secondary ie window? what share? what's not?
So in my original question, if you do ctrl-n with a blank window, you have 2
independent window. If you do ctrl-n with a window with a link, you have 2
identical windows.
One person may does:
1. Educate the user that this is the app does, that is the limit of browser
that they must accept it!
2. Disable the ctrl-N and prevent user from doing it
3. Satisfy the user and put in workaround, hacks, ...
Since this is a custom web-based app, I try to satisfy the user's
requirements first.
Thanks,
alu
"Igor Tandetnik" wrote:
> alu wrote:
> > does anyone know how to distinguish 2 instances of IE windows opened
> > by ctrl+N?
>
> Distinguish in what sense? For what purpose? Can you give an example
> that fails to distinguish them, so I can understand your problem?
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
date: Fri, 9 Jun 2006 10:06:01 -0700
author: alu
Re: how to distinguish n ie instances which are opened with Ctrl+N
alu wrote:
> I am working on an web-based app. That web app requires when user
> closes the browser, the app release records and log the user out .
> For this I creates a watchdog (a child window) of the main app
> window. When user closes the main window, the child window does the
> log out and close itself. Everything works as expected, except while
> in the middle of the flow, the user MAY hit ctrl-n to open another
> secondary main window. Right now if the user closes the secondary
> main window, it releases records and logs user out. I would want to
> control not log a user out unless they close the primary main window.
Keep window count in a cookie via document.cookie . All browser windows
running in the same process (this is what you end up with when the user
hits Ctrl-N) share the same cookie store. So you can increment the count
whenever new window appears, decrement it when it closes, and log off
when the counter reaches zero.
> Since I don't know how IE behaves when user clicks ctrl-n, I think
> someone here may give me hints or info into this: how to distinguish
> the primary ie window and secondary ie window? what share? what's not?
The two are equivalent - there is no such thing as primary and secondary
window. The fact that one was opened from the other is irrelevant.
They share cookies - that's how the second window is logged into your
application without going through its own login process.
> So in my original question, if you do ctrl-n with a blank window, you
> have 2 independent window. If you do ctrl-n with a window with a
> link, you have 2 identical windows.
What makes you believe there is any difference if the window is blank?
You still have two identical blank windows.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Fri, 9 Jun 2006 13:52:05 -0400
author: Igor Tandetnik
Re: how to distinguish n ie instances which are opened with Ctrl+N
thanks Igor,
"Igor Tandetnik" wrote:
> alu wrote:
> > I am working on an web-based app. That web app requires when user
> > closes the browser, the app release records and log the user out .
> > For this I creates a watchdog (a child window) of the main app
> > window. When user closes the main window, the child window does the
> > log out and close itself. Everything works as expected, except while
> > in the middle of the flow, the user MAY hit ctrl-n to open another
> > secondary main window. Right now if the user closes the secondary
> > main window, it releases records and logs user out. I would want to
> > control not log a user out unless they close the primary main window.
>
> Keep window count in a cookie via document.cookie . All browser windows
> running in the same process (this is what you end up with when the user
> hits Ctrl-N) share the same cookie store. So you can increment the count
> whenever new window appears, decrement it when it closes, and log off
> when the counter reaches zero.
>
> > Since I don't know how IE behaves when user clicks ctrl-n, I think
> > someone here may give me hints or info into this: how to distinguish
> > the primary ie window and secondary ie window? what share? what's not?
>
> The two are equivalent - there is no such thing as primary and secondary
> window. The fact that one was opened from the other is irrelevant.
>
> They share cookies - that's how the second window is logged into your
> application without going through its own login process.
>
> > So in my original question, if you do ctrl-n with a blank window, you
> > have 2 independent window. If you do ctrl-n with a window with a
> > link, you have 2 identical windows.
>
> What makes you believe there is any difference if the window is blank?
> You still have two identical blank windows.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
date: Fri, 9 Jun 2006 11:30:01 -0700
author: alu
|
|