Problem with frame count (parent.frames.length) after navigation

Malte Starostik malte at kde.org
Fri Jun 14 02:24:13 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

the problem shows when browsing www.allmusic.com. To reproduce, go there, 
enter any band name (or just anything, they always produce results LOL) into 
the search field and submit the form.
- From the resulting page (note, the form was POSTed), click any link and then 
navigate back via alt-left or the back button etc.
Shortly after the old page was loaded, it will be replaced by a blank page 
with the nice message "Program name not found".
This is the result of the page being reloaded w/o the POST data.
The reason for the reload is this JS in the document's HEAD:

if (parent.frames.length > 0) {parent.location.href = self.document.location}

There IS a frame in the page, an IFRAME for the ad banner. What konq does 
differently than other browsers (tested Mozilla and IE) is this:
on first load, the above code is executed *before* the BODY, so the IFRAME 
isn't there yet => parent.frames.length is 0.
When navigating back to the page, parent.frames.length is 1 even while 
executing that code.

A test case is online at http://malte.homeip.net/framecount.html
It displays the frame count before and after load (once from the doc's HEAD, 
once on the BODY's onload event). The former should be 0 and the latter 1. 
This works fine as long as the page isn't loaded from the navigation cache.

Any hint where to fix this?

TIA,
- -- 
Malte Starostik
PGP: 1024D/D2F3C787 [C138 2121 FAF3 410A 1C2A  27CD 5431 7745 D2F3 C787]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9CUXAVDF3RdLzx4cRAoNSAKCY2pFp6MDvTIOvVWAQndMJqe3KJACggtLO
j/HmqYINQ1HckKPh01mjtx0=
=JtzY
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list