Static vs dynamic assessment modes
Capo.js supports two modes of assessment: static and dynamic. Understanding the difference between these modes is crucial for interpreting the results and choosing the right tool for the job.
Static Mode
Section titled “Static Mode”In static mode, Capo.js analyzes the server-rendered HTML of the page. This is achieved by fetching the page’s URL and parsing the returned HTML.
- Capo.js fetches the current page’s URL.
- It parses the response body to extract the
<head>element. - It analyzes the elements within this static
<head>.
Static mode is ideal when you want to see how the page is delivered from the server, before any client-side JavaScript has modified the DOM. This is useful for identifying issues with the initial HTML structure.
Static mode is the default mode in the Capo.js Chrome Extension.
Dynamic Mode
Section titled “Dynamic Mode”In dynamic mode, Capo.js analyzes the current state of the DOM in the browser.
- Capo.js accesses the
document.headelement directly. - It analyzes the elements currently present in the
<head>.
Dynamic mode is useful when you want to see the final state of the <head> after client-side scripts have run. This can help identify elements added or modified dynamically, which might affect performance or behavior.
Dynamic mode is the default mode when using the CLI, and can be enabled in the Chrome Extension options.