Created
July 5, 2017 14:41
-
-
Save glosik/634c23f54e4146aea3c51e29436722d2 to your computer and use it in GitHub Desktop.
roboto-google-maps-prevent
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) { | |
console.info('Prevented Roboto from loading!'); | |
return; | |
} | |
insertBefore.call(head, newElement, referenceElement); | |
}; | |
// Check it! | |
new google.maps.Map(document.getElementById('map'), { | |
center : new google.maps.LatLng(51.508742,-0.120850), | |
zoom : 16, | |
mapTypeId : google.maps.MapTypeId.ROADMAP, | |
streetViewControl: false, | |
zoomControl : false, | |
panControl : false, | |
mapTypeControl : false | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment