Bug 1676842 - OpenPGP key manager cannot import from clipboard. r=mkmelin
Differential Revision:
https://phabricator.services.mozilla.com/D96825
--- a/mail/extensions/openpgp/content/modules/clipboard.jsm
+++ b/mail/extensions/openpgp/content/modules/clipboard.jsm
@@ -19,17 +19,17 @@ const nsTransferable = Components.Constr
);
// Create a wrapper to construct an nsITransferable instance and set its source to the given window, when necessary
function Transferable(source) {
let res = nsTransferable();
if ("init" in res) {
// When passed a Window object, find a suitable privacy context for it.
if (source instanceof Ci.nsIDOMWindow) {
- source = source
+ source = source.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
}
res.init(source);
}
return res;
}
@@ -59,17 +59,19 @@ var EnigmailClipboard = {
) {
try {
let transferable = Transferable(window);
transferable.addDataFlavor("text/unicode");
clipBoard.getData(transferable, clipBoardType);
let flavour = {};
transferable.getAnyTransferData(flavour, data);
cBoardContent = data.value.QueryInterface(Ci.nsISupportsString).data;
- } catch (ex) {}
+ } catch (ex) {
+ console.debug(ex);
+ }
}
return cBoardContent;
},
/**
* Set the global (and if available, the selection clipboard)
*
* @param str: String - data to set