From 20aa8d74e9b6970753a0fd04279afa5f81953f61 Mon Sep 17 00:00:00 2001 From: "Honza Bambas :mayhemer" Date: Wed, 3 May 2017 18:24:46 +0200 Subject: [PATCH] Upstream changes from: Bug 1319111 - Expose result principal URL ("final channel URL") on LoadInfo, convert current consumers of LOAD_REPLACE This is a downstream change introduced in [1]. That mozilla bug is adding a new property to channel's loadinfo object (nsILoadInfo) that protocol handlers has to set on channels when originalURI on the result channel is set to a different URI than the channel has been created for. Existence of the new property on nsILoadInfo depends on landing [1]. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1319111 --- extensions/firefox/content/PdfStreamConverter.jsm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm index 35e6a6ca3..3a80620e8 100644 --- a/extensions/firefox/content/PdfStreamConverter.jsm +++ b/extensions/firefox/content/PdfStreamConverter.jsm @@ -1013,6 +1013,14 @@ PdfStreamConverter.prototype = { // Keep the URL the same so the browser sees it as the same. channel.originalURI = aRequest.URI; +//#if MOZCENTRAL + channel.loadInfo.resultPrincipalURI = aRequest.loadInfo.resultPrincipalURI; +//#else + if ("resultPrincipalURI" in aRequest.loadInfo) { + channel.loadInfo.resultPrincipalURI = + aRequest.loadInfo.resultPrincipalURI; + } +//#endif channel.loadGroup = aRequest.loadGroup; channel.loadInfo.originAttributes = aRequest.loadInfo.originAttributes;