onResourceRequested doesn't work properly unless onLoadFinished is declared #14732

amypellegrini opened this Issue Jan 6, 2017 · 0 comments


None yet

1 participant

amypellegrini commented Jan 6, 2017 edited
  1. Which version of PhantomJS are you using? Tip: run phantomjs --version. > 2.1.1

  2. What steps will reproduce the problem?

    1. Invoke this script simple net sniffer with the PhantomJS CLI and observe the logs.
    1. Comment/remove page.onLoadFinished stub from the previous script.
    1. Run the script and watch the logs again: only the initial request of the page is logged.
  1. Which operating system are you using? Windows 7

  2. Did you use binary PhantomJS or did you compile it from source? > Binary

  3. Please provide any additional information below.

I'm not 100% sure if this is a bug or a consistent behaviour which I don't fully understand. I was just tring the do some net sniffing, but could manage to log all resource requests only by declaring onLoadFinished. When this handler is not set, only the initial request of the page is logged.

It works fine for me, but it would be nice to have a warning or description of this behaviour in the docs, or properly address it as a bug, as it took me a little while to figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment