Bug 7638 - Javascript cannot set location of an iframe if the iframe contains a non-html file
Summary: Javascript cannot set location of an iframe if the iframe contains a non-html...
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 420+
Hardware: PC Windows XP
: P2 Major
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-03-07 00:20 PST by henrik.soderlund
Modified: 2008-11-28 14:05 PST (History)
3 users (show)

See Also:


Attachments
Bug demonstration (open index.html in Safari) (7.41 KB, application/zip)
2006-03-07 00:25 PST, henrik.soderlund
no flags Details
additional test case (811 bytes, text/html)
2006-03-07 10:46 PST, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description henrik.soderlund 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.
Comment 1 henrik.soderlund 2006-03-07 00:25:05 PST
Created attachment 6909 [details]
Bug demonstration (open index.html in Safari)
Comment 2 Alexey Proskuryakov 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.
Comment 3 Peer Bremer 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()
Comment 4 David Kilzer (:ddkilzer) 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

Comment 5 Alexey Proskuryakov 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.