GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.44k stars 9.39k forks source link

Leverage Document-Policy implementation in Blink #15709

Open paulirish opened 11 months ago

paulirish commented 11 months ago

Mostly brain dumping my research for future us...

The history of "Document Policy" is weird... Feature-Policy (i have a PR to retitle Eric's nice blogpost..) was introduced in 2018. It had features to control access to permissions and then a handful of UX-y checks/controls for common UX problems.

The whole thing was split into Permission Policy and Document Policy. Though weirdly document.featurePolicy.allowedFeatures() still exists and has a listing of the union.

The permission policy stuff got fairly formalized and adopted. But theres this handful of old UX-y checks in Document-Policy that are VERY similar to Lighthouse audits. They may be useful to us as we consider some core refactors..

resources

document policy features

I'm not sure that all of these can currently run in report-only mode, but.. it should be possible to add trace events, etc. (related)

paulirish commented 11 months ago

Could we adopt these ?