Use the browser's built-in URL parser to extract the origin
Use the browser's built-in URL parser to extract the origin

The original origin extraction code would fail to extract the
correct origin when passed URLs like "http://example.com@evil.com"
but it was only fed URLs configured by the developer using winchan
so it wouldn't lead to security problems.

This fix is intended to prevent problems should this function be
used for other purposes in the future.

https://bugzilla.mozilla.org/show_bug.cgi?id=878485

auth0/winchan,auth0/winchan