Getting remote debugging set up with PhantomJS

前端 未结 4 808
后悔当初
后悔当初 2021-01-30 16:56

I\'m trying to set up remote debugging with PhantomJS, without much luck. I am following the instructions at https://github.com/ariya/phantomjs/wiki/Troubleshooting. I have a li

4条回答
  •  青春惊慌失措
    2021-01-30 17:48

    In my case the __run() would not be executed in the console. If this is the same issue you have, read on....

    Open PowerShell and execute the script:

    cls
    # we go to the folder where our test.js script resides
    cd "C:\Users\xxx\Phantomjs.Console"
    phantomjs --remote-debugger-port=9000 --remote-debugger-autorun=yes test.js 
    
    1. Open your Chrome browser and go to
    2. http://localhost:9000
    3. Click on your, in my case test.js file.
    4. Switch to the Sources tab!
    5. Execute __run() under Watch Expressions!

    Put a debugger statement in your script for debugging!

提交回复
热议问题