Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Prevent Google Maps from loading the Roboto font.
var head = document.getElementsByTagName( 'head' )[0];
// Save the original method
var insertBefore = head.insertBefore;
// Replace it!
head.insertBefore = function( newElement, referenceElement ) {
if ( newElement.href && newElement.href.indexOf( 'https://fonts.googleapis.com/css?family=Roboto' ) === 0 ) {
return;
}
insertBefore.call( head, newElement, referenceElement );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment