Reputation: 1022
I need to execute some javascript before the page page loads(= before the javascript on the page is executed)
Is that possible via ghostdriver? using phantomjsdriver 1.2.1 for java, phantomjs 2.0
Upvotes: 2
Views: 1508
Reputation: 7466
No.
PhantomJS is effectively a browser. You cannot edit a webpage in a browser before the browser has loaded it.
Don't bother trying to disable JavaScript in PhatomJS either because then you won't be able to use JavaScript to inject the JavaScript you need before enabling JavaScript.
Upvotes: 2