Forum Moderators: open

Message Too Old, No Replies

How to get the real URL of the loaded content of iFrame?

Getting real URL of iFrame's content

         

didalko

6:27 pm on May 3, 2009 (gmt 0)

10+ Year Member



Hi folks,
I need to get(to have) the real URL of the loaded content of the iFrame tag when the user browses links within the iFrame.
I checked a lot of forums about this problem. I understand the security reasons of the browsers to do that - impossible to monitoring the clicked links on loaded content in any iFrame tag.
But I can not accept this fact, I think there is a solution for this problem and somebody have to know that.
Unfortunately I do not have solution for that yet. I read a lot of post for that, but did not find a work answer for the problem.
I appreciate any work solution from everybody!

Thank you in advance!

g1smd

7:21 pm on May 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



*** I can not accept this fact ***

Good luck!

londrum

8:36 pm on May 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



your site will just get branded as a phisher if you do that. all the browsers will flag it.

didalko

8:36 pm on May 3, 2009 (gmt 0)

10+ Year Member



I see ...

didalko

8:55 pm on May 3, 2009 (gmt 0)

10+ Year Member



g1smd:
*** Good luck! ***

I understand you, but check this Bulgarian web site HERE IS MADE IT THE SOLUTION OF THE MY PROBLEM ABOVE:

<snipped url>

See in the BIG TEXT BOX field - there is shown the REAL URL of the loaded content of the iFrame. Click on any link within the iFrame i.e. click Jewelry link and see the real URL is shown in to the BIG TEXTBOX field.
OK men, I need exactly the same functionality for another web site. It looks these guys got solution, but WHAT IS THE SOLUTION ?!?

[edited by: whoisgregg at 3:28 pm (utc) on May 4, 2009]
[edit reason] Whoops, no URLs please. See TOS & Stickymail. [/edit]

londrum

9:19 pm on May 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



just view the source code and it's got all their javascript at the top.

it's not a very good idea though. nine times out of ten the other site will have some kind of easy frame-breaking script on it and it will just pop out of your frame.

didalko

9:46 pm on May 3, 2009 (gmt 0)

10+ Year Member



I know that, but the client wants this functionality it doesn't matter of the frame breaking scripts of the external domain page.
OK, my previous post with the web link shows some kind of solution.
What is exactly the possible selection with JavaDcript by DOM to get the real URL of the navigated content of the iFrame tag? This is a CLEAR QUESTION! Please, give me a CLEAR ANSWER!
For EXAMPLE these selections DO NOT work:

alert(document.getElementById('iframe').contentDocument.location.href);
alert(document.getElementById('iframe').document.location.href);

<body>
<Iframe id="iframe" src="http://www.google.com" width="950" height="600"></Iframe>
</body>

Thank you!

whoisgregg

3:40 pm on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, didalko!

The community here at WebmasterWorld is quite knowledgeable and very helpful. No one is trying to hide the answer from you, it's simply a matter that what you are trying to accomplish is designed by the people who make browsers to be impossible. You may be able to find loopholes that work in certain circumstances in certain browsers but those loopholes will eventually be closed.

I know how frustrating it is when clients demand the impossible, but this may be a better opportunity to educate the client rather than an opportunity to try to get around browser security models.

didalko

8:15 pm on May 4, 2009 (gmt 0)

10+ Year Member



OK, thank you guys for your answers!