Hot to resize iframe after click

locknload007

Power Member
Joined
Apr 14, 2010
Messages
554
Reaction score
86
So far it seems like it is impossible to bust out of an iframe when the framed site is an external link you have no access to.

OK, why not just resize the iframe? If they click a submit button, lets shrink the iframe to 1px by 1px so the content is hidden.

This would be good for cakeslices. You got a nice little slice of cake, they submit the email, the iframe shrinks, they assume you got their email.

So, how to do it. I have done hours of Googling for different things with no success.
 
I don't think it's possible. Security policy prevents you from manipulating of the iframe's content (unless on the same server). You don't have access to DOM of hosted iframe neither you receive events from it.
In other words you don't know when user clicks inside your iframe.

pk
 
you can resize an iframe really easily just by using js, but afaik there's no reliable way to detect a click or submit inside an iframe if you don't control the target page.

i think the closest thing you can do is detect when the cursor moves over the submit button, and then detect when it moves away, and assume that a click happened in between.
 
It's absolutely possible. I had the same problem as you, and after about 3 days of working on something, I came up with a working (and beautiful might I add :) , solution).

You can see it here: http://www.blackhatworld.com/blackh...tate-offers-session-cookies-instructions.html

If you'd like, PM me what you're looking to do exactly, and I'll post a working solution for you here on this thread. Should only take me a couple minutes to cook up for you.
 
I figure you didn't get a chance to read my last response yet, so I took the initiative to put together a working example for you anyway :)

Here you go:

http://www.get-stuff-free.info/onclick/test.htm

I have iFramed Googles search box. Go ahead and type something in the search box, and then click "search".

If "Google instant" is on, you'll need to click on a search result. Just click on something to see the example work.

The iFrame (and the words I've typed above them) will disappear.

Enjoy!
 
Last edited:
The above is obviously an INCREDIBLY simple/crude example, and looks terrible.

However, it is an EXCELLENT proof of concept for you to work off of.

Let me know if you need any help.
 
Last edited:
And yet another example where you make the iFrame disappear (onclick) & have new content appear in it's place (and again, this is a simple/crude example, but great proof of concept).

Go ahead and type something in the search box, and then click "search".

If "Google instant" is on, you'll need to click on a search result. Just click on something to see the example work.

http://www.get-stuff-free.info/onclick/test2.htm
 
Last edited:
And yet another example where you make the iFrame disappear (onclick) & have new content appear in it's place (and again, this is a simple/crude example, but great proof of concept).

Go ahead and type something in the search box, and then click "search".

If "Google instant" is on, you'll need to click on a search result. Just click on something to see the example work.

http://www.get-stuff-free.info/onclick/test2.htm

First, I tried your code from your thread, and I could get my cakeslice working, it was correct referrer, but the content locker, I just could not get it working. Part of it may be the cookies, though I deleted them a few ties to try and see if that was it. I was almost wondering if it was possible, I swear, I have the biggest grin on my face seeing that working.

I am PM'ing you now.

Thanks
 
It looks like this content locker uses history. I was thinking it was cookies. So, it automatically advances to the clicked a link div section because it knows I have been to the page before. It is hard to troubleshoot the page when that happens.
 
@crazyflx: that's freaking cool, i'd never find this myself. +rep

one glitch - i doesn't work in chrome

pk
 
I am PM'ing you now.

Thanks

My PM box is pretty full, I have to weed through it, but I'll shoot you a PM soon.

It looks like this content locker uses history. I was thinking it was cookies. So, it automatically advances to the clicked a link div section because it knows I have been to the page before. It is hard to troubleshoot the page when that happens.

It doesn't use pre-existing history, it only checks to see if the history changes from the time you hit the page on.

This line of the javascript is the very first line:

Code:
var oldHistLength = history.length;

That means that it "measures" your history length the moment you arrive at the page, and sets that as a variable.

Then, if that variable changes, it puts whatever you want to happen into action.



@crazyflx: that's freaking cool, i'd never find this myself. +rep

one glitch - i doesn't work in chrome

pk

Thanks, glad to hear you like it.

As for Chrome, just checked in Chrome 6.0.472.63 and it works perfectly.
 
I have figured out how to redirect cakesliced iframes to go where ever I want it to go.
 
So far it seems like it is impossible to bust out of an iframe when the framed site is an external link you have no access to.

OK, why not just resize the iframe? If they click a submit button, lets shrink the iframe to 1px by 1px so the content is hidden.

This would be good for cakeslices. You got a nice little slice of cake, they submit the email, the iframe shrinks, they assume you got their email.

So, how to do it. I have done hours of Googling for different things with no success.
great. thank you
 
can anyone make a video explaining all that because it seems very complicated for me so please help !
 
Back
Top