A snippet for inspecting font-family usage in a webpage.
To have a quick look into font-family usage in a webpage.
Texts inside these elements will be ignored: script, noscript, style, iframe, option.
Invisible elements won't be taken into account as well, which are verified by any of the following criteria:
- with
opacity: 0 - with
display: none - with
visibility: hidden - with
text-indentvalue no larger than-512(an intuitive value) or the value equals to100%(which are common ways of hiding text for icons or title images) - with computed area no larger than 1px² and with
overflowvalue not equal tovisible(which are common ways to provide accessibility enhancement, see GitHub'sa.accessibility-aidat the begining ofbody) - with
clip: rect(1px, 1px, 1px, 1px)(another way of hiding text) - with invisible
parentNodeaccording to the criteria above
The result will sort all used font-family values by the number of glyphs they apply to. ie. most used one will be at the top of the result list.
- Open http://justineo.github.io/fi/
- Drag the fi link in the middle of the page onto your browser's bookmark bar
- Open the webpage you'd like to inspect
- Click the bookmarklet you just added
- View the result
Bookmarklets can be blocked under certain security policies so browser extensions are more recommended.