RESOLVED DUPLICATE of bug 164907 17627
Endless reloads on http://space.cweb.nl
https://bugs.webkit.org/show_bug.cgi?id=17627
Summary Endless reloads on http://space.cweb.nl
Jur Kuipers
Reported 2008-03-01 02:39:34 PST
Sorry... I'm not a developer-guy... I noticed the website with this URL keeps 'blinking' in Safari 3.0.4 and Webkit In Firefox it is OK URL: http://space.cweb.nl/iss_pass_prediction.html Hope you can look into this... It's very annoying Best regards, Jur Kuipers, The Netherlands iMac iSight G5 OSX 10.5.2
Attachments
Matt Lilek
Comment 1 2008-03-01 11:04:08 PST
Confirmed with r30692 - the site keeps reloading.
Jubal Kessler
Comment 2 2008-04-06 09:47:51 PDT
(simplified test case) The URL calls an IFRAME that points to another site's page: <iframe src="http://otherdomain.com/B.html"></iframe> On that other site's page, there is some JavaScript: <script type="text/javascript"> if (top.location.host != "http://somedomain.com/A.html") top.location.href="http://somedomain.com/A.html"; </script> In r31667, going to http://somedomain.com/A.html will load the IFRAME, which in turn checks if the URL location is in fact http://somedomain.com/A.html, and failing that check, loads that URL. In FF2/Mac the original URL works fine but the test reduction above doesn't. In Safari both fail.
Jubal Kessler
Comment 3 2008-04-06 10:01:37 PDT
To be clear, the IFRAME on the original URL is calling a PHP page, not a straight HTML one. Without contacting the author of the original website, it's impossible (I think) to know what is in this PHP code. Without this knowledge, the mystery of why the original URL works in Firefox cannot be explained. On another topic: Is this JavaScript routine broken? Shouldn't the top.location.host check actually work, e.g. not attempt to reload the page because the location of the calling page is, in fact, the correct location?
Jubal Kessler
Comment 4 2008-04-06 10:12:40 PDT
Answered my own question. top.location.host returns the bare hostname -- not the 'http://' prefix or the '/page.html' path. So the check always fails because top.location.host != 'space.cweb.nl', and the constant reloading happens. Except in Firefox, apparently.
Alexey Proskuryakov
Comment 5 2008-04-06 23:09:12 PDT
This code is definitely broken - location.host doesn't return the complete URL in either Safari or Firefox. The reason the page doesn't misbehave in Firefox is that an exception is raised for an attempt of cross-domain access to top.location.host, so the test is simply bypassed. In WebKit, an undefined value is returned for this attempt, and no exception is raised.
Jubal Kessler
Comment 6 2008-04-07 10:04:22 PDT
Mr Kuipers: Please contact the owner of the space.cweb.nl site and inform him that the code on this page (which the main page's IFRAME points to) needs its JavaScript fixed according to comment #4: http://sts.ontwikkel.net/phplocos.php Re: bug status. Should WebKit emulate Firefox in this instance or should it retain strict interpretation? (I'd favor the latter as this type of erroneous JS coding isn't all that common, I'd hope.)
Cameron Zwarich (cpst)
Comment 7 2008-06-30 11:39:45 PDT
*** This bug has been marked as a duplicate of 19822 ***
Cameron Zwarich (cpst)
Comment 8 2008-07-01 01:08:04 PDT
This bug is not actually a duplicate of bug 19822, because my fix for that bug does not fix this one.
Frances Cornwall
Comment 9 2024-07-01 17:16:28 PDT
Frances Cornwall
Comment 10 2024-07-01 17:16:58 PDT
*** This bug has been marked as a duplicate of bug 164907 ***
Note You need to log in before you can comment on or make changes to this bug.