Closed Bug 1320377 Opened 3 years ago Closed 3 years ago

Using MacBook Pro OS X 10.9.5 and FF50, I can no longer save a webpage in text format; default file saved is ".html"

Categories

(Core :: Widget: Cocoa, defect)

50 Branch
Unspecified
macOS
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla53
Tracking Status
firefox50 --- wontfix
firefox51 + verified
firefox52 + verified
firefox53 + verified

People

(Reporter: asn55, Assigned: stefanh)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161104212021

Steps to reproduce:

First, tried to insert ".txt" at the end of the file name before saving. See the message below when I tried to do that maneuver: 

You cannot save this document with extension “.txt” at the end of the name. The required extension is “.html”.
You can choose to use both, so that the file name ends in ".txt.html".

Whereas before FF50 ".html" shown in the "save as" file window, which I could erase and then save as a text file, there is no extension visible. The default extension seems now to be "html".

Second, tried restarting in safe mode with add-ons disabled. However, I get the same result: the default file saved is ".html".

Third, double-clicked the browser.tabs.remote.autostart.2 preference to switch the value from true to false. 

Unfortunately I get the same result after restarting FF: ".html" is the default file saved.




Actual results:

After all three solutions, proposed by jscher2000, the end result is that the default file setting is ".html".


Expected results:

Had hoped to be able to save webpages in text format, not html.
Did you test with a fresh profile?
https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles

Same issue?
Component: Untriaged → File Handling
Flags: needinfo?(asn55)
OS: Unspecified → Mac OS X
Duplicate of this bug: 1320606
Bogdan, we have 2 reports of the same issue. Could you find someone from QA to test and find a possible regression on MacOSX 10.9.
Flags: needinfo?(bogdan.maris)
(In reply to Loic from comment #3)
> Bogdan, we have 2 reports of the same issue. Could you find someone from QA
> to test and find a possible regression on MacOSX 10.9.

Alex is gonna take a look at this and followup afterwards. Thanks Loic.
Flags: needinfo?(bogdan.maris)
I also reported this on Mozilla Support. 
Reverting back to 49.0.2 solved the problem.
This behavior was introduced in bug 426680. The question is if it's wrong since I think it matches Safari behavior.
Blocks: 426680
Component: File Handling → Widget: Cocoa
Product: Firefox → Core
Safari, Chrome and Opera don't have the "Text Files" option as they are not developer oriented browsers.

The text is filtered (mockup removed) from the rendered HTML when this option is used in Mozilla, and it is saved to the file even when a ".txt.html" extension on the filename. 
The only problem is not being able to save the file with a non ".html" extension from the dialog.

The save as "Text Files" has been a very useful feature in Mozilla for decades, and it would be a shame if it where removed only to work like all those other browsers.

It should be available as an option, or at the very least, it should be left available in the developer edition.
Yeah, it seems reasonable to allow users to change the file extension.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(asn55)
Keywords: qawanted
Assignee: nobody → stefanh
So this will make it possible to change the file extension while keeping the desired behavior from the patch in bug 426680 (not selecting the extension - the problem reported here was actually mentioned in bug 426680, comment #18). You won't be able to change to any extension, though.

If you change the file extension Apple will ask you to confirm the change. This only happen if the extension you choose is, for example '.txt' or '.cpp'(that's what I tested with - I haven't investigated what makes an extension valid).

For example: If you change the extension from '.xhtml' to '.txt' you'll get the dialog and, if you confirm, the file will be saved with the '.txt' extension. But if you change it from '.xhtml' to '.zzzz' the file will be saved with the extension '.zzzz.xhtml' without any confirmation.
Attachment #8814985 - Flags: review?(mstange)
Comment on attachment 8814985 [details] [diff] [review]
Allow users to change file extension

Review of attachment 8814985 [details] [diff] [review]:
-----------------------------------------------------------------

Does this match what other browsers do?
Version 49.0.2 does NOT bring up the verification dialog if a new file extension is selected.

It seems to me that a file being saved as text should be allowed to have any extension as long as the user indicates that is what they want.

Changing file extensions in Finder will have a confirmation dialog to verify that the user really wants to do that.
(In reply to Markus Stange [:mstange] from comment #10)
> Does this match what other browsers do?

When it comes to changing file extension: Safari and Chrome doesn't allow you to change the extension. But they only have 2 options in the "Format" dropdown while we have 2 additional choices: "Text Files" and "All files". So one could argue that since we give users an option to save files in a different format than the default (saving a file in the "Text Files" format also changes the file format) we should allow users to manually change the file extension :-)
Comment on attachment 8814985 [details] [diff] [review]
Allow users to change file extension

Review of attachment 8814985 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8814985 - Flags: review?(mstange) → review+
Pushed by stefanh@inbox.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d5ffc2a28d39
Allow users to change file extension in the Save dialog. r=mstange.
https://hg.mozilla.org/mozilla-central/rev/d5ffc2a28d39
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
This is VERIFIED FIXED in Firefox Nightly 53.0a1 (id: 20161129030222) on Mac OS X 10.11.5 and Mac OS 10.12.1.
Status: RESOLVED → VERIFIED
Tested. Nice. Thanks all...
The fix looks quite simple, so is it a good candidate for uplift to beta and aurora?
Duplicate of this bug: 1321321
I reported a bug earlier (https://bugzilla.mozilla.org/show_bug.cgi?id=1321321) that was marked as duplicate. I see that there is a solution in this bug to try the nightly build of 53. I have just installed the most recent nightly and I am still seeing a portion of the behavior I described in my bug. 

While I can now change the file extension by entering something explicitly, the save dialog box does not show the default extension still. Additionally, if I choose to save without entering my own file extension, firefox is still choosing the wrong extension. For example, all .jpg files are saved as .jpeg. All .img files are being saved as .ndif. All .sql files are being saved as .mssql. Where is firefox getting these file extensions from and why is it choosing them over the file extension that is initially shown in the save dialog box before I am asked to choose a location? (I have my preferences set so that I choose the location of each file save instead of allowing it to all dump into the default directory)
John, you should re-open bug 1321321 for the issues you describe since they're not related to the patch here (the patch only made it possible to manually change the default file extension).

For the record, I can't reproduce the problem with the missing file extension with a nightly build. Or is the file extension missing? You do say that the "default file extension" is missing, but you also say "why is it choosing them over the file extension that is initially shown in the save dialog".

Also, please (in bug 1321321) give some real-world examples (like links) so the issues you describe can be reproduced.

Regarding where those extensions come from: it's a bit complicated, but from the patch in bug 426680, it looks like we're determine what extension the file should be saved with from the UTI for the file type (that's probably why .jpg becomes .jpeg).
I now see from your screenshot in bug 1321321 that your example files comes from https://download.cyanogenmod.org/, so I went there and tried it myself with a nightly build. For me, I see the extension and the file was saved with the extension .img. I also see from your screenshot that you're using the downthemall extension - please have a try with that extension disabled (downthemall has a "Renaming mask" feature).
Stefan, thanks. I'll reopen the other bug and leave replies to your comments there so as to not confuse this bug discussion any further.
Duplicate of this bug: 1322160
Comment on attachment 8814985 [details] [diff] [review]
Allow users to change file extension

Approval Request Comment
[Feature/Bug causing the regression]: Bug 426680
[User impact if declined]: Users unable to change file extensions in Save file dialog
[Is this code covered by automated tests?]: No
[Has the fix been verified in Nightly?]: Yes
[Needs manual test from QE? If yes, steps to reproduce]: 
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: No
[Why is the change risky/not risky?]: Simple fix (one-liner), baked on m-c for 2 weeks.
[String changes made/needed]:
Attachment #8814985 - Flags: approval-mozilla-beta?
Attachment #8814985 - Flags: approval-mozilla-aurora?
Track 51+/52+ as regression.

Hi Florin,
Can you help find someone to verify if this was fixed in latest nightly? Thanks.
Flags: needinfo?(florin.mezei)
Clear ni per comment #16.
Flags: needinfo?(florin.mezei)
Comment on attachment 8814985 [details] [diff] [review]
Allow users to change file extension

Fix a regression issue so that user can change file extensions in dialog. Beta51+ and Aurora52+. Should be in 51 beta 8.
Attachment #8814985 - Flags: approval-mozilla-beta?
Attachment #8814985 - Flags: approval-mozilla-beta+
Attachment #8814985 - Flags: approval-mozilla-aurora?
Attachment #8814985 - Flags: approval-mozilla-aurora+
Alex, let's check this on 52.0a2 and 51.0b8 as well, when available.
Flags: qe-verify+
Flags: needinfo?(alexandru.simonca)
This issue is Verified Fixed in Firefox 52.0a2 (id: 20161215004017) and Firefox 51.0b8 (id: 20161215085501) on MacOs 10.12 Sierra.
Flags: needinfo?(alexandru.simonca)
You need to log in before you can comment on or make changes to this bug.