// locationchange.js // // Copyright (C) 2007 serikashiki //////////////////////////////////////////////////////////////////////////////// const _locationchangeListener = { onStatusChange: function(){}, onProgressChange: function(){}, onLocationChange: function(aWebProgress, aRequest, aLocation){ alert("New URL: "+ aLocation.asciiSpec); }, onStateChange: function(){}, onSecurityChange: function(){} }; function _locationchangeInstall(event) { var b = getBrowser(); b.addProgressListener(_locationchangeListener); } function _locationchangeUnInstall(event) { var b = getBrowser(); if(b){ b.removeProgressListener(_locationchangeListener); } window.removeEventListener("load", _locationchangeInstall, false); } window.addEventListener("load", _locationchangeInstall, false); window.addEventListener("unload", _locationchangeUnInstall,false);