[Proto-Scripty] Re: Prevent iframe / break-away

2009-03-18 Thread Vladimir Tkach
try to use beforeunload event

2009/3/18 Karlson azagnio...@gmail.com


 Hi,

 I am trying to prevent iframe breakout. This is how i attempted to do
 it in head section of my HTML document:

 function windowUnload(evt) {
evt.stop();
   }

   Event.observe(window, 'unload', windowUnload);
   $('ifr').observe('unload', windowUnload);


  //Event.observe(window, 'unload', function(event) {
  //  Event.stop(event);
  //});


 'ifr - the id of my iframe.

 My code does not work.
 Is it possible at all with prototype?

 What am i doing wrong, can some one give me some feedback?

 Regards,
 Karlson

 



-- 
Best Regards,
Vladimir Tkach

+972-54-7574166
tea...@gmail.com

http://teamco-anthill.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Prevent iframe / break-away

2009-03-18 Thread Matt Foster

$(ifr).observe(beforeunload, Event.stop);

Give it a whirl, I have no idea if that will work;

---

http://positionabsolute.net



On Mar 18, 5:27 am, Vladimir Tkach tea...@gmail.com wrote:
 try to use beforeunload event

 2009/3/18 Karlson azagnio...@gmail.com





  Hi,

  I am trying to prevent iframe breakout. This is how i attempted to do
  it in head section of my HTML document:

  function windowUnload(evt) {
     evt.stop();
    }

    Event.observe(window, 'unload', windowUnload);
    $('ifr').observe('unload', windowUnload);

   //Event.observe(window, 'unload', function(event) {
   //  Event.stop(event);
   //});

  'ifr - the id of my iframe.

  My code does not work.
  Is it possible at all with prototype?

  What am i doing wrong, can some one give me some feedback?

  Regards,
  Karlson

 --
 Best Regards,
 Vladimir Tkach

 +972-54-7574166
 tea...@gmail.com

 http://teamco-anthill.blogspot.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Prevent iframe / break-away

2009-03-18 Thread Matt Foster

Looking further into this issue has revealed, that you can't actually
stop a page from unloading, as this would allow malicious sites to
trap a user indefinitely.  Listening for the beforeunload event on
the top window prompts a confirmation window saying you're about to
navigate away, continue or cancel.  You can also do some extra
processing in the event handler but the handler can't prevent the
unload.  If the user clicks cancel then you're able to keep these
framebuster pages in their frames.  Otherwise the user is redirected.

---

http://positionabsolute.net



On Mar 18, 4:58 pm, Matt Foster mattfoste...@gmail.com wrote:
 $(ifr).observe(beforeunload, Event.stop);

 Give it a whirl, I have no idea if that will work;

 ---

 http://positionabsolute.net

 On Mar 18, 5:27 am, Vladimir Tkach tea...@gmail.com wrote:

  try to use beforeunload event

  2009/3/18 Karlson azagnio...@gmail.com

   Hi,

   I am trying to prevent iframe breakout. This is how i attempted to do
   it in head section of my HTML document:

   function windowUnload(evt) {
      evt.stop();
     }

     Event.observe(window, 'unload', windowUnload);
     $('ifr').observe('unload', windowUnload);

    //Event.observe(window, 'unload', function(event) {
    //  Event.stop(event);
    //});

   'ifr - the id of my iframe.

   My code does not work.
   Is it possible at all with prototype?

   What am i doing wrong, can some one give me some feedback?

   Regards,
   Karlson

  --
  Best Regards,
  Vladimir Tkach

  +972-54-7574166
  tea...@gmail.com

 http://teamco-anthill.blogspot.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---