Last active
July 11, 2018 14:03
-
-
Save cameronjonesweb/f28cd3c5f80ca89701492a0fa21ba399 to your computer and use it in GitHub Desktop.
Prevent Google Maps from loading the Roboto font.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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