Firebase get full path of reference URL in dataSnapshot (javascript API)

To get back from a Snapshot to the full URL, you do:

snapshot.ref().toString()

The toString part is somewhat counter-intuitive. I often find myself having to test it, to see if that's indeed the way to go.

hint It would be nice if there was also a more explicit getUrl method hint

UPDATE:

With recent SDK versions ref is no longer a function, so you'll have to use:

snapshot.ref.toString();