Keybindings are weird animals. I've always used Ctrl-L for that, which focuses the URL bar and selects it. I note that Alt-D will not remove focus from an existing text widget, so it doesn't work as reliably. Where does Alt-D come from? I guess it's a vestige of an earlier browser?
Also, as the OP is using a mouse action, it's worth pointing out that triple-clicking the URL does a select-all (by analogy to selecting the whole "line" in other apps).
If I remember correctly, Phoenix (firefox) was the first browser to support that keybinding. The lack of support for this shortcut in Netscape/Mozilla was one of the reasons I struggled to switch away from IE back in the day. Really hated Ctrl+L as it required two hands (OK, you need two hands to type out the URL, but I was used to Alt+D dammit! :)
Also, as the OP is using a mouse action, it's worth pointing out that triple-clicking the URL does a select-all (by analogy to selecting the whole "line" in other apps).