aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/viewSource.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/lib/viewSource.js')
-rw-r--r--data/lib/viewSource.js52
1 files changed, 28 insertions, 24 deletions
diff --git a/data/lib/viewSource.js b/data/lib/viewSource.js
index 25cba58..fd47cec 100644
--- a/data/lib/viewSource.js
+++ b/data/lib/viewSource.js
@@ -51,7 +51,7 @@ function viewAttachmentSource(doc) {
if (!table)
return;
var rows = table.querySelectorAll("tr");
- for (var i = 0; i < rows.length; ++i) {
+ for ( var i = 0; i < rows.length; ++i) {
var items = rows[i].querySelectorAll("td");
if (items.length != 3)
continue;
@@ -68,32 +68,36 @@ function viewAttachmentSource(doc) {
// Match mime type followed by ";" (charset) or ")" (no charset)
typeName = span.textContent.match(reAttachmentType)[1];
typeName = typeName.split(";")[0]; // ignore charset following type
- } catch (e) {}
- if (typeName == "application/java-archive" ||
- typeName == "application/x-jar") {
+ }
+ catch (e) {
+ }
+ if (typeName == "application/java-archive"
+ || typeName == "application/x-jar") {
// Due to the fix for bug 369814, only zip files with this special
// mime type can be used with the jar: protocol.
// http://hg.mozilla.org/mozilla-central/rev/be54f6bb9e1e
- addLink(items[2], "JAR Contents", "jar:" + attachHref + "!/");
- // https://bugzilla.mozilla.org/show_bug.cgi?id=369814#c5 has more possible mime types for zips?
- } else if (typeName == "application/zip" ||
- typeName == "application/x-zip-compressed" ||
- typeName == "application/x-xpinstall") {
- addLink(items[2], "Static ZIP Contents", "jar:" + attachHref + "!/");
- } else if (typeName != "text/plain" &&
- typeName != "patch" &&
- // Other types that Gecko displays like text/plain
- // http://mxr.mozilla.org/mozilla-central/source/parser/htmlparser/public/nsIParser.h
- typeName != "text/css" &&
- typeName != "text/javascript" &&
- typeName != "text/ecmascript" &&
- typeName != "application/javascript" &&
- typeName != "application/ecmascript" &&
- typeName != "application/x-javascript" &&
- // Binary image types for which the "source" is not useful
- typeName != "image/gif" &&
- typeName != "image/png" &&
- typeName != "image/jpeg") {
+ addLink(items[2], "JAR Contents", "jar:" + attachHref
+ + "!/");
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=369814#c5 has more
+ // possible mime types for zips?
+ }
+ else if (typeName == "application/zip"
+ || typeName == "application/x-zip-compressed"
+ || typeName == "application/x-xpinstall") {
+ addLink(items[2], "Static ZIP Contents", "jar:"
+ + attachHref + "!/");
+ }
+ else if (typeName != "text/plain" && typeName != "patch" &&
+ // Other types that Gecko displays like text/plain
+ // http://mxr.mozilla.org/mozilla-central/source/parser/htmlparser/public/nsIParser.h
+ typeName != "text/css" && typeName != "text/javascript"
+ && typeName != "text/ecmascript"
+ && typeName != "application/javascript"
+ && typeName != "application/ecmascript"
+ && typeName != "application/x-javascript" &&
+ // Binary image types for which the "source" is not useful
+ typeName != "image/gif" && typeName != "image/png"
+ && typeName != "image/jpeg") {
addLink(items[2], "Source", "view-source:" + attachHref);
}
}