diff --git a/browser/extensions/mortar/host/common/ppapi-runtime.jsm b/browser/extensions/mortar/host/common/ppapi-runtime.jsm index 6ecc506b6b01..874d71d0df13 100644 --- a/browser/extensions/mortar/host/common/ppapi-runtime.jsm +++ b/browser/extensions/mortar/host/common/ppapi-runtime.jsm @@ -1811,7 +1811,8 @@ class PPAPIInstance { this.mm.sendAsyncMessage("ppapi.js:setFullscreen", message.fullscreen); break; case 'save': - this.mm.sendAsyncMessage("ppapipdf.js:save"); + this.mm.sendAsyncMessage("ppapipdf.js:save", { + url: this.info.url }); break; case 'setHash': this.mm.sendAsyncMessage("ppapipdf.js:setHash", message.hash); diff --git a/browser/extensions/mortar/host/pdf/ppapi-content-sandbox.js b/browser/extensions/mortar/host/pdf/ppapi-content-sandbox.js index ea5754ab49ad..b2b30dd94bcc 100644 --- a/browser/extensions/mortar/host/pdf/ppapi-content-sandbox.js +++ b/browser/extensions/mortar/host/pdf/ppapi-content-sandbox.js @@ -222,8 +222,8 @@ mm.addMessageListener("ppapipdf.js:openLink", ({data}) => { } }); -mm.addMessageListener("ppapipdf.js:save", () => { - let url = containerWindow.document.location; +mm.addMessageListener("ppapipdf.js:save", ({ data }) => { + let url = new containerWindow.URL(data.url); let filename = getFileName(url); let originalUri = NetUtil.newURI(url.href); let extHelperAppSvc =