Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple sample script to test the font load modificaion technique
// Test Page:
// Paste below into the WPT Inject Script textarea.
var montserratBold = new FontFace('montserratbold_italic', 'url(fonts/montserrat-bolditalic-webfont.woff2)', {
display: 'swap', // test the page using 'swap'
weight: '700'
// Wait for the fonts to become ready (optional)
document.fonts.ready.then(function() {
for (var allowed of document.fonts) console.dir(allowed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment