Skip to content

Commit

Permalink
Issue mozilla#99 - Add privacy context to saveScreenshot() due to Bug…
Browse files Browse the repository at this point in the history
… 795065
  • Loading branch information
xabolcs committed Oct 24, 2012
1 parent 753c6ec commit 150eb31
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions extension/chrome/content/screenshot/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,19 @@ function saveScreenshot()
persist.persistFlags = Ci.nsIWebBrowserPersist.PERSIST_FLAGS_REPLACE_EXISTING_FILES;
persist.persistFlags |= Ci.nsIWebBrowserPersist.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;

var privacyContext = null;
if ("nsILoadContext" in Ci) {
privacyContext = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
}

var tr = Cc["@mozilla.org/transfer;1"]
.createInstance(Ci.nsITransfer);

tr.init(source, target, "", null, null, null, persist);
tr.init(source, target, "", null, null, null, persist, false);
persist.progressListener = tr;
persist.saveURI(source, null, null, null, null, file);
persist.saveURI(source, null, null, null, null, file, privacyContext);
}
}

Expand Down

0 comments on commit 150eb31

Please sign in to comment.