I discovered what happens: I need to load at least one url before loading the custom js functions. I loaded http://example.com before the custom js functions worked fine in "Run Mode".
@unknownmenz I might be wrong, but from what you say, it looks like this process does require a browser, i.e. simple GET/POST won't suffice. Yeah, you can send that to me in private.