if `location.origin` returns `null` or `undefined`, this is a bug and a bug should be filed on Bugzilla. I just reproduced it too so I'll file a bug about that, but remember we're not on the web and therefore we can fix the platform ;)