百度统计工具无法查看热力图,网站禁止被ifra
seo优化 2022-06-25 09:56www.1681989.comseo排名
今天推火专家seo博客和朋友们分享一下百度统计工具无法查看热力图,网站禁止被iframe加载怎么办,热力图是通过在iframe中加载用户设置的预览url的方式实现的,如果用户设置的预览页面禁止被iframe加载,那热力图固然是无法使用的。
Furthermore, X-Frame-Options must be sent as an HTTP header field and is explicitly ignored by user agents when declared with a meta http-equiv tag.
在meta标签中使用X-Frames-Options的方式会被一些浏览器忽略,iframe被禁止加载一般是因为header中使用了X-Frame-Options属性。 X-Frame-Options官方提供了3个属性值deny、sameorig、allow-from https://example./。
deny: 禁用;
sameorig: 同源下被允许
allow-from: 允许https://example./加载iframe
如果使用allow-from,在chrome下会发生如下报错
说明allow-from在chrome下会被忽略。有些地方使用allowall,allowall并不是X-Frame-Options的有效值(RFC7034),建议在header中直接去掉X-Frame-Options。