|
发表于 2021-6-12 12:15:50
|
显示全部楼层
本帖最后由 Chord 于 2021-6-12 12:17 编辑 # p( e; }. c" C3 h. N. ? t+ N& Y( [
4 _. g( V. G" {. P# R+ M, K1 l% e* yhmmm, 不是特别理解,你的header处的广告位代码样式不是写死固定的么,他是如何溢出来 做成悬浮样式的?
9 w9 r3 I. u! I/ r5 }
: O- m/ c3 `- S3 u* W如果你单纯不想让JS加载,不用CSP,用沙盒就行, 用iframe包你的广告位,allow的行为都定义下,只要不添加allow-scripts, iframe里面的JS都失效了* X" [ Y; d& G
, S( m1 |/ P( S<iframe src="iframe"
, [ ?1 R' ]. i4 @# L& r" e scrolling="no" sandbox="allow-popups allow-same-origin" , t2 Q( U% W6 q, r) F: ?" V, S
name="sandbox" style="width: 728; height: 90; border: 0px;"></iframe> 4 E6 s3 P8 l- d: ~
" ?5 I4 ~+ o1 E) b# J" U; Y! Y9 s8 ^/ P/ G$ k# G3 t% ~+ O! i) _3 X
& ^) n! W1 A, Z& ^7 f参考
( g( z" g! S) q! b5 `# \" N) }https://blog.dareboost.com/en/20 ... -sandbox-attribute/ |
|