Jump to content

 
Photo

Firefox/Greasemonkey script for CartoTalk


  • Please log in to reply
No replies to this topic

#1
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,301 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

I have recently moved my primary browser from Maxthon to Firefox, and started experimenting with some cool things in the Firefox add-on called Greasemonkey. This add-on lets you run scripts on pages after they are loading.

I whipped together a little script that opens up all new posts in new tabs, when one opens the "view new posts" page:
if (document.getElementById('navstrip').innerHTML.match('Posts since your last visit') != null) {

	var linkTags = document.getElementsByTagName('a');

	for (var i = linkTags.length-1; i >=0; i--) {

		if (linkTags[i].href.match(/http:\/\/www.cartotalk.com\/index.php\?showtopic=\d+\&view=getnewpost/) != null) window.open(linkTags[i].href);

	}

}

Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->