Make allow cross-origin in THREE more general