Skip to content

Commit

Permalink
Add "testDownloadResumability.showHttpHeaders" preference
Browse files Browse the repository at this point in the history
(#4)
  • Loading branch information
Infocatcher committed Jan 15, 2014
1 parent c8b703f commit dad21b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chrome/content/linkPropsPlus.js
Expand Up @@ -1381,7 +1381,8 @@ var linkPropsPlusSvc = {
if(ch instanceof Components.interfaces.nsIHttpChannel)
ch.setRequestHeader("Range", "bytes=1-32", false);
ch.resumeAt(1, "");
if(ch instanceof Components.interfaces.nsIHttpChannel) try {
var showHeaders = this.pu.pref("testDownloadResumability.showHttpHeaders");
if(showHeaders && ch instanceof Components.interfaces.nsIHttpChannel) try {
this.addHeaderLine("\nTest resumability request:");
ch.visitRequestHeaders(this);
}
Expand All @@ -1408,7 +1409,7 @@ var linkPropsPlusSvc = {
// nsIRequestObserver
onStartRequest: function(request, ctxt) {},
onStopRequest: function(request, ctxt, status) {
if(request instanceof Components.interfaces.nsIHttpChannel) try {
if(showHeaders && request instanceof Components.interfaces.nsIHttpChannel) try {
this.parent.addHeaderLine("\nTest resumability response:");
this.parent.addHeaderLine("Status: " + request.responseStatus + " " + request.responseStatusText);
request.visitResponseHeaders(this.parent);
Expand Down
1 change: 1 addition & 0 deletions defaults/preferences/prefs.js
Expand Up @@ -26,6 +26,7 @@ pref("extensions.linkPropertiesPlus.useRealRefererForTextLinks", false);
pref("extensions.linkPropertiesPlus.testDownloadResumability", true);
pref("extensions.linkPropertiesPlus.testDownloadResumability.download", false);
pref("extensions.linkPropertiesPlus.testDownloadResumability.alwaysShowMenuItem", false);
pref("extensions.linkPropertiesPlus.testDownloadResumability.showHttpHeaders", true);

pref("extensions.linkPropertiesPlus.sizePrecision", 2);
pref("extensions.linkPropertiesPlus.useBinaryPrefixes", true);
Expand Down

0 comments on commit dad21b1

Please sign in to comment.