Bug 864658, URL API should have same properties as window.location

also fixes bug 861084