Bug 109070 - [test case] window.open() with existing target window
Summary: [test case] window.open() with existing target window
Status: CONFIRMED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-14 13:03 UTC by Oswald Buddenhagen
Modified: 2021-03-21 00:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test case (217 bytes, text/html)
2006-06-12 12:31 UTC, Allan Sandfeld
Details
fresh testcase (different methods) (707 bytes, text/html)
2008-04-16 23:06 UTC, Christophe Marin
Details
popup window (187 bytes, text/html)
2008-04-16 23:06 UTC, Christophe Marin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oswald Buddenhagen 2005-07-14 13:03:23 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

window.open(url, target) should reuse the named target window when invoked repeatedly, but it does not for some months now.
this is like bug 25639 and bug 71164, except that it is definitely js-related.
Comment 1 Oswald Buddenhagen 2005-09-24 09:25:01 UTC
more weirdness: if the existing target window has non-html content, then nothing happens - no new window is opened and the old content stays.
Comment 2 ray 2006-06-11 14:33:14 UTC
This bug is still present in 3.5.3 (from the SuSE 10.1 RPMs).  This may have been (temporarily) fixed last year :- http://lists.kde.org/?l=kfm-devel&m=109991180218788&w=2

Very annoying when a Konq upgrade breaks my web app.
Comment 3 Allan Sandfeld 2006-06-11 23:50:36 UTC
Do you have a test-case you can attach to the bug?
Comment 4 Oswald Buddenhagen 2006-06-12 00:45:14 UTC
are you kidding?
<a href="javascript:window.open('http://www.kde.org', 'target')">click me once, click me twice ... thrice ...</a>
Comment 5 Allan Sandfeld 2006-06-12 12:31:12 UTC
Created attachment 16567 [details]
Test case

No, I am not kidding
Comment 6 Allan Sandfeld 2006-06-12 12:32:40 UTC
The interesting thing is that the normal targeted link also opens multiple windows. This seems to be a regression for bug #25639
Comment 7 ray 2006-06-12 14:13:06 UTC
This does not appear to behave consistently. What seem inconsequential changes in the page source change the behaviour from opening multiple windows, all reporting the same name (document.write("window.name = " + window.name);), to opening in the same target window. It does not seem to be related to non-html in the target page or to whether the webserver is local or remote (or using konqueror to open a local html file without using a webserver). When I get some spare time (later today) I will post demo pages to a publicly accessible site.
Comment 8 Christophe Marin 2008-04-16 23:05:35 UTC
Tested in trunk (rev. 797569).

I tested Allan's file and a selfmade file.

If the window.open opens a local file, everything works as intended (window.name is correct).

The situation is different with distant websites and what was first reported still happens.

Comment 9 Christophe Marin 2008-04-16 23:06:16 UTC
Created attachment 24362 [details]
fresh testcase (different methods)
Comment 10 Christophe Marin 2008-04-16 23:06:54 UTC
Created attachment 24363 [details]
popup window
Comment 11 Gérard Talbot (no longer involved) 2009-10-13 00:08:08 UTC
What is your 
Configuration/Configure Konqueror.../General category/Open links in a new tab instead of a new window
checkbox setting? Is it checked or not checked? This is important for this bug.

That setting configures the handling of the HTML 4 target attribute specification: this has been specified by the HTML 4 spec and (IIRC) UAAG 1. And by default, it is checked in Konqueror.

----------

> window.open(url, target) should reuse the named target window when invoked repeatedly

This is DOM 0: so, strictly speaking, it's undefined. 
window.open(url, target) may reuse the named target window, but it will NOT [re-]focus (raise on top of other window instances) the existing targeted window. You will need [WindowObjectReference.]focus() if the user settings permits this (it seems that Konqueror 4.3.2 does not by default allow scripters to make use of focus()). 

IMO, the proper and best coding practice for reusing a window has been defined and explained at

window.open() at MDC (best practices)
https://developer.mozilla.org/en/DOM/window.open#Best_practices

regards, Gérard
Comment 12 Justin Zobel 2021-03-21 00:24:52 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 10 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.