|
发表于 2021-6-12 12:15:50
|
显示全部楼层
本帖最后由 Chord 于 2021-6-12 12:17 编辑 : t/ }( w+ D. C$ Z! N9 _9 K1 \; n
3 }. o( ?% O/ {3 |. b6 | n/ n9 yhmmm, 不是特别理解,你的header处的广告位代码样式不是写死固定的么,他是如何溢出来 做成悬浮样式的?
& S4 K5 ]2 V' {4 E$ }
, K+ _, W3 Q1 U" d" U6 p0 }0 D0 b如果你单纯不想让JS加载,不用CSP,用沙盒就行, 用iframe包你的广告位,allow的行为都定义下,只要不添加allow-scripts, iframe里面的JS都失效了0 e0 X2 c1 F! x+ _
6 n4 y$ r/ T6 H! K& L<iframe src="iframe" 1 T4 W! R; u1 d. Z
scrolling="no" sandbox="allow-popups allow-same-origin"
4 y7 p9 W3 S1 H name="sandbox" style="width: 728; height: 90; border: 0px;"></iframe> ! l7 p- l) X* B8 h2 ?$ @
5 L1 g4 k2 E2 G" W* ~$ i
. O6 V h. V& M9 o' S3 }( i8 h7 v8 g3 g" B6 R/ |3 }
参考, n# D' S4 e% K& X9 F
https://blog.dareboost.com/en/20 ... -sandbox-attribute/ |
|