Bug 920752 - Make origin more flexible to fix browser case

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