Last Comment Bug 521699 - When SM is running, double clicking on saved web page opens home page
: When SM is running, double clicking on saved web page opens home page
Status: RESOLVED FIXED
: fixed-seamonkey2.0.3
Product: SeaMonkey
Classification: Client Software
Component: Startup & Profiles (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal with 2 votes (vote)
: seamonkey2.1a1
Assigned To: Stefan [:stefanh]
:
Mentors:
http://www.google.com
: 523721 531539 531562 532938 539172 (view as bug list)
Depends on:
Blocks: 520610
  Show dependency treegraph
 
Reported: 2009-10-11 19:52 PDT by Rich Gray (:rbgray)
Modified: 2011-02-24 03:44 PST (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Look for "file" args (1.03 KB, patch)
2009-12-13 13:59 PST, Stefan [:stefanh]
mnyromyr: review+
neil: superreview+
mnyromyr: approval‑seamonkey2.0.3+
Details | Diff | Splinter Review

Description Rich Gray (:rbgray) 2009-10-11 19:52:24 PDT
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.4) Gecko/20091007 SeaMonkey/2.0

Running the standard Litmus Save As test is producing strange results.

Steps to reproduce (https://litmus.mozilla.org/run_tests.cgi?test_run_id=7 Functionality Step 8):

1. Open http://www.google.com in a new window.

2. File > Save Page As  Google.html to the Desktop, Web Page, complete

3. Close the Google window and minimize the rest of SeaMonkey (cmd-h)

4. double click on the saved Google.html file

Expected results:

1. The first time I access the file, I get the Mac OS X quarantine warning:  "Google.html" is a web application downloaded from the Internet.  Are you sure you want to open it?  I click (Open)
2. Get the saved Google page

Actual results:

In my working profile, "default", the Litmus and this bugzilla windows re-display, with the quarantine dialogue on top.  When I answer Open, a blank window appears under the litmus & bugzilla windows.  Its source is just "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title></title></head><body></body></html>".  This despite the fact that the disk file and images folder appear to have been written correctly and all saves do open correctly in Safari.  SeaMonkey Open File seems to work correctly.

In the clean profile I was using for the smoketest, I was getting the saved google page, then my designated home page opening over it in a new window. When I repeated the test with www.bing.com, all I got was my homepage.
Comment 1 Rich Gray (:rbgray) 2009-10-12 18:10:37 PDT
It looks as if there is no problem with the saved page, it opens fine in Safari and SM 1.1.18.  Google.com Save As'ed in 1.1.18 opens fine in that version, but also opens the homepage in 2.0rc1.  So this is really some sort of opening by double-click bug.  

Interestingly, when I switch from the clean profile I'm using to test this bug back to my working profile, the homepage comes up blank.  When I double click on a saved page, I get blank instead of my homepage or even the saved page.

Also, I no longer the the saved page opening with the home page, just the home page.

Renaming the bug from "File > Save Page As producing unpredictable results" to "Double clicking on saved web page opens home page".  Withdrawing blocking 2.0 request and taking importance to "normal" since there is a work-around of File > Open File (which works correctly.)
Comment 2 Robert Kaiser 2009-10-13 05:35:48 PDT
Assuming that "double-clicking" means "opening from an external program" (e.g. Finder or the desktop), I assume that startup URL handlers have something to do with this and moving it to the startup component.

As this is mac, I wonder if Mark or Karsten know anything about this.
Comment 3 Mark Banner (:standard8) 2009-10-13 05:39:45 PDT
iirc Firefox 3.5 also has this problem on Mac.
Comment 4 Rich Gray (:rbgray) 2009-10-13 09:27:07 PDT
Actually, I don't think it is a startup problem per se, because I was doing this with a Litmus window open.   It seems more a new window thing.  In fact, I just Quit SM and started it by clicking on a helloworld.html file made with composer and the hello world page came up.  I then closed that window (SM still running, now with no windows) and clicked the helloworld.html file again.  This time I got my homepage.

What I meant to say in #1 was I no longer see the saved page opening with the home page, just the home page opens.

I wonder if Stefan knows of this...
Comment 5 Robert Kaiser 2009-10-13 09:44:31 PDT
Everything calling us from an external source basically goes through the startup code in some way (URL handlers or whatever).
Comment 6 Robert Kaiser 2009-10-21 18:38:56 PDT
*** Bug 523721 has been marked as a duplicate of this bug. ***
Comment 7 Robert Kaiser 2009-10-21 18:46:48 PDT
bug 505298, bug 501115, bug 457572, bug 420334, bug 423254 seems instances of this on Firefox, all have been reported on Mac, so this might be a Mac-specific issue.
Comment 8 Michael Graubart 2009-10-24 11:13:11 PDT
Two comments: 1. The same seems to happen with a saved e-mail. 2. If SeaMonkey is running and (instead of double-clicking on the saved file) one opens it via File menu > Open File, the file opens properly (not the home page).
Comment 9 skuhn 2009-12-01 13:36:53 PST
The same problem occurs not only when double-clicking an html file on the Mac, but also when dragging and dropping it onto the SeaMonkey icon (either directly or on the dock) [see Bug 531562]. Indeed it looks like a Mac problem, but one that didn't exist in any previous 1.x version of SeaMonkey.
Comment 10 Stefan [:stefanh] 2009-12-13 13:41:54 PST
*** Bug 532938 has been marked as a duplicate of this bug. ***
Comment 11 Stefan [:stefanh] 2009-12-13 13:43:59 PST
*** Bug 531539 has been marked as a duplicate of this bug. ***
Comment 12 Stefan [:stefanh] 2009-12-13 13:59:57 PST
Created attachment 417386 [details] [diff] [review]
Look for "file" args 

mcsmurf and I have discussed this a bit. I first noted that Firefox handles local files differently, then mcsmurf pointed out that https://bugzilla.mozilla.org/attachment.cgi?id=358454 in bug 290057 added a -file arg handling which we seem to depend on. I need to test this a bit further, but it looks like it fixes this bug and all the dupes.
Comment 13 Stefan [:stefanh] 2009-12-13 14:21:38 PST
Interestingly, on trunk opening a local file when SeaMonkey is *not* running seems broken (the patch fixes the case when SeaMonkey already is running, though)
Comment 14 Stefan [:stefanh] 2009-12-19 05:13:03 PST
Comment on attachment 417386 [details] [diff] [review]
Look for "file" args 

See https://bug290057.bugzilla.mozilla.org/attachment.cgi?id=358454 in bug 290057 for why we need this.
Comment 15 neil@parkwaycc.co.uk 2009-12-19 05:21:41 PST
Comment on attachment 417386 [details] [diff] [review]
Look for "file" args 

Nit: please use the style of the existing -url flag (but without the _handledURI stuff of course).
Comment 16 Karsten Düsterloh 2009-12-25 14:19:41 PST
This doesn't work for me at all, using a SeaMonkey trunk debug build under 10.5. Regardless of whether SM is already running or not, all I get when trying to open/open with/doubleclick the html file in the Finder is this assertion:

WARNING: NS_ENSURE_TRUE(aCFURL) failed: file /Users/karsten/moz/src/trunk/mozilla/xpcom/io/nsLocalFileOSX.mm, line 1555
Comment 17 Stefan [:stefanh] 2009-12-25 16:12:46 PST
(In reply to comment #16)
> This doesn't work for me at all, using a SeaMonkey trunk debug build under
> 10.5. Regardless of whether SM is already running or not, all I get when trying
> to open/open with/doubleclick the html file in the Finder is this assertion:

Have you set SeaMonkeyDebug to the app to open the file?
Comment 18 Stefan [:stefanh] 2009-12-25 16:15:54 PST
Oh, wait - that shouldn't matter for 'open with'. Odd, the patch works flawless for me on trunk (10.5.8) when seamonkey is already running.
Comment 19 Karsten Düsterloh 2009-12-26 17:05:47 PST
Comment on attachment 417386 [details] [diff] [review]
Look for "file" args 

This does only(!) work for me on SeaMonkey 1.9.1 branch, but there it does work for both the "SM running" and the "SM not running" case. Thus this r+ is only valid for SM 2.0.x!
The trunk behaviour is broken for me even in Minefield, so this may be a PPC (me) vs. Intel (Stefan) issue.
Comment 20 Stefan [:stefanh] 2009-12-27 05:17:37 PST
Karsten, I don't see any reason for not taking the patch on trunk. The only thing it does is that it looks for the -file arg and If nsBrowserContentHandler.js can't find any flags/paths for ppc builds, I would say that the issue is to be found in toolkit/xre.
Comment 21 Stefan [:stefanh] 2009-12-27 05:37:08 PST
Comment on attachment 417386 [details] [diff] [review]
Look for "file" args 

I think we need this for 2.0.2. It's safe and it fixes a really annoying problem on mac.
Comment 22 Stefan [:stefanh] 2009-12-27 05:41:17 PST
Adjusting summary a bit - this only covers the "running" case.
Comment 23 Karsten Düsterloh 2009-12-27 06:06:13 PST
(In reply to comment #20)
> Karsten, I don't see any reason for not taking the patch on trunk. The only
> thing it does is that it looks for the -file arg and If
> nsBrowserContentHandler.js can't find any flags/paths for ppc builds, I would
> say that the issue is to be found in toolkit/xre.

Okay, fine by me.
Comment 25 Stefan [:stefanh] 2009-12-27 11:31:41 PST
*** Bug 531562 has been marked as a duplicate of this bug. ***
Comment 26 Robert Kaiser 2010-01-12 08:22:16 PST
*** Bug 539172 has been marked as a duplicate of this bug. ***
Comment 27 Stefan [:stefanh] 2010-01-13 05:00:12 PST
Note: Even though comment #21 indicates that this is fixed in 2.0.2, this is not the case - it will instead be fixed in 2.0.3.
Comment 28 Vito Tuxedo 2010-02-07 13:37:16 PST
It's definitely not fixed in 2.0.2. And it's not confined to PPC. I have the same problem running 2.0.2 in OS X v10.4.11 on a MacBook Pro (Intel) and on a G5 DP 2.5 (PPC) .

There are other manifestations of this double-click-to-open problem in SeaMonkey 2.0.x. If the Appearance preferences are set to "When SeaMonkey starts up, open Mail & Newsgroups", double-clicking on an HTML file causes an already-launched SeaMonkey to open the main Mail & Newsgroups window. After changing the Appearance preference to "When SeaMonkey starts up, open Browser", double-clicking on an HTML file causes SeaMonkey to open a blank browser window, but it does not load the HTML file in question.

It's good to know this will be fixed in 2.0.3.

Note You need to log in before you can comment on or make changes to this bug.