How PACE collectors work
masterCollectors are the mechanisms that gather progress information. PACE includes four default collectors:
- Ajax: Monitors all AJAX requests.
- Elements: Checks for the existence of specific elements.
- Document: Checks the
document.readyState. - Event Lag: Checks for event loop lag.
To add custom sources, add objects to paceOptions.extraSources. Each source must have either a .progress property or an .elements property (which is a list of objects containing .progress properties). PACE handles the scaling automatically.
paceOptions = {
ajax: false,
document: false,
eventLag: false,
elements: {
selectors: ['.my-page']
}
};