From cf9be47589408fd125585a229e5cf31393e952ea Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 1 Feb 2011 19:06:32 -0500 Subject: [PATCH] Use a sensible extension for :saving text/plain documents. --- common/content/buffer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 91185e49..9c5f3031 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -167,7 +167,10 @@ var Buffer = Module("buffer", { let type = node.contentType || node.QueryInterface(Ci.nsIImageLoadingContent) .getRequest(0).mimeType; - var ext = "." + services.mime.getPrimaryExtension(type, currExt); + if (type === "text/plain") + var ext = "." + (currExt || "txt"); + else + ext = "." + services.mime.getPrimaryExtension(type, currExt); } else if (currExt) ext = "." + currExt;