Stop redirect from iframe

37 replies
  • WEB DESIGN
  • |
Is their a way I could stop a redirect in a iframe?
#iframe #redirect #stop
  • {{ DiscussionBoard.errors[4429029].message }}
  • Profile picture of the author bigvito19
    What is the code to stop an website from redirecting inside iframe?
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4496652].message }}
    • Profile picture of the author onlinecasinodeck
      Originally Posted by bigvito19 View Post

      What is the code to stop an website from redirecting inside iframe?
      <script type="text/javascript">
      <!--
      window.location = "http://www.redirect-Link.c0m/"
      //-->
      </script>
      remove the script similar to the line above.
      {{ DiscussionBoard.errors[4733421].message }}
  • Profile picture of the author bigvito19
    I'm still looking for a code if anyone has one
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4501081].message }}
  • Profile picture of the author brianman
    I'm not sure I understand what you're asking. Are you trying to stop a redirect that is being called from whatever is inside the iFrame? We need more specifics please.
    {{ DiscussionBoard.errors[4502484].message }}
  • Profile picture of the author bigvito19
    I'm trying to keep a website inside the iframe without it busting out to its page

    Ex. The website inside the iframe will redirect or bust out of it but I don't want it too.

    <iframe
    src="http://adfoc.us/2233183576"
    width="100%">
    </iframe>
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4502723].message }}
  • Profile picture of the author bigvito19
    Well I gave details and an example
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4503770].message }}
  • Profile picture of the author bigvito19
    Does anyone know a code to keep a website from redirecting or busting out an iframe????
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4504735].message }}
  • Profile picture of the author bigvito19
    Now I have a iframe code but only works with google chrome.
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4513241].message }}
  • Profile picture of the author francischan35
    You have to give the iframe an id attribute and a name:

    id="thisframe"

    for example. Then, you have to point to the id as the target for the URL. Otherwise, the call to the URL in the browser doesn't know where to send the page.

    So, you could have:

    <iframe id="myframe" etc, etc>

    then:

    <a href="http://your_url" target="myframe">

    The call to the url will go to the iframe with that ID.
    {{ DiscussionBoard.errors[4516282].message }}
  • Profile picture of the author bigvito19
    What about a site like linkbucks, that has a framebreaker, how would you iframe that site?
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4541076].message }}
  • Profile picture of the author bigvito19
    Anyone can update me on this??
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4559168].message }}
  • Profile picture of the author TigerNone
    Unfortunately there is no way to contain a site that uses framebreakers. Lots of blackhat sites have tried to run sites where they iframe sites like linkbucks, which is why linkbucks breaks out of frames. Browsers will always allow sites to break out because it would be dangerous if you could just iframe sites in the background.
    {{ DiscussionBoard.errors[4559285].message }}
  • Profile picture of the author lovenot
    Easy, use javascript. Create a function which if the iframe's src isn't the url that you want it to be, redirect it back to the url that you want. Also, add onchange="yourfunctionname()" to the iframe. So whenevever, the iframe loads or changes, it will do that function which checks for its src.
    {{ DiscussionBoard.errors[4559386].message }}
    • Profile picture of the author bigvito19
      Originally Posted by lovenot View Post

      Easy, use javascript. Create a function which if the iframe's src isn't the url that you want it to be, redirect it back to the url that you want. Also, add onchange="yourfunctionname()" to the iframe. So whenevever, the iframe loads or changes, it will do that function which checks for its src.


      Do you have a code for that or know where I can find one?
      Signature

      TheyXXX.com

      {{ DiscussionBoard.errors[4560265].message }}
      • Profile picture of the author lovenot
        Originally Posted by bigvito19 View Post

        Do you have a code for that or know where I can find one?
        You will require decent javascript knowledge to do this. Try jquery or google for:

        1. How to write a javascript function.
        2. a) How to get an element with javascript.
        b) How to set an element's id.
        3. How to set iframe's src to a different url.
        4. How to call a javascript function when an element changes. (onchange function)
        5. Combine all of the above.

        Hope this helps.
        {{ DiscussionBoard.errors[4560649].message }}
  • Profile picture of the author bigvito19
    Can someone update me with a code on this?
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4714902].message }}
  • Profile picture of the author bigvito19
    Can anyone update me on this?
    I could really use the help
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4729557].message }}
  • Profile picture of the author LakiPolitis
    You're not going to stop a page from executing its redirect in an iframe from another page. That just doesn't make sense. You need to put the link that you want in that iframe. You can't change code on page x from page y without using server side code, or editing page x's code.
    {{ DiscussionBoard.errors[4730723].message }}
    • Profile picture of the author bigvito19
      Originally Posted by LakiPolitis View Post

      You're not going to stop a page from executing its redirect in an iframe from another page. That just doesn't make sense. You need to put the link that you want in that iframe. You can't change code on page x from page y without using server side code, or editing page x's code.

      That's what I'm trying to do is put a website in an iframe, what are you saying, that doesn't make any sense
      Signature

      TheyXXX.com

      {{ DiscussionBoard.errors[4732761].message }}
      • Profile picture of the author andrejvasso
        Originally Posted by bigvito19 View Post

        That's what I'm trying to do is put a website in an iframe, what are you saying, that doesn't make any sense
        What LakiPolitis was saying makes sense. You maybe dont understand it or you didnt read what he/she was saying.

        There is no way you can change or modify what is happening on site X, without having access to it / being its webmaster.

        Just think about that: If that was possible, I would just modify Google to display my sites only for all kind of search terms and become a billionaire within a day...

        You can however, scrape a website´s content, modify it and display it on your site. But you can never change code on the original site without being its webmaster (or hacking the site...).

        As Jay Moreno already posted, to scrape a website and than modify the scraped code, take a look at PHP: cURL - Manual


        And just a small note about:

        Originally Posted by ASCiiDiTY View Post

        Google "anti frame breaker code"
        There is no such thing. There just cant be - its technically not possible to create a client-side only method that would cheat a frame breaker code. If you have bought something like that, you were scammed. If you are saying you created something like that, you are lying. (However feel free to prove me wrong and post the code...)
        {{ DiscussionBoard.errors[4850918].message }}
        • Profile picture of the author bigvito19
          Originally Posted by andrejvasso View Post

          What LakiPolitis was saying makes sense. You maybe dont understand it or you didnt read what he/she was saying.

          There is no way you can change or modify what is happening on site X, without having access to it / being its webmaster.

          Just think about that: If that was possible, I would just modify Google to display my sites only for all kind of search terms and become a billionaire within a day...

          You can however, scrape a website´s content, modify it and display it on your site. But you can never change code on the original site without being its webmaster (or hacking the site...).

          As Jay Moreno already posted, to scrape a website and than modify the scraped code, take a look at PHP: cURL - Manual


          And just a small note about:



          There is no such thing. There just cant be - its technically not possible to create a client-side only method that would cheat a frame breaker code. If you have bought something like that, you were scammed. If you are saying you created something like that, you are lying. (However feel free to prove me wrong and post the code...)



          There is a such thing as a anti-framebreaker code, I wouldn't be looking for it if it wasn't a such thing. When ever I do get the code I won't post it, believe that.
          Signature

          TheyXXX.com

          {{ DiscussionBoard.errors[4851004].message }}
          • Profile picture of the author andrejvasso
            Originally Posted by bigvito19 View Post

            There is a such thing as a anti-framebreaker code, I wouldn't be looking for it if it wasn't a such thing. When ever I do get the code I won't post it, believe that.
            Of course there are different ways to code an iframe buster and, as always, there are bad ways to do it.

            If the page, you are trying to steal content from, is using a poorly coded frame buster, you might be able to trick it.

            Another thing you have to consider: you might able to cheat a frame buster, but than it also depends on what browser your visitors are using.

            If they are still using IE6, you might have some chance to cheat almost all known frame busting scripts.

            However, if they are using a newer browser (for instance FF 3.6+,IE8+) and the website you are targeting is configured to use the x-frame-option, than you will NEVER be able to cheat it.

            So to summarize this:

            If the target website did a good job on that frame buster, than.... well, I tell you again: you will never be able to cheat it. Period.
            {{ DiscussionBoard.errors[4851081].message }}
            • Profile picture of the author cigal
              Anti Frame Breaker script:
              The whole idea is to stop execution of javascript in the frame/iframe which doesn't suppose to takeover parent frame/window.
              First put this function between html head tags:
              <script>
              function StopLoading()
              {
              if (!document.all)
              {
              window.stop();
              }
              else
              {
              window.document.execCommand('Stop');
              }
              }
              </script>

              Then just add onload event handler to iframe you want to supress, like this:
              <iframe onload="StopLoading()" src="someurl">
              {{ DiscussionBoard.errors[5576836].message }}
              • Profile picture of the author bigvito19
                Originally Posted by cigal View Post

                Anti Frame Breaker script:
                The whole idea is to stop execution of javascript in the frame/iframe which doesn't suppose to takeover parent frame/window.
                First put this function between html head tags:
                <script>
                function StopLoading()
                {
                if (!document.all)
                {
                window.stop();
                }
                else
                {
                window.document.execCommand('Stop');
                }
                }
                </script>

                Then just add onload event handler to iframe you want to supress, like this:
                <iframe onload="StopLoading()" src="someurl">



                Will it still work though?
                Signature

                TheyXXX.com

                {{ DiscussionBoard.errors[5706110].message }}
  • Profile picture of the author Jay Moreno
    theoretically you could drop the iframe and use PHP to scrape the page content you are trying to display instead...

    Search for PHP CURL Examples in Google

    Hope that helps...
    Signature
    Sorry, I am too busy helping people to think of a cool signature!
    {{ DiscussionBoard.errors[4730784].message }}
  • Profile picture of the author IceT
    If you are focusing on google better don't do it. Just a piece of advice
    Signature
    {{ DiscussionBoard.errors[4730923].message }}
    • Profile picture of the author bigvito19
      Originally Posted by IceT View Post

      If you are focusing on google better don't do it. Just a piece of advice


      I'm not using adsense.
      Signature

      TheyXXX.com

      {{ DiscussionBoard.errors[4732748].message }}
  • Profile picture of the author bigvito19
    I'm on a mission to get that code
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4732735].message }}
  • Profile picture of the author bigvito19
    But that just keeps looping or redirecting the page over and over again
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4733964].message }}
  • Profile picture of the author bigvito19
    I'm on a mission to find that code, If I get it, traffic+rank=$$$$$$
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4754304].message }}
  • Profile picture of the author bigvito19
    Let me know if anyone has any info on this
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[4847800].message }}
  • Profile picture of the author ASCiiDiTY
    Google "anti frame breaker code"
    {{ DiscussionBoard.errors[4850705].message }}
  • Profile picture of the author bigvito19
    I'm back, any updates on this yet
    Signature

    TheyXXX.com

    {{ DiscussionBoard.errors[5882644].message }}
    • Profile picture of the author Wargamon
      Originally Posted by bigvito19 View Post

      I'm back, any updates on this yet
      Hi, did you manage to get it resolve? If I read correctly, you have iframe injected with URL and want to prevent the origin URL to breakout of your iframe?
      {{ DiscussionBoard.errors[7765923].message }}
  • Profile picture of the author Michael71
    There is no 100% working anti framebreaker script... fact!
    Signature

    HTML/CSS/jQuery/ZURB Foundation/Twitter Bootstrap/Wordpress/Frontend Performance Optimizing
    ---
    Need HTML/CSS help? Skype: microcosmic - Test Your Responsive Design - InternetCookies.eu

    {{ DiscussionBoard.errors[7766017].message }}
    • Profile picture of the author Wargamon
      Originally Posted by Michael71 View Post

      There is no 100% working anti framebreaker script... fact!
      Hi Michael, I am referring to origin URL not framebreaker like linkbucks and adfly.
      {{ DiscussionBoard.errors[7766243].message }}

Trending Topics