Set origin to event.origin in case of non-null event.origin rather than ...

...setting origin to itself

I'm not sure how you are doing your js compression, so I did not change the min file.  This is what I had to do in order to get the file working for me.