Support dom capture under phantomjs