mcp, agent: load external stylesheets by default
Merged
AR
1mo ago+41+41+01234567890123456789-2-2-0123456789
mcp and agent now load external stylesheets by default. Without them, anything an author class hides (closed menus, drawers, modals) reads as visible to tree, interactiveElements and the click checks.
Example
A page whose menu is hidden by a linked stylesheet (.menu[data-open=false] { display: none }), read with tree.
Before:
1 RootWebArea 'News'
4 dialog 'Menu'
5 [i] link 'World'
6 [i] link 'Sport'
7 alert
8 'Session expires in 2 minutes'
...
After:
1 RootWebArea 'News'
4 alert
5 'Session expires in 2 minutes'
...
On live pages the semantic tree goes from 1591 to 767 lines on lemonde.fr, 1148 to 756 on theverge.com, and 1734 to 1572 on Wikipedia.
Cost
Release build, median of 5 alternating live runs:
| page | off (ms) | on (ms) | Δ |
|---|---|---|---|
| lemonde.fr | 421 | 450 | +30 |
| lobste.rs | 555 | 625 | +70 |
| wikipedia.org | 493 | 527 | +35 |
| github.com | 959 | 1448 | +489 |
| theverge.com | 1644 | 2406 | +762 |
The worst cases come from fetching sheets one at a time; fetching them in parallel would cut most of that.
CLI
--load-resourcesgiven explicitly replaces the mode default instead of adding to it.- New
nonevalue loads nothing. fetchandservekeep loading nothing by default.