ContextMenus getting image name and extension

When you are creating a contextMenus of the type image, is there a way to get the image name and it’s extension as you get them when you are using the default Save image as...? I looked on dev page but all I found is how to get srcUrl but not the 2 I need. In what I’m working right now the name will be changed but I still need the extension of the image, but knowing how to get the name too would be useful in future projects.
The problem is that there are some websites that aren’t including those information in the link or else it would have been easy, just split it by . and /, and you can get the name and extension that way.