Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
send(action, worker, skipMasterStore) {
// if the function is async, the worker might not be there yet, or might have already disappeared
try {
if (!skipMasterStore) {
this._store.dispatch(action);
}
worker.port.emit(ADDON_TO_CONTENT, action);
this._perfMeter.log(worker.tab, action.type);
} catch (err) {
this._pagemod.removeWorker(worker);
Cu.reportError(err);
}
},
observe: function CollectorObserver_observe(aSubject, aTopic, aData) {
let data = { };
let type = aTopic;
try {
data = JSON.parse(aData);
} catch (e) {
Cu.reportError("Failure parsing JSON data: " + aData);
}
// Use milliseconds instead of microseconds for the timestamp
if ('timestamp' in data)
data['timestamp'] = Math.round(data['timestamp'] / 1000);
emit(reporter, type, data);
}
}
}).catch(err => {
// TODO: add more exception handling code, e.g. sending exception report
Cu.reportError(err);
});
},
onReady: function(options) {
ToolboxOverlay.prototype.onReady.apply(this, arguments);
Trace.sysout("TriggerToolboxOverlay.onReady;", options);
// Platform support is needed here.
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1184889
if (typeof getHarOverlay != "function") {
Cu.reportError("Platform support needed, see Bug: " +
"https://bugzilla.mozilla.org/show_bug.cgi?id=1184889");
return;
}
// Call make remote to make sure the target.client exists.
let target = this.toolbox.target;
target.makeRemote().then(() => {
// The 'devtools.netmonitor.har.enableAutoExportToFile' option doesn't
// have to be set if users don't want to auto export to file after
// every page load.
// But, if users want to use HAR content API to trigger HAR export
// when needed, HAR automation needs to be activated. Let's do it now
// if 'extensions.netmonitor.har.enableAutomation' preference is true.
if (prefs.enableAutomation && !this.automation) {
Trace.sysout("TriggerToolboxOverlay.onReady; Init automation");
onStateChange: function(browser, webProgress, request, flags, status)
{
if (!(flags & Ci.nsIWebProgressListener.STATE_IS_WINDOW))
return;
if (!(flags & Ci.nsIWebProgressListener.STATE_START) && !(flags & Ci.nsIWebProgressListener.STATE_REDIRECTING))
return;
if (request instanceof Ci.nsIChannel)
Cu.reportError("[testhelper] Loading: " + request.URI.spec);
}
};
removeFrameListener: function() {
var innerId = getInnerId(this.parent.window);
try {
webSocketService.removeListener(innerId, this);
} catch (err) {
Cu.reportError("WsmActor.removeFrameListener; ERROR " + err, err);
}
},
});
removeFrameListener: function() {
var innerId = getInnerId(this.parent.window);
try {
webSocketEventService.removeListener(innerId, this);
} catch (err) {
Cu.reportError("WsmActor.removeFrameListener; ERROR " + err, err);
}
},
});
error => {
Cu.reportError(error);
deferred.reject(error);
});
return deferred.promise;
SslSmtpClient.prototype.internalNextCommand = function() {
if(this.pending_command)
return;
if(this.commands.length == 0)
return;
var cmd = this.commands.shift();
var data_bit = cmd["command"] + "\r\n";
if(this.logging)
Cu.reportError("SMTP OUT @ " + new Date() + ":\n" + data_bit);
this.socket.write(data_bit);
this.pending_command = cmd;
};
SslSmtpClient.prototype.disconnect = function() {
_onAttachConsole: function WCCP__onAttachConsole(aResponse, aWebConsoleClient)
{
if (aResponse.error) {
Cu.reportError("attachConsole failed: " + aResponse.error + " " +
aResponse.message);
this._connectDefer.reject(aResponse);
return;
}
this.webConsoleClient = aWebConsoleClient;
this._hasNativeConsoleAPI = aResponse.nativeConsoleAPI;
let msgs = ["PageError", "ConsoleAPI"];
this.webConsoleClient.getCachedMessages(msgs, this._onCachedMessages);
this.owner._updateReflowActivityListener();
},