Closed Bug 109925 Opened 23 years ago Closed 23 years ago

new windows opened by bookmarklet lose focus immediately

Categories

(SeaMonkey :: UI Design, defect)

x86
Windows 98
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 108394

People

(Reporter: basil, Assigned: bryner)

References

()

Details

(Keywords: regression, Whiteboard: [see the simple testcase in Comment #4])

I'm using the latest-trunk build on Windows 98 (2001111303-trunk). 

The javascript: pseudo-URL above is a bookmarklet (very similar to several that
I use) that is broken in this build. I would assume that this is a feature to
help with annoying pop-up ads, but it breaks my bookmarklets. 

To reproduce:
1. click on link above.

Expected behavior:
The new window should get the focus.

Actual behavior:
It doesn't. Current window grabs focus.
Hmm. It appears that when that code is called from the URL link above, it
behaves as expected, but when it is called from the bookmarklet in my Personal
Toolbar, it loses focus immediately. Maybe a pref issue?
It appears also that if simply paste the above pseudo-URL into the address bar,
I see the bad behavior.
Looks like a focus problem. As reported by Basil, I see the window vanish when 
activated as a bookmarklet and also when pasting the link into the URL box and 
presssing enter. I highly doubt this is a JS engine problem. Perhaps bookmarks 
or XP apps? 

This problem has nothing to do with the size of the window, so changing summary 
from "new windows lose focus immediately if they are too small".
Status: UNCONFIRMED → NEW
Component: Javascript Engine → Bookmarks
Ever confirmed: true
Summary: new windows lose focus immediately if they are too small → new windows opened by bookmarklet lose focus immediately
Here's a trimmed down javascript URL that demonstrates the same problem:

javascript:void(window.open('','w','width=1024,height=700'))

This opens a new window that retains focus in Netscape 4 and IE as expected.
Keywords: 4xp
Keywords: regression
Also works fine in 0.9.5 and earlier.
Browser, not engine. Reassigning to XP Apps: GUI Features.
cc'ing danm in case he knows the answer to this - 
Assignee: rogerl → blakeross
Component: Bookmarks → XP Apps: GUI Features
QA Contact: pschwartau → sairuh
Whiteboard: [see the simple testcase in Comment #4]
QA Contact: sairuh → jrgm
-> bryner
Assignee: blakeross → bryner
Has anyone seen this on other platforms? Or is it Windows only? I even tried
adding an explicit call to focus the window, but that didn't work (probably
because of bug 57841). New windows should gain focus immediately anyway. Here's
what I tried:

javascript:var w=window.open('','w','width=800,height=600');w.focus();

Bug 53350 comment #18 also mentioned this javascript/bookmarklet problem, but I
don't think it's been broken for that long. Bug 71266 fixed something similar,
but sounds like the fix wasn't added to every call. Perhaps I'm misunderstanding
bug 71266 comment #29. Basil, do you know of a build where this worked?
In case this is helpful to anyone, the new window stayed on top in 0.9.2 and
doesn't stay on top with 0.9.4. I know that's a large range and a long time ago...
Odd. I have a 0.9.5-release build in Windows 98, and the new window gains and
retains focus as expected. I will try a 0.9.4-release build and see if I can
reproduce that issue on my machine.
Tim, are you using a fresh profile? I installed 0.9.4 using the talkback .ZIP
file and it gains and retains focus as expected. For me, the unexpected behavior
of losing focus began in a nightly somewhere between 0.9.5 and 0.9.6.
I was using a current profile with the 0.9.4 build. The mind boggles if that 
has some impact on whether it works or not. From what I recall, it was post 
0.9.5 that this started breaking.
In response to comment #8, I am not seeing this behavior in 0.9.7 linux. Thus,
it seems to be a Windows-only issue. If someone could test in Mac and confirm
platform specificity, that would be cool.

*** This bug has been marked as a duplicate of 108394 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.