For now this is only tested on Goutte driver, this will probably need some adjustments for the javascript part,