the js variable 'url' has now the full details where piwik is installed.
this allow the script to run anywhere, including a different host.
Cross-Origin Resource Sharing (CORS) support
if piwik is hosted on a different site than the page calling the js, then the
browser will break the script. This is unless a proper CORS is returned.
This is done by checking which the head 'Origin' with the list of
$params['origins'] and if there's a match to return the proper header
'Access-Control-Allow-Origin' with the right value.