Add control logic that runs in phantomjs.