Last active
October 1, 2022 12:01
-
-
Save boffey/8516b0091649161cb09e244d63076256 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
The URL should be
https://fonts.googleapis.com/css?family=Roboto