Below is my code for FF Extension monitoring browsing behaviour.
I can't access trim
method from processClick
method handling click event.
Console shows this.trim
is not a function.
I know that it maybe something with this
scope.
I will be really grateful for any help.
function bbm(doc)
{
this.doc = doc;
this.registerListeners = function() {
this.doc.addEventListener("click", this.processClick, false);
};
this.trim = function(str)
{
return str.replace(/^\s+|\s+$/g, '') ;
};
this.processClick = function(e) {
alert(e.type + " " + this.trim(this.url));
};
};