当我尝试在 Iframe 中显示 google 分析时,为什么会出现错误?
我使用 iframe 在我的网站中基于 Angular 12 显示 google 分析。
这是使用 iframe 的组件:
Typescript:
export class UserReportComponent implements OnInit {
URL: string;
constructor(private domSanitizer: DomSanitizer) { }
ngOnInit(): void {
this.URL= this.domSanitizer.bypassSecurityTrustResourceUrl(path-to-google-analytics)
}
}
Template:
<iframe width="100%" height="950" [src]="URL" frameborder="0" style="border:0" allowfullscreen></iframe>
但是当在控制台中打开该组件时,我收到这些错误:
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute
知道如何修复错误吗?
I use Iframe to display google analytics in my website based on angular 12.
Here is the component where iframe is used:
Typescript:
export class UserReportComponent implements OnInit {
URL: string;
constructor(private domSanitizer: DomSanitizer) { }
ngOnInit(): void {
this.URL= this.domSanitizer.bypassSecurityTrustResourceUrl(path-to-google-analytics)
}
}
Template:
<iframe width="100%" height="950" [src]="URL" frameborder="0" style="border:0" allowfullscreen></iframe>
But when the component is opened in the console I get those errors:
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute
Any idea how to fix the error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论