Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Break Out Of Frames - FF

edited October 2006 in Vanilla 1.0 Help
Does anyone have a sure fire way to break out of frames?

I have a standard JavaScript that's served me well for years but it appears that Firefox (on Mac OS X at least) ignores it.

I have an enhanced (.m4a) podcast playing in an iFrame on my forum which works a treat, however when you click a link, it opens inside the small 230x220 pixel iFrame, not a good look.

In Safari and Exploder, the link opens inside the iFrame for a second then breaks out to the full page as the JavaScript says to.

Anyone have a clue for me?

Comments

  • Options
    post the javascript
  • Options
    <script language="JavaScript"> if(parent.frames.length>=1 { window.top.location.href="index.html" } </script>
  • Options
    edited October 2006
    Do you mean something like this?
  • Options
    Hey cutout, could you be a little more specific?
    I see nothing there about breaking out of frames. :-(
  • Options
    Sorry, I think I misread your question.
  • Options
    TiggrTiggr
    edited October 2006
    Hi!

    There is a closing brackett missing, after ">=1".

    <script language="JavaScript"> if(parent.frames.length>=1) { window.top.location.href="index.html" } </script>

    Bye
    Tiggr
  • Options
    Yes thanks Tiggr that just went west in the cut and paste somehow, it still does not work with Firefox.
  • Options
    TiggrTiggr
    edited October 2006
    Hi again

    I'm using this on my sites:

    <script type="text/javascript"> if (top.frames.length != 0) top.location= self.document.location; </script>

    Seems to work in all browsers...

    Bye
    Tiggr
  • Options
    ithcyithcy New
    edited October 2006
    you can also try
    if(location != top.location) top.location.href = location.href;
  • Options
    Thanks itchy but your script does not work in Firefox on OS X.

    Tiggr I found a variation on your suggestion, seems to work on all browsers I have tested...

    <script language="javascript" type="text/javascript"> if (parent.frames.length > 0) { parent.location.href = self.document.location; } </script>

    parent.frames or top.frames ?

    Thanks all.
This discussion has been closed.