SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Iframe break code detection

    Hello,

    im unable to detect the, probably JS, code that is breaking my "iframes".
    Can please some gurus here help me to locate the iframe breaking code here:

    http://www.blockhausbauen.com/iframeg.html

    Thanks,
    Goran

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Hi goranpro, welcome to the forums,

    Not probably. Turn off javascript and you get
    blockhausbauen.png

    Something WordPress is doing?

  3. #3
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice idea...so now we know its JS.

    It is probably some wordpess plugin that is causing this, but i was unable to locate it.
    So my question is if there is possible to "debug" the JS so i would see where is the code that is causing this "frame break"?

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    The first thing I would do is temporarily disable all plugins.

    If it is then OK, start re-enabling them one by one until it breaks again.
    If not then OK it is likely one of the many other JavaScript files.

  5. #5
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, i found the guilty plugin (wp-property).
    Is there a way to find the peace of JS that does this?
    ...i would usually probably be able to find this code inside Chrome debug console, but im not sure how to handle it in this case because the JS code is in iframe.
    Can i set some kind of "watch" in debug/JS so that the debugger would stop just before the frame breaks out?

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    I looked at the Firefox 30 error console when it didn't work and there were no Errors, no Messages, only CSS3 Warnings from what I saw.

    I'm wondering if it's in the PHP code. There are a lot of files, a real pain.

    Have you tried asking the plugin author for support?

  7. #7
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Mittineague,

    i found the code. It was a check like this:

    Code:
    if ( top === self ) {
      //not in a frame
    } else {
    top.location.href = document.location.href;
    }
    Im not sure why it is there, i just commented the "else" code out and now it frame is not breaking anymore.

    Thanks for your help, it saved my day


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •