Bug 1335778 - Add debug logging output for page load events. r=ato

To ease the investigation of possible page load issues debug logging
output is added to the page load listener.

MozReview-Commit-ID: 18itxTHtnBf

--HG--
extra : rebase_source : 7d5f64125453e57113aa565ca09b4eb61a14ec9a
This commit is contained in:
Henrik Skupin 2017-04-12 22:41:21 +02:00
Родитель f1d53ae011
Коммит b7bf594659
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -186,6 +186,8 @@ var loadListener = {
* Callback for registered DOM events.
*/
handleEvent: function (event) {
logger.debug(`Handled DOM event "${event.type}" for "${event.originalTarget.baseURI}"`);
switch (event.type) {
case "beforeunload":
this.seenUnload = true;
@ -244,6 +246,7 @@ var loadListener = {
// listener, and return from the currently active command.
case this.timerPageUnload:
if (!this.seenUnload) {
logger.debug("Canceled page load listener because no page unload has been detected");
this.stop();
sendOk(this.command_id);
}
@ -299,7 +302,6 @@ var loadListener = {
}).then(val => {
if (loadEventExpected) {
// Setup timer to detect a possible page load
// TODO: Make it optional to wait + time with multiplier
if (useUnloadTimer) {
this.timerPageUnload.initWithCallback(this, "200", Ci.nsITimer.TYPE_ONE_SHOT);
}