Ami*_*ham 5 html javascript cookies angular websecurity
我想在我的网络应用程序中添加谷歌地图(嵌入)地图。我正在构建 Angular 8 并使用内置服务器,但仍在 console.log 中显示警告
A cookie associated with a cross-site resource at https://google.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review coo...
Run Code Online (Sandbox Code Playgroud)
我在 ngOnInit 方法的代码中所做的事情,我已经添加了这个
this.cookieService.set('cross-site-cookie',"bar");
this.cookieService.set('SameSite','SameSite=None; Secure');
Run Code Online (Sandbox Code Playgroud)
上面的代码我使用名为 ngx-cookie-service 的 npm 包。另外,当我自己参考这个网站时
https://github.com/GoogleChromeLabs/samesite-examples/blob/master/javascript.md
Run Code Online (Sandbox Code Playgroud)
我不确定我做对了还是错了。我所做的只是使用我所在的谷歌地图的“复制链接”完全复制。如何解决这个问题。
请尝试以下操作:
您可以通过 chrome://flags 禁用 Cookie 弃用消息来禁用它们。
Chrome 控制台 SameSite Cookie 属性警告
如果您可以添加完整的谷歌地图,请按照本教程操作:
https://dev.to/devpato/setup-google-map-in-angular-app-the-pro-way-3m9p
将谷歌地图添加到角度应用程序的更简单方法: https://dev.to/devpato/setup-google-maps-with-agm-in-angular-app-33em
| 归档时间: |
|
| 查看次数: |
2645 次 |
| 最近记录: |