AngularJs domain name filter
Until now, we used default names such as 'Untitled VU' for virtual users created in octoperf, our load testing tool. That's not very relevant. So we changed it to the domain name of the tested website.
The load tester selects a URL to test, and we need to extract the domain name from it.
The Hyperlink Solution
A nice trick is to create an hyperlink element <a href="..."/>
. Then we can retrieve the hostname, parsed by the browser.
So instead of relying on a regex we use the browser built-in URI parsing capabilities. It's easier and safer.