Bug 1683244 - Part 1: Fix the issue that `save As` of multiple selected links in PageInfo media tab doesn't work. r=smaug

The root cause is that it doesn't pass the cookieJarSettings parameter
when calling the internalSave() in pageInfo.js. This patch fixes this by
passing the correct cookieJarSettings which was passed via the
'PageInfo:getData' message.

Differential Revision: https://phabricator.services.mozilla.com/D100130
This commit is contained in:
Tim Huang 2020-12-19 22:51:04 +00:00
Родитель 5a96f35156
Коммит 9b272a4cb1
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -10,6 +10,7 @@ const { XPCOMUtils } = ChromeUtils.import(
);
XPCOMUtils.defineLazyModuleGetters(this, {
E10SUtils: "resource://gre/modules/E10SUtils.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
setTimeout: "resource://gre/modules/Timer.jsm",
});
@ -90,6 +91,9 @@ class PageInfoChild extends JSWindowActorChild {
docInfo.characterSet = document.characterSet;
docInfo.lastModified = document.lastModified;
docInfo.principal = document.nodePrincipal;
docInfo.cookieJarSettings = E10SUtils.serializeCookieJarSettings(
document.cookieJarSettings
);
let documentURIObject = {};
documentURIObject.spec = document.documentURIObject.spec;

Просмотреть файл

@ -712,6 +712,9 @@ function saveMedia() {
true,
Services.io.newURI(item.baseURI)
);
let cookieJarSettings = E10SUtils.deserializeCookieJarSettings(
gDocInfo.cookieJarSettings
);
saveURL(
url,
null,
@ -719,7 +722,7 @@ function saveMedia() {
false,
false,
referrerInfo,
null,
cookieJarSettings,
null,
gDocInfo.isContentWindowPrivate,
gDocInfo.principal
@ -736,6 +739,9 @@ function saveMedia() {
true,
aBaseURI
);
let cookieJarSettings = E10SUtils.deserializeCookieJarSettings(
gDocInfo.cookieJarSettings
);
internalSave(
aURIString,
null,
@ -746,6 +752,7 @@ function saveMedia() {
"SaveImageTitle",
aChosenData,
referrerInfo,
cookieJarSettings,
null,
false,
null,