Closed Bug 221899 Opened 21 years ago Closed 21 years ago

when saving web page, not defaulting with any file extension

Categories

(Firefox :: General, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: 2esses, Assigned: me)

References

Details

(Keywords: regression)

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6a) Gecko/20031002 Firebird/0.7+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6a) Gecko/20031002 Firebird/0.7+

"Save page As | Web Page or Web Page Complete" should append the file extension
.htm or .html to the saved file (unless there is already a "." in the character
string -- but it never does!  It never appends any extension.

Reproducible: Always

Steps to Reproduce:
1. Menu: "File | Save page As | Web Page [Complete]"
2. type any file name string without an extension
3. press enter

Actual Results:  
A file, without extension, is saved, and (usually) a referenced folder labeled
"_files" is saved.

Expected Results:  
A "file name.htm[l]" should be created and and (usually)a folder "name_files"
should have been created.  See attached screen prints
Attached image screen-print : results
Saving http://www.squarefree.com/ using "HTML only" option:
Firebird 07/02: saves as Jesse Ruderman.html
Firebird 07/23: saves as Jesse Ruderman.htm
Firebird 08/11: saves as Jesse Ruderman
Firebird 11/04: saves as Jesse Ruderman
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
The change from .html to .htm was probably caused by bug 147679 and doesn't
bother me too much.
I downloaded some more old builds (aebrahim and official) to get:

Firebird 07/23: saves as Jesse Ruderman.htm
Firebird 07/26: saves as Jesse Ruderman
It looks like contentAreaUtils.js needs to be updated to the latest version of:
http://lxr.mozilla.org/mozilla/source/netwerk/mime/public/nsIMIMEService.idl

Making the following changes seems to fix the problem.

Change line 686 to:
return getMIMEService().getFromTypeAndExtension("", aExtension);

and line 696 to:
return getMIMEService().getFromTypeAndExtension(aMIMEType, "");

I also searched the rest of the chrome files and it looks like plugins.js line
169 needs to be changed as well (note the lowercase g in getFromTypeAndExtension):

return mimeSvc.getFromTypeAndExtension(aType, "");
Here's a patch to fix this.

p.s. I was accidently working off of an old version of the code in comment #7
so a) the line numbers were wrong (they should have been 711 and 721
respectively) and b) plugins.js was fixed a few days ago in Bug 225958, sorry
for the confusion.
Attachment #136805 - Flags: review?(p_ch)
*** Bug 220680 has been marked as a duplicate of this bug. ***
*** Bug 222882 has been marked as a duplicate of this bug. ***
pike: The xpfe part of the checkin I linked to in comment 6 uses null, not "". 
And the current code at
http://lxr.mozilla.org/mozilla/source/xpfe/communicator/resources/content/contentAreaUtils.js#749
doesn't pass "" or null.
Jesse: There used to be two function that took a single argument but now those
two are combined into one function that can have either two arguments or one
argument and a null, see here:

http://lxr.mozilla.org/mozilla/source/netwerk/mime/public/nsIMIMEService.idl#66

Since it takes a string you could use either a null or an empty string (I think)
but for consistancy  I decided to do it the same way it was done for plugins.js
by using an empty string, see here:

http://lxr.mozilla.org/mozilla/source/browser/components/prefwindow/content/plugins.js#245

Though I'll change it if you want?
Here's another patch, the first was a get it working type, this one tries to
port the MIME related changes that are in the xpfe version
Attachment #136805 - Flags: review?(p_ch)
Attachment #136975 - Flags: review?(p_ch)
*** Bug 230402 has been marked as a duplicate of this bug. ***
Nominating for 0.8 blocker. Very annoying when saving pages, and there's a patch
awaiting review.
Flags: blocking0.8?
*** Bug 228503 has been marked as a duplicate of this bug. ***
Attachment #136975 - Flags: review?(p_ch) → review+
checked in on branch and trunk.
I was looking to report the same bug on 

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 Firebird/0.7

Could somebody allowed change the OS from windows 2000 to all
URL: n/a
OS: Windows 2000 → All
Since the patch was checked in last week shouldn't this bug be marked Fixed or
does their need to be some sort of confirmation first?
(In reply to comment #19)
> Since the patch was checked in last week shouldn't this bug be marked Fixed or
> does their need to be some sort of confirmation first?

I am not sure if that's absolutly required, but downloading the lastest nigthly
and confirming that the patch work never hurt.  I guest we should use the one at 

http://ftp.mozilla.org/pub/mozilla.org/firebird/nightly/latest-trunk/

I tested with 

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7a) Gecko/20040127 Firebird/0.8.0+

and the file name is generate with a .htm extension and the directory has the
proper name before the _files.  Could anybody also test on the win32 platform?
There aren't any Win32 builds at the moment (latest one is before this was
checked in). If someone makes their own Win32 build (or grabs an "unofficial"
build from someone who does).  However, it's usual to marked bugs fixed when the
fix is checked in, and then mark them verified when they've been verified.

I'll reassign this to the patch author...
Assignee: blake → pike
Blocks: 232415
and mark it fixed.

When someone can verify that it works on Windows, they can mark it verified.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
No longer blocks: 232415
WFM

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040128
Firebird/0.8.0+
verified fixed 2004-01-31 trunk build on W2K
Status: RESOLVED → VERIFIED
Flags: blocking0.8?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: