Bug 1223277 - Log outer window id of the content window when framescript is registered.
It will help a lot for debugging when the outer window id of the
content window gets logged when the frame script gets registered.
MozReview-Commit-ID: D64A1nPEs6l
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -82,17 +82,16 @@ var syncChrome = proxy.toChrome(sendSync
var cookies = new Cookies(() => curContainer.frame.document, syncChrome);
Cu.import("resource://gre/modules/Log.jsm");
var logger = Log.repository.getLogger("Marionette");
// Append only once to avoid duplicated output after listener.js gets reloaded
if (logger.ownAppenders.length == 0) {
logger.addAppender(new Log.DumpAppender());
}
-logger.debug("loaded listener.js");
var modalHandler = function() {
// This gets called on the system app only since it receives the mozbrowserprompt event
sendSyncMessage("Marionette:switchedToFrame", {frameValue: null, storePrevious: true});
let isLocal = sendSyncMessage("MarionetteFrame:handleModal", {})[0].value;
if (isLocal) {
previousContainer = curContainer;
}
@@ -299,17 +298,17 @@ var loadListener = {
observe: function (subject, topic, data) {
const winID = subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
const curWinID = curContainer.frame.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
logger.debug(`Received observer notification "${topic}" for "${winID}"`);
switch (topic) {
- // In the case when the currently selected frame is about to close,
+ // In the case when the currently selected frame is closed,
// there will be no further load events. Stop listening immediately.
case "outer-window-destroyed":
if (curWinID === winID) {
this.stop();
sendOk(this.command_id);
}
break;
}
@@ -385,16 +384,18 @@ var loadListener = {
/**
* Called when listener is first started up.
* The listener sends its unique window ID and its current URI to the actor.
* If the actor returns an ID, we start the listeners. Otherwise, nothing happens.
*/
function registerSelf() {
let msg = {value: winUtil.outerWindowID};
+ logger.debug(`Register listener.js for window ${msg.value}`);
+
// register will have the ID and a boolean describing if this is the main process or not
let register = sendSyncMessage("Marionette:register", msg);
if (register[0]) {
let {id, remotenessChange} = register[0][0];
capabilities = session.Capabilities.fromJSON(register[0][1]);
listenerId = id;
if (typeof id != "undefined") {