Handle click on a link which contains children

Previous version checks that click's e.target instanceof HTMLAnchorElement. That did not work if link contains children dom nodes, e.g. image or span.
New version checks e.target and search all it's parents for an HTMLAnchorElement. This is actually how file:// links had been working before Firefox 29 release.