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

Waldo Bastian bastian at kde.org
Sat Jun 15 01:16:13 BST 2002


On Thursday 13 June 2002 06:24 pm, Malte Starostik wrote:
> -----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?

Try this patch.

Cheers,
Waldo
-- 
bastian at kde.org  |   SuSE Labs KDE Developer  |  bastian at suse.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: khtml_framecount.patch
Type: text/x-diff
Size: 856 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20020614/8cfa8d80/attachment.patch>


More information about the kfm-devel mailing list