Closed Bug 1778597 Opened 2 years ago Closed 2 years ago

Save Page As suggests erroneous file extension if page title ends with a TLD

Categories

(Firefox :: File Handling, defect, P2)

Firefox 102
Desktop
All
defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 107+ verified
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- wontfix
firefox105 --- wontfix
firefox106 --- wontfix
firefox107 + verified
firefox108 + verified

People

(Reporter: jscher2000, Assigned: enndeakin)

References

(Blocks 1 open bug, Regression, )

Details

(Keywords: regression, Whiteboard: [fidefe-quality-foundation])

Attachments

(2 files)

Starting in Firefox 102, if a page title end with the site's domain name, Firefox uses the TLD as the file extension rather than .htm.

Reported on SUMO at https://support.mozilla.org/questions/1382070 -- unfortunately continues in Firefox 102.0.1 after shortcut fix (might be a related issue).

[Tracking Requested - why for this release]: Broken file extension when save page as.

I can reproduce this in Nightly104.0a11 103.0b5, 102.0.1 and 102.0esr Windows10 and Xubuntu22.04.

OS: Unspecified → All
Hardware: Unspecified → Desktop

:enndeakin, since you are the author of the regressor, bug 1770683, could you take a look?
For more information, please visit auto_nag documentation.

Flags: needinfo?(enndeakin)

This happens because we don't append anymore if we can't force an extension. https://hg.mozilla.org/mozilla-central/rev/7ddfc8dd77aa#l1.77

Flags: needinfo?(enndeakin)
Blocks: 1778322

Too late for 102 non-esr at this point.

Is this better after bug 1773907 or no?

(In reply to :Gijs (he/him) from comment #5)

Is this better after bug 1773907 or no?

I checked on Version 103.0b8, Build ID 20220712185923, and the Save Page As issue (.htm not being added) does not seem to be fixed.

I can still reproduce, we end with a .com file and the folder with media contents. We're still not appending the htm extension.

Severity: -- → S3
Priority: -- → P2

Set release status flags based on info from the regressing bug 1770683

Gijs, should we try to get an owner to this bug and get it uplifted to an ESR minor release?

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Neil Deakin from comment #10)

Perhaps we should just add text/html to the special-case list at https://searchfox.org/mozilla-central/rev/560b7b1b174ed36912b969eee0c1920f3c59bc56/uriloader/exthandler/nsExternalHelperAppService.cpp#3696

I'm confused why this would help; the list there was originally at least about whether we end up with foo.txt.png vs foo.png, whereas this bug is about .html being lost completely. Can you elaborate?

(In reply to Pascal Chevrel:pascalc from comment #9)

Gijs, should we try to get an owner to this bug and get it uplifted to an ESR minor release?

I can add it to the quality foundation tracker but I can't promise anything right now in terms of how quickly we'll find an assignee.

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(enndeakin)
Whiteboard: [fidefe-quality-foundation]

I meant so that html is special cased as images are in nsExternalHelperAppService::ShouldModifyExtension so that html files with filenames that have an invalid extension will instead have the proper extension .html either replaced or appended.

Flags: needinfo?(enndeakin)

(In reply to Neil Deakin from comment #12)

I meant so that html is special cased as images are in nsExternalHelperAppService::ShouldModifyExtension so that html files with filenames that have an invalid extension will instead have the proper extension .html either replaced or appended.

This seems reasonable to me. However, we will need to do the same for saving these files as plain text (another option when saving webpages), and forcing all text/plain things that people download to have .txt extensions will probably annoy lots of people (because .log and various programming source code files tend to get served with that mimetype, but want to keep their file extensions). So I think we might need/want to instead/additionally have/use a flag that forces extension correction, and pass it from the "save as" consumer. Or correct the filename after it's returned from the 'save as' dialog, or something. Does that make sense?

Flags: needinfo?(enndeakin)
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Flags: needinfo?(enndeakin)
Pushed by neil@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b3b857348f60 append valid extensions only when saving a page, r=Gijs,necko-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch

Since nightly and release are affected, beta will likely be affected too.
For more information, please visit auto_nag documentation.

The patch landed in nightly and beta is affected.
:enndeakin, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox107 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(enndeakin)

Reproduced issue on 107.0b8 Firefox.
Issue is verified-fixed in 108.0a1 Nightly build: 2022-11-01-21-36-59-mozilla-central.

Comment on attachment 9298795 [details]
Bug 1778597, append valid extensions only when saving a page, r=gijs

Beta/Release Uplift Approval Request

  • User impact if declined: Some web pages with certain titles are not saved with the html extension making them not directly openable afterwards.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Should only affect when manually saving a file.
  • String changes made/needed: none
  • Is Android affected?: No
Flags: needinfo?(enndeakin)
Attachment #9298795 - Flags: approval-mozilla-beta?

Comment on attachment 9298795 [details]
Bug 1778597, append valid extensions only when saving a page, r=gijs

Approved for 107.0b9

Attachment #9298795 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Depends on: 1777207

Verified fixed in Firefox 107.0b9.

Status: RESOLVED → VERIFIED

Verified fixed also in 102.5.0esr on Windows 10, Mac 12 ARM and Ubuntu 20.

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

Attachment

General

Creator:
Created:
Updated:
Size: