What could be going wrong here? The problem seems to be with the regex match statement. without it the alerts come, but as soon as I put it in everything goes quiet. Thanks so much! the wildcard is simply to help pinpoint the problem, it is NOT the objective, i do need regex.
window.addEventListener("load", function() { myExtension.init(); }, false);
var myExtension = {
init: function() {
var appcontent = document.getElementById("appcontent"); // browser
if(appcontent)
appcontent.addEventListener("DOMContentLoaded", myExtension.onPageLoad, true);
var messagepane = document.getElementById("messagepane"); // mail
if(messagepane)
messagepane.addEventListener("load", function () { myExtension.onPageLoad(); }, true);
},
onPageLoad: function(aEvent) {
var doc = aEvent.originalTarget; // doc is document that triggered "onload" event
// do something with the loaded page.
// doc.location is a Location object (see below for a link).
// You can use it to make your code executed on certain pages only.
var url = doc.location; // i have also tried doc.location.href
if (url.match(.*)) {alert( url );}
}
}