You did not list the landing pages , but it probably uses AJAX to set and / or change this global variable.
Also, the question code will break if the script loses its @grant none status, or if you try to use it in any browser other than Firefox. (If only the script uses Injection - what we cannot say from the question.)
To work around the AJAX problem, do a poll for the variable inside setInterval() .
To make the code more reliable, use unsafeWindow or script Injection. See "Accessing Variables from Greasemonkey ..." for details.
Putting it all together, this should work. addEventListener() not required:
var globScope = unsafeWindow || window; var cityCountTimer = setInterval (styleTheCityList, 333); function styleTheCityList () { this.lastCityCount = this.lastCityCount || 0;
Brock adams
source share