If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Two windows opened when clicking a local html file or internet shortcut / Do not use DDE on Windows

RESOLVED FIXED

Status

SeaMonkey
General
--
major
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Stefan A. Möller, Assigned: mcsmurf)

Tracking

({regression})

Trunk
x86
Windows 2000
regression
Bug Flags:
blocking-seamonkey2.0a2 -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 5 obsolete attachments)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b1pre) Gecko/20080925121544 SeaMonkey/2.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b1pre) Gecko/20080925121544 SeaMonkey/2.0a1

If you register SeaMonkey 2.0a1 as your default internet application on Windows 2000, and then double click a local html file or an internet shortcut file, SeaMonkey will open two windows at once.

Reproducible: Always

Steps to Reproduce:
1. Install SM 2.0a1 on Windows 2000 and check the "default application" entries on the corresponding SeaMonkey installer dialog.
2. Double click a local html file or an internet shortcut file.
Actual Results:  
Two browser windows open (both having the same content).

Expected Results:  
Only one window.

Now I've searched through the Windows registry and deleted the "ddeexec" subfolders for all those protocols and file types SeaMonkey is associated with. That fixes the problem. And it seems to have no other negative impact. So why use DDE at all?
(Reporter)

Comment 1

9 years ago
More precise:

Steps to Reproduce:
1. Install SM 2.0a1 on Windows 2000 and check the "default application" entries
on the corresponding SeaMonkey installer dialog.
2. Close all SM windows.
3. Double click a local html file or an internet shortcut file.
Actual Results:  
Two browser windows open (both having the same content).
Version: unspecified → Trunk

Comment 2

9 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081023 SeaMonkey/2.0a2pre

It open two browser window, when in Profile Manager is one profile or mark option "Don't ask at startup".

When it open Profile Manager during start html local file, past click button "Use Profile" SeaMonkey Crash.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-seamonkey2.0a2?

Comment 3

9 years ago
For crash was file Bug 462221
(Reporter)

Updated

9 years ago
Keywords: regression
(Assignee)

Comment 4

9 years ago
Probably need to port Bug 370053 to SeaMonkey.
(Assignee)

Comment 5

9 years ago
Just checked in SeaMonkey 1.x code, it does not use DDE for the file extension registry entries and normal protocol registry entries, only for the http protocol. I guess I'll change it back to the 1.x way then in Bug 453797.
Depends on: 453797

Comment 6

9 years ago
Set blocking on bug 453797 which should fix this issue.
Flags: blocking-seamonkey2.0a2? → blocking-seamonkey2.0a2-
Could you test and confirm bug 453797 comment 11 (resolution) ?
(Reporter)

Comment 8

9 years ago
Latest trunk nightly [Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b3pre) Gecko/20081201 SeaMonkey/2.0a2pre] still uses DDE, therefore this bug remains present.

Does that build actually contain the fix to bug 453797?
(Assignee)

Comment 9

9 years ago
No, try tomorrow's nightly.
(Reporter)

Comment 10

9 years ago
Still not fixed in Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b3pre) Gecko/20081202 SeaMonkey/2.0a2pre
(Assignee)

Comment 11

9 years ago
Can you maybe try to just manually set IE as default and then SeaMonkey as default again? I don't think the current code bothers to delete the DDE entries.
(Reporter)

Comment 12

9 years ago
I *have* manually removed all DDE entries from the registry before installing SeaMonkey.

The procedure was as follows:

1. Set Firefox as default browser, uninstalled SeaMonkey and manually removed all DDE entries.

2. Ran the SeaMonkey installer. --> Result: All DDE entries are back again - those for the classes SeaMonkeyHTML and SeaMonkeyURL, and those for the protocols http, https, ftp, and gopher.

3. Set SeaMonkey as default browser. --> 2 Windows open, both for local html files and internet shortcuts.

4. Manually removed the DDE entries from the classes SeaMonkeyHTML and SeaMonkeyURL. --> 1 Window when opening a html file, but still 2 Windows when clicking an internet shortcut (or when SeaMonkey is invoked from another application).

5. Manually removed all DDE entries from the four protocols also. --> Now everything is fine: Only one Window in any case.

6. Set Firefox as default browser.

7. Set SeaMonkey as default browser again. --> The DDE entries for the protocols http, https, ftp, and gopher reappeared. --> Still 1 Window when opening a html file, but again 2 Windows when clicking an internet shortcut.
(Assignee)

Comment 13

9 years ago
Created attachment 350991 [details] [diff] [review]
Patch

This one fixes the HTML file part. Need to do more research on the http one (as we need to keep DDE there for other programs opening URLs with SeaMonkey).
(Assignee)

Comment 14

9 years ago
Created attachment 350993 [details] [diff] [review]
Better patch

Fixes another instance in the code (only used in special cases)
Attachment #350991 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Attachment #350993 - Flags: review?(bugzilla)
Comment on attachment 350993 [details] [diff] [review]
Better patch

This looks reasonable, though I haven't tested it.
Attachment #350993 - Flags: review?(bugzilla) → review+
(Assignee)

Comment 16

9 years ago
Comment on attachment 350993 [details] [diff] [review]
Better patch

Checked in, changeset 4df5cfe0ebc5, a=KaiRo via IRC

Comment 17

9 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090114 SeaMonkey/2.0a3pre

It's work fine for me.

Updated

9 years ago
Duplicate of this bug: 462139
(Assignee)

Updated

9 years ago
Duplicate of this bug: 473978
(Assignee)

Comment 20

9 years ago
This was fixed in Firefox like this:
http://hg.mozilla.org/releases/mozilla-1.9.1/annotate/a55703da8f45/browser/components/nsBrowserContentHandler.js#l698
http://hg.mozilla.org/releases/mozilla-1.9.1/annotate/a55703da8f45/browser/components/nsBrowserContentHandler.js#l732

Comment 21

9 years ago
I was able to get the double windows to open (clicking on links in Outlook) with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090127 SeaMonkey/2.0a3pre

If SeaMonkey is already open, only one window opens. If SeaMonkey is not open, it will launch two windows. One will go to my startup page, the other window will open to where the link is.

Opening a shortcut link on the desktop opens two windows, both with the destination listed in the shortcut.

Behaves the same in  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090130 SeaMonkey/2.0a3pre
(Assignee)

Comment 22

9 years ago
Created attachment 360101 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

This should do the trick.
Assignee: nobody → bugzilla
Status: NEW → ASSIGNED
(Assignee)

Comment 23

9 years ago
Created attachment 360102 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

That one is better.
Attachment #360101 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Attachment #360102 - Flags: review?(neil)
(Assignee)

Comment 24

9 years ago
Comment on attachment 360102 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

Ignore the var url; in the patch, I forgot to remove it before uploading.

Comment 25

9 years ago
Comment on attachment 360102 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

>+        var found = false;
Not sure we need to use found either.
>
>+        urlParam = resolveURIInternal(cmdLine, urlParam);
>+        if (this._handledURI.spec == urlParam.spec) {
>+          this._handledURI = {};
>+          found = true;
>           cmdLine.preventDefault = true;
Drop the above two lines
>+        }
>+        if (!found) {
Change to else
>+          if (cmdLine.handleFlag("requestpending", false) &&
>+              cmdLine.state == nsICommandLine.STATE_INITIAL_LAUNCH) {
>+            // A DDE request with the URL will follow and the DDE handling code
>+            // will send it to the commandline handler via
>+            // "mozilla -url http://www.foo.com". Store the URL so we can
>+            // ignore this request later
>+            this._handledURI = urlParam;
>+          }          
>+
>+          handURIToExistingBrowser(urlParam,
>+                                   nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW,
>+                                   features);
>+          cmdLine.preventDefault = true;
Remove the above line.
>         }
Add "cmdLine.preventDefault = true;" here.
>       }
>     } catch (e) {
(Assignee)

Comment 26

9 years ago
Created attachment 360112 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

Even better patch :)
Attachment #360102 - Attachment is obsolete: true
Attachment #360112 - Flags: review?(neil)
Attachment #360102 - Flags: review?(neil)
Comment on attachment 360112 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

>+  _handledURI: {},
I think we can store a string (or null) here, rather than an object.

>+        urlParam = resolveURIInternal(cmdLine, urlParam);
>+        if (this._handledURI.spec == urlParam.spec) {
Is it worth comparing the saved param before resolving it? It would avoid resolving it twice when we've already seen the param.
(Assignee)

Comment 28

9 years ago
Created attachment 360380 [details] [diff] [review]
Patch (fixes opening internet shortcuts)
Attachment #360112 - Attachment is obsolete: true
Attachment #360380 - Flags: review?(neil)
Attachment #360112 - Flags: review?(neil)
Comment on attachment 360380 [details] [diff] [review]
Patch (fixes opening internet shortcuts)

>+        if (this._handledURI == urlParam) {
>+          this._handledURI = "";
>+        }
>+        else {
null, perhaps? Also, either use } else { or drop the {}s on the if block.
(Assignee)

Comment 30

9 years ago
Created attachment 360610 [details] [diff] [review]
Patch
Attachment #360380 - Attachment is obsolete: true
Attachment #360610 - Flags: review?(neil)
Attachment #360380 - Flags: review?(neil)

Updated

9 years ago
Attachment #360610 - Flags: review?(neil) → review+
(Assignee)

Comment 31

9 years ago
Comment on attachment 360610 [details] [diff] [review]
Patch

Pushed to c-c, changeset 5a6f689dc786.
(Assignee)

Updated

9 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
I couldn't reproduce problem with following build. When Seamonkey was newly started from internet short-cut, only single SM window was opened, even with multiple profiles if "Don't ask at startup" was checked. 
Note: Bug 476988 still occurs, if "Don't ask at startup" is not checked.

> Build identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.9.1b3pre) Gecko/20090208 SeaMonkey/2.0a3pre
> about:buildconfig
> Source
> Built from http://hg.mozilla.org/releases/mozilla-1.9.1/rev/c8099a4c91c3
> Build platform
> target
> i686-pc-mingw32
You need to log in before you can comment on or make changes to this bug.