RESOLVED WORKSFORME 7638
Javascript cannot set location of an iframe if the iframe contains a non-html file
https://bugs.webkit.org/show_bug.cgi?id=7638
Summary Javascript cannot set location of an iframe if the iframe contains a non-html...
henrik.soderlund
Reported 2006-03-07 00:20:47 PST
It seems that javascript can only change the "location" property of an iframe if that iframe is empty or contains an html document. If the iframe contains a jpg, gif, pdf file etc, "location" cannot be changed at all.
Attachments
Bug demonstration (open index.html in Safari) (7.41 KB, application/zip)
2006-03-07 00:25 PST, henrik.soderlund
no flags
additional test case (811 bytes, text/html)
2006-03-07 10:46 PST, Alexey Proskuryakov
no flags
henrik.soderlund
Comment 1 2006-03-07 00:25:05 PST
Created attachment 6909 [details] Bug demonstration (open index.html in Safari)
Alexey Proskuryakov
Comment 2 2006-03-07 10:46:46 PST
Created attachment 6920 [details] additional test case Similar tests with data: URLs, self-contained. I'm not sure if this obsoletes the original test case, probably not.
Peer Bremer
Comment 3 2007-07-05 23:33:51 PDT
Have seen the same, works on Safari Beta 3.02 but no longer with webkit at all here is a test: http://www.smilecms.com/webkit/iframe.html Simple javascript function that uses location.replace()
David Kilzer (:ddkilzer)
Comment 4 2007-07-07 12:38:54 PDT
(In reply to comment #3) > Have seen the same, works on Safari Beta 3.02 but no longer with webkit at all > here is a test: > http://www.smilecms.com/webkit/iframe.html > > Simple javascript function that uses location.replace() The iframe.document property is no longer supported; please use iframe.contentDocument instead. This example produces a JavaScript error when the link is clicked in the test: TypeError: Undefined value http://www.smilecms.com/webkit/iframe.html Line: 32
Alexey Proskuryakov
Comment 5 2008-11-28 14:05:04 PST
This has been fixed for a while - I can no longer reproduce this problem with Safari 3.1.2.
Note You need to log in before you can comment on or make changes to this bug.