is it possible to deactivate Google Fonts in some way? Unfortunately using Google Fonts in Germany has turned into a very dangerous endeavor as it send the IP Adress of the User to the USA.
I thought about manually adding & hosting the fonts in my application, but I’m not sure if this is sufficient to deactivate Google Fonts (because it’s basically not actively used). Does anyone have an idea on how this could be achieved?
We have the same problem, and are looking for a solution. One of our applications already got a warning, and in the future more websites will get sued.
Thank you both. I’ve managed to install my custom font, and then selected it as my app font, and then had all my styles use that font. I’ve also made sure that no text element (or button or whatever) was using a custom font other than the one attached to its style. However for some reason my app still has calls to Google fonts…
the only way i can think of that would actually prevent the google fonts from loading is intercepting the HTTP requests made to the google fonts server and stopping them.
you can use the service worker to intercept the call to google fonts, and then swap it out for your own hardcoded font. the code inside of the service worker would look something like this:
self.addEventListener('fetch', function(event) {
if (/fonts\.gstatic\.com/.test(event.request.url)) {
// Respond with a font that's stored on your own server
event.respondWith(fetch('/url/to/your/font.woff2'));
}
});
without going into too much detail, to achieve this all you’d have to do is host a service worker file and upload it to the root folder (can be done in settings) with as specific name. then run 1 line of js on every page (can also use the script tag section in the settings) to register the service worker.