By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

iframe event activity/timeout (remote domain)

P: n/a
Is there a way for javascript to detect activity in a child iframe that
references a foriegn domain? i.e. It appears that security
restrictions prevent events from propagating to the parent.

I'm simply interested in whether there is user activity in the iframe
... I don't really need the events. I need to timeout the iframe upon a
period of inactivity.

I thought I might overlap a frame over the iframe, but events don't
pass thru .. or am i missing something?

Any thoughts or pointers would be appreciated!!!

Nov 13 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
ic********@hotmail.com said the following on 11/13/2006 5:03 PM:
Is there a way for javascript to detect activity in a child iframe that
references a foriegn domain?
No.
i.e. It appears that security restrictions prevent events from
propagating to the parent.
Correct.
I'm simply interested in whether there is user activity in the iframe
.. I don't really need the events. I need to timeout the iframe upon a
period of inactivity.
You will have to have the foreign domain time it out.
I thought I might overlap a frame over the iframe, but events don't
pass thru .. or am i missing something?
You aren't missing anything.

If you could tell what "activity" was going on in a foreign domain then
I could put your bank site in a 100% IFrame and do what I wanted - it's
a security violation to even try.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 13 '06 #2

P: n/a

Security is fine. I don't need "what" is happening, I just want to
know if somethink "is" happening. Are there any stats that the window
maintains or parent doc maintains?

Any other thoughts?

Nov 14 '06 #3

P: n/a
ASM
ic********@hotmail.com a écrit :
Is there a way for javascript to detect activity in a child iframe that
references a foriegn domain? i.e. It appears that security
restrictions prevent events from propagating to the parent.

I'm simply interested in whether there is user activity in the iframe
.. I don't really need the events. I need to timeout the iframe upon a
period of inactivity.

<iframe onload="function(){parent.counter++;alert(parent.c ounter);}"
blah blah >
<iframe onload="parent.countTime(new Date());"
blah blah >
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Nov 14 '06 #4

P: n/a
ic********@hotmail.com said the following on 11/14/2006 8:33 AM:
Security is fine.
It may be for what you are wanting to do. But to allow you to do what
you want to do, they have to allow other things as well that they simply
won't allow.
I don't need "what" is happening, I just want to
know if somethink "is" happening.
Not with client side script in a default security environment.
>Are there any stats that the window maintains or parent doc maintains?
Not on foreign child documents.
Any other thoughts?
Lots.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 14 '06 #5

P: n/a
ASM,

Your onload idea is a step in the right direction .. it does capture
get & post activity. Unfortunately, it doesn't appear to see ajax
traffic, and of course it isn't aware of any mouse/keyboard activity.

It's a good thought and may suffice for some developer's needs.

Thanks for the input!

Any other thoughts .. anyone?!?

Nov 15 '06 #6

P: n/a
ASM
ic********@hotmail.com a écrit :
ASM,

Your onload idea is a step in the right direction .. it does capture
get & post activity. Unfortunately, it doesn't appear to see ajax
traffic, and of course it isn't aware of any mouse/keyboard activity.
I think onload is the alone possibility because you cant get (or set
attributes to) elements of a page coming from another domain (displayed
in iframe).
It's a good thought and may suffice for some developer's needs.
You can only follow activity of your own domain.

In what activity of foreign domains could be of some interest ?
(your are not their web master, no?)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Nov 15 '06 #7

P: n/a
ASM wrote:
ic********@hotmail.com a écrit :
<snip>
In what activity of foreign domains could be of some interest ?
(your are not their web master, no?)
<snip>

Again, I am looking to timeout the iframe .. thus, I am interested in
any user activity (mouse/keyboard).

Nov 15 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.