any "smart" way to detect finishing all ajax calls? Page.loadEventFired doesn't work,
e.g. google-chrome-unstable --headless --disable-gpu --no-sandbox --hide-scrollbars --screenshot http://html5test.com, showing only spinning, need to way until the ajax will be finish and then take screenshot.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/1d0acefc-027f-408f-838d-a2734584fab1%40chromium.org.
Network.requestWillBeSent(params => {
requestCount++;
});
Network.loadingFailed(params => {
requestCount--;
});
Network.loadingFinished(params => {
requestCount--;
if (requestCount === 0) {
console.info('are all requests completed?');
}
});Try using the events on Networkhttps://chromedevtools.github.io/devtools-protocol/tot/Network/#event-responseReceivedYou can filter by type including XHR(Ajax).You need to implement this yourself because remember how load event works. Load events works for resources that are defined on the HTML page, so any XHR that comes after those resources is not considered part of that event.
On May 20, 2017 9:15 AM, "headless-man" <bakht...@gmail.com> wrote:
any "smart" way to detect finishing all ajax calls? Page.loadEventFired doesn't work,--
e.g. google-chrome-unstable --headless --disable-gpu --no-sandbox --hide-scrollbars --screenshot http://html5test.com, showing only spinning, need to way until the ajax will be finish and then take screenshot.
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/1e2a76d4-cc15-4407-883e-deb4cdedd762%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/1e2a76d4-cc15-4407-883e-deb4cdedd762%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/a37fadb4-7565-4769-8a20-d546b9c6eb6f%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0AOM-iKX24FQNyo4ZhdLf3qDYpf9kQppZQE7B8twNroxQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/a37fadb4-7565-4769-8a20-d546b9c6eb6f%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0AOM-iKX24FQNyo4ZhdLf3qDYpf9kQppZQE7B8twNroxQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/0c312001-396a-44b8-be49-0eadd3f60f14%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/0c312001-396a-44b8-be49-0eadd3f60f14%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/0c312001-396a-44b8-be49-0eadd3f60f14%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/a37fadb4-7565-4769-8a20-d546b9c6eb6f%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0AOM-iKX24FQNyo4ZhdLf3qDYpf9kQppZQE7B8twNroxQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/609440c8-1ebd-4779-a275-d0ffd6397d32%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/609440c8-1ebd-4779-a275-d0ffd6397d32%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0D0%3DY2w1Hhp%3DeHOLbB7RxPMJoV%2BcmnqLbpwukbctUQdLA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0DA%3D4hS3CO%3DupMbvPkN0FdDShxCDh0oGcB30SV-p%3DDnng%40mail.gmail.com.
frameStartedLoading 27648.1
navigating to 27648.1
waiting...
requestWillBeSent 27648.66 Document http://html5test.com/
responseReceived 27648.66
frameNavigated
loadingFinished 27648.66
0
requestWillBeSent 27648.67 Other http://html5test.com/css/main.css
requestWillBeSent 27648.68 Other http://html5test.com/scripts/base.js
requestServedFromCache 27648.68
1
responseReceived 27648.68
loadingFinished 27648.68
1
requestWillBeSent 27648.69 Other http://html5test.com/scripts/8/engine.js
requestServedFromCache 27648.69
1
responseReceived 27648.69
loadingFinished 27648.69
1
requestWillBeSent 27648.70 Other http://html5test.com/scripts/8/data.js
requestServedFromCache 27648.70
1
responseReceived 27648.70
loadingFinished 27648.70
1
responseReceived 27648.67
loadingFinished 27648.67
0
requestWillBeSent 27648.75 Other http://api.whichbrowser.net/rel/detect.js?ua=Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_12_6)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20HeadlessChrome%2F60.0.3107.0%20Safari%2F537.36&e=48&f=127&r=qr5pwk&w=1680&h=1050
requestWillBeSent 27648.76 Other http://html5test.com/fonts/html5test.woff
requestServedFromCache 27648.76
1
responseReceived 27648.76
loadingFinished 27648.76
1
requestWillBeSent 27648.78 Other http://html5test.com/fonts/leaguegothic-regular-webfont.woff
requestServedFromCache 27648.78
1
responseReceived 27648.78
loadingFinished 27648.78
1
requestWillBeSent 27648.80 Other http://html5test.com/images/ht...@2x.png
requestServedFromCache 27648.80
1
responseReceived 27648.80
loadingFinished 27648.80
1
requestWillBeSent 27648.81 Other http://html5test.com/images/sponsors/clou...@2x.png
requestServedFromCache 27648.81
1
responseReceived 27648.81
loadingFinished 27648.81
1
domContentEventFired
responseReceived 27648.75
loadingFinished 27648.75
0
loadEventFired
frameStoppedLoading 27648.1
requestWillBeSent 27648.82 Other http://html5test.com/
requestWillBeSent 27648.83 XHR http://html5test.com/assets/detect.html?7i0jn
requestWillBeSent 27648.84 XHR http://html5test.com/assets/detect.html?v7f90
requestWillBeSent 27648.85 XHR http://html5test.com/assets/detect.html?804ga
requestWillBeSent 27648.86 XHR http://html5test.com/assets/detect.html?uarow
frameStartedLoading 27648.5
requestWillBeSent 27648.87 Document http://html5test.com/assets/csp.html
requestWillBeSent 27648.88 Other data:text/javascript;charset=utf-8,window
requestServedFromCache 27648.88
6
responseReceived 27648.88
loadingFinished 27648.88
6
requestWillBeSent 27648.90 Other http://s3.buysellads.com/ac/bsa.js
requestWillBeSent 27648.91 Other http://www.google-analytics.com/ga.js
responseReceived 27648.82
loadingFinished 27648.82
7
responseReceived 27648.87
frameNavigated
loadingFinished 27648.87
6
responseReceived 27648.90
loadingFinished 27648.90
5
requestWillBeSent 27648.91 Other https://www.google-analytics.com/ga.js
redirectReponse http://www.google-analytics.com/ga.js
requestWillBeSent 27648.92 Other http://s3.buysellads.com/r/s_6c18c40d896c427f049e74e4c708ab51.js?v=1495479600000
frameStoppedLoading 27648.5
responseReceived 27648.91
loadingFinished 27648.91
5
responseReceived 27648.92
loadingFinished 27648.92
4
requestWillBeSent 27648.93 Other http://s3.buysellads.com/ac/pro.js
responseReceived 27648.93
loadingFinished 27648.93
4
requestWillBeSent 27648.94 Other http://srv.buysellads.com/ads/get/ids/CWSICKV;CWSICKE/?r=1495479600000
responseReceived 27648.83
loadingFinished 27648.83
4
responseReceived 27648.94
loadingFinished 27648.94
3
responseReceived 27648.85
loadingFinished 27648.85
2
requestWillBeSent 27648.95 Other https://s3.buysellads.com/1236118/204861-1389626817.jpg
responseReceived 27648.86
loadingFinished 27648.86
2
responseReceived 27648.95
loadingFinished 27648.95
1
responseReceived 27648.84
loadingFinished 27648.84
0
requestWillBeSent 27648.96 XHR http://html5test.com/api/submit
responseReceived 27648.96
loadingFinished 27648.96
0
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAHKjGjrFpTm_%2B48b-tbd7udRdG%3D4zZjv57GDC3wz_51SM%3DGgOg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CANKfucanOy7PF4ah7gaXnWhdsmeU4%3D_EqzbAJ%3D5Pr_%3DmJ%3D3Tmg%40mail.gmail.com.
Here is an example:
requestWillBeSent 27648.80 Other http://html5test.com/images/htm...@2x.png
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0DoAnXUZLPN7Khhwa2k8%2BhEnP9E3rwWnAwwa-EYTqMV5A%40mail.gmail.com.
Here is an example:
requestWillBeSent 27648.80 Other http://html5test.com/images/ht...@2x.png
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/609440c8-1ebd-4779-a275-d0ffd6397d32%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0D0%3DY2w1Hhp%3DeHOLbB7RxPMJoV%2BcmnqLbpwukbctUQdLA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0DA%3D4hS3CO%3DupMbvPkN0FdDShxCDh0oGcB30SV-p%3DDnng%40mail.gmail.com.
--Alpeware LLC - 548 Market St #35286, San Francisco, CA 94104 - +1 415 200 3094
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAHKjGjrFpTm_%2B48b-tbd7udRdG%3D4zZjv57GDC3wz_51SM%3DGgOg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CANKfucanOy7PF4ah7gaXnWhdsmeU4%3D_EqzbAJ%3D5Pr_%3DmJ%3D3Tmg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0DoAnXUZLPN7Khhwa2k8%2BhEnP9E3rwWnAwwa-EYTqMV5A%40mail.gmail.com.
I am very confused on how setVirtualTimePolicy works. I am testing on Chrome canary on MacOS (HeadlessChrome/60.0.3108.0) and I am getting very confusing results:- if policy is NOT pauseIfNetworkFetchesPending but budget is set, the "Emulation.virtualTimeBudgetExpired" fires right away (I would have expected NOT to fire)
- if policy IS pauseIfNetworkFetchesPending, the event fires at random times. Some times it seems to fire right away (or as soon as one network request completes) independent of the "budget" value, some times it seems to wait until the timeout (budget value) expires (i.e. if I set to 20000, for 20 seconds, it will go through all the network requests and then wait until the 20 seconds (or close to that) pass, after which the event fires.
// In this policy virtual time is allowed to advance unless there are // pending network fetches associated any child WebFrameScheduler, or a // document is being parsed on a background thread. Initially virtual time // is not allowed to advance until we have seen at least one load. The aim // being to try and make loading (more) deterministic.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/609440c8-1ebd-4779-a275-d0ffd6397d32%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0D0%3DY2w1Hhp%3DeHOLbB7RxPMJoV%2BcmnqLbpwukbctUQdLA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAK%3DPu0DA%3D4hS3CO%3DupMbvPkN0FdDShxCDh0oGcB30SV-p%3DDnng%40mail.gmail.com.