Closed Bug 127912 Opened 23 years ago Closed 23 years ago

[FIX]saving as text via Save Link As [context menu] still saves as html

Categories

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

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0

People

(Reporter: bugzilla, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file)

found while retesting bug 115207 comment 7 with 2002.02.25 comm bits. saving a page as text via Save Page As works [toplevel File menu item, accel+S, or the context menu item]. however, trying to save a web page as text via "Save Link As" [from the context menu] does not work --the resulting file is still html source. recipe: 1. go to http://mozilla.org/ 2. for any link, bring up the context menu --eg, the "Testing" link on the left side. 3. select "Save Link As..." from the context menu. 4. in the resulting file picker, choose "Text file" from the "files of type" menulist. 5. [optional, since it doesn't seem to affect the outcome] change the extension from .html to .txt [this should've been done automatically but isn't due to bug 115207]. 6. click the Save button. 7. open the file in the browser, or simply view it in any text reader. expected: the file should be text *without* the html markup. actual results: the file is still in html.
Keywords: nsbeta1
Adam, does nsWebBrowserPersist even support doing SaveURI with conversion to plaintext?
One of the args on nsIWebBrowserPersist::SaveDocument is the output mime type. Pass text/plain here and the persist object should save in that format. Interally all it does is pass the content type through to the encoder which creates the appropriate serializer to feed the DOM into. If you pass in nsnull for the content type, the persist object uses the content type specified by the DOM document.
right. but we're doing SaveURI, not SaveDocument.... It sounds like we should just not have the text/plain option in the filepicker, since the back end can't do it.
Attached patch Proposed patch (deleted) — Splinter Review
We should only be offering text mode for HTML files in cases when we are going to do SaveDocument()
Comment on attachment 71591 [details] [diff] [review] Proposed patch r=law
Attachment #71591 - Flags: review+
taking bug
Assignee: law → bzbarsky
Priority: -- → P2
Summary: saving as text via Save Link As [context menu] still saves as html → [FIX]saving as text via Save Link As [context menu] still saves as html
Target Milestone: --- → mozilla1.0
Comment on attachment 71591 [details] [diff] [review] Proposed patch sr=blake
Attachment #71591 - Flags: superreview+
Comment on attachment 71591 [details] [diff] [review] Proposed patch a=asa (on behalf of drivers) for checkin to the 0.9.9 branch and the 1.0 trunk
Attachment #71591 - Flags: approval+
checked in trunk and branch.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
vrfy'd fixed using 2002.03.13 comm bits on linux rh7.2, win2k and mac 10.1.3. the resulting file picker from "save link as" now has only "web page, html only" --the text option has been removed.
Status: RESOLVED → VERIFIED
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: