Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    0
    dolittle is an unknown quantity at this point

      0  

    Default prevent iframe redirect

    prevent iframe redirect


    Hi,

    I have a website inside an iframe.
    Both the website and the iframe are at the same domain but I'm not allow to modify the website code. I have full control over the top frame code.

    When the inner page is inside an iframe it uses a code to load the page without the iframe:
    Code:
    if (top != self) { top.location.replace('http://example.com'); }
    Is there a way to prevent this without modifying the inner page code?

    Can I somehow overwrite the top.location.replace function?
    I've tried:
    Code:
    top.location.replace = new Function("x", "return false");
    and I also tried:
    Code:
    top.location.replace = function(nUrl) {
    	return false;
    }
    Both doesn't work.

    Thanks

  2. #2
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Question


    Tried setting
    Code:
    frame.window.top = frame.window.self;
    after its loaded?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    0
    dolittle is an unknown quantity at this point

      0  

    Default


    Tried setting frame.window.top = frame.window.self;
    after its loaded?
    Should I put it in the top frame or in the inner iframe?
    I don't have access to the inner iframe code only the top frame.

    Is it possible to overwrite internal javascript function like location.replace()?

  4. #4
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    @dolittle -- If:

    1) you are using ManagedIframePanel
    2) the "if (top != self) { top.location.replace('http://example.com'); }" is executed during/after onload event.

    you could try:
    Code:
    new Ext.ux.ManagedIframePanel({
       defaultSrc : 'yourLocalPage.html',
       listeners: {
          domready : function(frame){
              var w;
              if(w = frame.getWindow()){
                 w.top = w.self;
              }
         }
      },....
    });
    Is it possible to overwrite internal javascript function like location.replace()?
    That, is likely NOT allowed.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    0
    dolittle is an unknown quantity at this point

      0  

    Default


    Unfournatly I can't use ManagedIframePanel because of its GPL license and because the code has to be small.

    Thanks anyway.

  6. #6
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Quote Originally Posted by dolittle View Post
    Unfournatly I can't use ManagedIframePanel because of its GPL license and because the code has to be small.

    Thanks anyway.
    =< 1.2 is still LGPL. 2.0+ will not be.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  7. #7
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    0
    dolittle is an unknown quantity at this point

      0  

    Default


    I've created a simple test.
    I put the following code in the header of the inner iframe and it works on in FF and not in IE7:
    Code:
    window.top = window.self;
    IE7 bug says:
    Code:
    Error: Not implemented
    Code: 0
    I tried to create the iframe using your code with ManagedIframePanel and the domready event:
    Code:
    Ext.onReady(function(){	
    	new Ext.ux.ManagedIframePanel({
    		renderTo: 'iframeWrap',
    		defaultSrc : 'iframe.html',
    		listeners: {
    			domready : function(frame){
    				var w;
    				if(w = frame.getWindow()){
    					w.top = w.self;
    				}
    			}
    		}
    	});
    });
    In the iframe.html body I put:
    Code:
    if (top != self) { top.location.replace('http://localhost/test/iframe.html'); }
    But it still redirects.

    Another issue is that all the pages of the website have the redirect code but I'll be able to attach the event only to the first page.

  8. #8
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    @dolittle -- I'd say you have too many constraints imposed upon you (and from your own domain, boo) .

    Where/when in the embedded page(s) are they asserting top != self?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  9. #9
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    0
    dolittle is an unknown quantity at this point

      0  

    Default


    It turns out that I can inject javascript code before the frame breaker but can't take it out.
    Can I change the innerHtml of the script using another script that is being executed before?

    The script with the top!=self is placed at the bottom of the body part of the iframe:
    Code:
    <body>
         some html
         ...
         ...
         <script type="text/javascript">
             if (top != self) { top.location.replace('http://best999.ning.com'); }
        </script>
    </body>
    I know it sound strange but I need to put a CMS inside an iframe, both on the same server but I'm not allowed to change the code of the CMS.

  10. #10
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    0
    dolittle is an unknown quantity at this point

      0  

    Default


    @cwhsjb
    I don't understand what you are saying.

Thread Participants: 1