Home / Archive / fontfaceObserver.js
Duplicate Snippet

Embed Snippet on Your Site

fontfaceObserver.js

Detect if web fonts are available

Code Preview
php
<?php
//  Detect if web fonts are available
function add_custom_script_font_face_observer_js() {
			
			wp_register_script( 'fontface_observer', 'https://cdnjs.cloudflare.com/ajax/libs/fontfaceobserver/2.3.0/fontfaceobserver.standalone.js', array(), '2.3.0', true );
			wp_enqueue_script( 'fontface_observer' );
			
}
add_action( 'wp_enqueue_scripts', 'add_custom_script_font_face_observer_js' );

Comments

Add a Comment