Script Summary: Does it happen that you close a last.fm tab or your browser, or follow a link, then your music stops and yourealize too late that you were streaming a track in there? (that's frustrating, isn't it?). No more will it happen!
Two types of pages are protected:
1.Radios: automatic
As soon as a radio is streaming (and only if it is streaming), if you try to navigate away, then you will get a message asking for confirmation ("Do you want to navigate away from this page? etc."):
2.Other pages: manual
As I haven't found how to automatize it so far*, the protection is a bit manual. Under the flash player, a checkbox toggled by a nice fat button proposes to protect the page. When you start playing a track, check the box. Then if you try to navigate away, you will get a message:

You can change the caption of the checkbox if you want, it's right at the beginning of the script.
* If anyone has an idea of how I could get the information from the flash player as to whether it is streaming or not... feel free to help!! =)
Updates
16/11:
-Added inclusion in last.fm/event/ and last.fm/tag/ pages
-Added a button to toggle page protection
-Easy script edit to change user options (remove the button, change text)
I managed to write my first javascript script (i.e. this one) thank to:
-Aquilax for the help in the forums
-reeloo for the tip used in last.fm - radio lyrics to get information about the track in the title
1.Radios: automatic
As soon as a radio is streaming (and only if it is streaming), if you try to navigate away, then you will get a message asking for confirmation ("Do you want to navigate away from this page? etc."):
2.Other pages: manual
As I haven't found how to automatize it so far*, the protection is a bit manual. Under the flash player, a checkbox toggled by a nice fat button proposes to protect the page. When you start playing a track, check the box. Then if you try to navigate away, you will get a message:

You can change the caption of the checkbox if you want, it's right at the beginning of the script.
* If anyone has an idea of how I could get the information from the flash player as to whether it is streaming or not... feel free to help!! =)
Updates
16/11:
-Added inclusion in last.fm/event/ and last.fm/tag/ pages
-Added a button to toggle page protection
-Easy script edit to change user options (remove the button, change text)
I managed to write my first javascript script (i.e. this one) thank to:
-Aquilax for the help in the forums
-reeloo for the tip used in last.fm - radio lyrics to get information about the track in the title




