Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add privacy context to saveScreenshot() due to Bug 795065. Fixes Issue #99. #102

Closed
wants to merge 1 commit into from

2 participants

@xabolcs
Owner

Fix for Issue #99.

Without "nsILoadContext" in Ci check Songbird dies:

"Could not convert JavaScript argument arg 0 [nsISupports.QueryInterface]"
@whimboo
Owner

This looks fine to me. Will land it in a bit.

@whimboo whimboo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 extension/chrome/content/screenshot/screenshot.js
View
11 extension/chrome/content/screenshot/screenshot.js
@@ -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);
}
}
Something went wrong with that request. Please try again.