Skip to content

Instantly share code, notes, and snippets.

@boffey
Last active October 1, 2022 12:01
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boffey/8516b0091649161cb09e244d63076256 to your computer and use it in GitHub Desktop.
Save boffey/8516b0091649161cb09e244d63076256 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);
};
@niutech
Copy link

niutech commented Jul 11, 2018

The URL should be https://fonts.googleapis.com/css?family=Roboto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment