Whitelist origins depending on domain/debug setting (bug 1075515)

Also, add loop dev URL on dev or if debug is True.

https://bugzilla.mozilla.org/show_bug.cgi?id=1075515
mp.dev for docker