Differential Revision: https://phabricator.services.mozilla.com/D42122

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gijs Kruitbosch 2019-08-20 13:12:17 +00:00
Родитель d11d241116
Коммит 91775b86ee
2 изменённых файлов: 7 добавлений и 4 удалений

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

@ -363,7 +363,10 @@ function onContentMessage(e) {
const value = e.detail.value;
switch (e.detail.type) {
case "save":
Services.cpmm.sendAsyncMessage("devtools:jsonview:save", value);
win.docShell.messageManager.sendAsyncMessage(
"devtools:jsonview:save",
value
);
}
}

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

@ -1156,7 +1156,7 @@ const JsonView = {
// Register for messages coming from the child process.
// This is never removed as there is no particular need to unregister
// it during shutdown.
Services.ppmm.addMessageListener("devtools:jsonview:save", this.onSave);
Services.mm.addMessageListener("devtools:jsonview:save", this.onSave);
},
// Message handlers for events from child processes
@ -1166,8 +1166,8 @@ const JsonView = {
* in the parent process.
*/
onSave: function(message) {
const chrome = Services.wm.getMostRecentWindow("navigator:browser");
const browser = chrome.gBrowser.selectedBrowser;
const browser = message.target;
const chrome = browser.ownerGlobal;
if (message.data === null) {
// Save original contents
chrome.saveBrowser(browser);