Closed Bug 118621 Opened 24 years ago Closed 22 years ago

http://foo/bar/ default save name should be bar.html

Categories

(Core Graveyard :: File Handling, defect, P2)

x86
All
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.5beta

People

(Reporter: jmd, Assigned: Biesinger)

References

Details

Attachments

(1 file, 2 obsolete files)

When saving a page, frame, link, etc, where there is no file name, but a directory name, as in http://foo/bar/, the default file name for save should be bar.html. We already do this for locations of the form http://foo/... saving to foo.html. This is split off from bug 115176.
*** Bug 120321 has been marked as a duplicate of this bug. ***
Target Milestone: --- → Future
*** Bug 131412 has been marked as a duplicate of this bug. ***
QA Contact: sairuh → petersen
So, it looks like we currently use the title of the page (I tested File|Save page as). Is this bug for making it use the directoryname + .html in all cases? Or only if there is no <title> (no idea what we do in this case)? Or is this not about File|Save page as, but shift+link click, or another save feature?
Yeah, this is for the case when there is no <title> (which is also the "shift-click" case, so life is easy ;) ). What we do right now is http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/xpfe/communicator/resources/content/contentAreaUtils.js&rev=1.74&mark=737,743,770,776,%20781,787,792#734
What about http://foo/bar/blah/ Should blah.html be used, or bar_blah.html? (the second one is easier to implement, and I have a patch for that actually)
I think the proposal was that that would become blah.html
-> me
Assignee: law → cbiesinger
Priority: -- → P2
Target Milestone: Future → mozilla1.5alpha
Attached patch patch (obsolete) — Splinter Review
Attachment #126721 - Flags: review?(jaggernaut)
Status: NEW → ASSIGNED
Comment on attachment 126721 [details] [diff] [review] patch actually this is not ideal, I have a slightly better patch (use .path instead of .spec)
Attachment #126721 - Attachment is obsolete: true
Attachment #126721 - Flags: review?(jaggernaut)
Attached patch patch v2 (obsolete) — Splinter Review
Attachment #126722 - Flags: review?(jaggernaut)
Comment on attachment 126722 [details] [diff] [review] patch v2 You can get the result of |re.test(aDocumentURI.path)| by testing |aDocumentURI.path.match(re)| against null, if you must.
Target Milestone: mozilla1.5alpha → mozilla1.5beta
Comment on attachment 126722 [details] [diff] [review] patch v2 ok, I'll attach a new patch that nulltests .match
Attachment #126722 - Attachment is obsolete: true
Attachment #126722 - Flags: review?(jaggernaut)
Attachment #127264 - Flags: review?(jaggernaut)
Comment on attachment 127264 [details] [diff] [review] patch v2 r=jag if you inline the |re|.
Attachment #127264 - Flags: review?(jaggernaut) → review+
Attachment #127264 - Flags: superreview?(bzbarsky)
Attachment #127264 - Flags: superreview?(bzbarsky) → superreview+
Checking in resources/content/contentAreaUtils.js; /cvsroot/mozilla/xpfe/communicator/resources/content/contentAreaUtils.js,v <-- contentAreaUtils.js new revision: 1.83; previous revision: 1.82 done
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
This does not seem to be functioning properly. For URLs that end in "/directory/", Firebird is using the <title> as the default name. This is highly undesirable to me. Tested at: http://www.google.com/options/ Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030715 Mozilla Firebird/0.6
this has always been a mozilla bug, so please test in mozilla. testing this in firebird is worthless as I'm quite sure they forked this file. thanks.
Filed Bug 212904 for firebird as advised by #firebird. Thanks for finally doing 99% of the work here, Christian. It was a pet peeve.
Comment on attachment 126722 [details] [diff] [review] patch v2 >+ var re = /\/([^\/]+)\/$/; >+ if (re.test(aDocumentURI.path)) { >+ var path = aDocumentURI.path.match(re); >+ if (path.length > 1) >+ return validateFileName(path[1]); >+ } Actually the way to go here is if (/\/([^\/]+)\/$/.test(aDocumentURI.path)) return validateFileName(Regexp.$1);
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: