Hello
Since today the console started to show the following message when I load my homepage.
Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading”
This warning didn’t appear before. Is there any way to solve this?
Here is a capture from my developer site using the default Storefront woocommerce theme. Only this plugin is activated.
setTimeout(() => {
this.dangerousUrl = "https://www.google.com/maps?q=" + this.property.theaddress + "&output=embed";
}, 100);
return this.dangerousUrl;
in html: (having pipe called safe)
<div>
<iframe *ngIf="deviveInfo.deviceType != 'mobile'"
[src]= dangerousUrl|safe
width="800" height="450" style="border:0;" loading="lazy"
referrerpolicy="no-referrer-when-downgrade">
</iframe>
</div>
the pipe:
import { Pipe, PipeTransform } from '@angular/core';
import {DomSanitizer} from "@angular/platform-browser";
@Pipe({
name: 'safe'
})
export class safeUrl implements PipeTransform {
constructor(private sanitizer: DomSanitizer) { }
transform(url: any) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
}
and in the index:
<script src="https://maps.googleapis.com/maps/api/js?key=MyKey&callback=initMap"></script>
can you help me with that, why I am getting the warning?
Thank you.