javascript - Gathering location of an IFRAME -
i building script/application (on client side , on proxy site too) gathers information elements various web-sites.
one last thing makes me troubles gathering location of iframe. let me explain in more details:
- invariant: location of iframe not changed via user interaction
- some web-pages uses src attribute define location of new iframe - either defined via scripting or manually typed in source - this ok (no problem)
- other web-pages uses various techniques how populate iframe dynamically , not use src attribute of iframe - this ok if location of such iframe inside same domain, otherwise unsafe access other domain
i include 1 example of html code:
<html> <body> <a href="http://www.google.com" target="test_iframe">click here open iframe.</a> <br> <iframe id="test_iframe" name="test_iframe"></iframe> </body> </html>
so if try javascript below empty string.
document.getelementbyid("test_iframe").src
and if try use below security error.
document.getelementbyid("test_iframe").conentdocument.location.href
so question can reduced to:
- are there technique gather location of such iframe content outside parent domain , iframe without src attribute?
thank answers :-)
this called iframejailing. not possible read or alter iframe element in page if pointing different domain. inbuilt security feature in browsers.
however, there workarounds if domains in questions can work create iframe proxy (google more info), feel in case not applicable.
respond if have more questions.
Comments
Post a Comment