Skip to content

Instantly share code, notes, and snippets.

@cameronjonesweb
Last active July 11, 2018 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronjonesweb/f28cd3c5f80ca89701492a0fa21ba399 to your computer and use it in GitHub Desktop.
Save cameronjonesweb/f28cd3c5f80ca89701492a0fa21ba399 to your computer and use it in GitHub Desktop.
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