Bug 1689462 - don't check for beforeunload on hung content processes, r=florian
Differential Revision: https://phabricator.services.mozilla.com/D104043
This commit is contained in:
@@ -49,6 +49,25 @@
|
||||
"dom.beforeunload_timeout_ms"
|
||||
);
|
||||
|
||||
Object.defineProperty(LazyModules, "ProcessHangMonitor", {
|
||||
configurable: true,
|
||||
get() {
|
||||
// Import if we can - this is a browser/ module so it may not be
|
||||
// available, in which case we return null. We replace this getter
|
||||
// when the module becomes available (should be on delayed startup
|
||||
// when the first browser window loads, via BrowserGlue.jsm ).
|
||||
const kURL = "resource:///modules/ProcessHangMonitor.jsm";
|
||||
if (Cu.isModuleLoaded(kURL)) {
|
||||
let { ProcessHangMonitor } = ChromeUtils.import(kURL);
|
||||
Object.defineProperty(LazyModules, "ProcessHangMonitor", {
|
||||
value: ProcessHangMonitor,
|
||||
});
|
||||
return ProcessHangMonitor;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
});
|
||||
|
||||
const elementsToDestroyOnUnload = new Set();
|
||||
|
||||
window.addEventListener(
|
||||
@@ -1661,6 +1680,15 @@
|
||||
return { permitUnload: true };
|
||||
}
|
||||
|
||||
// Don't bother asking if this browser is hung:
|
||||
let { ProcessHangMonitor } = LazyModules;
|
||||
if (
|
||||
ProcessHangMonitor?.findActiveReport(this) ||
|
||||
ProcessHangMonitor?.findPausedReport(this)
|
||||
) {
|
||||
return { permitUnload: true };
|
||||
}
|
||||
|
||||
let result;
|
||||
let success;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user