|
发表于 2021-6-12 12:15:50
|
显示全部楼层
本帖最后由 Chord 于 2021-6-12 12:17 编辑 % r* G: ?5 T3 {3 H% E
% C9 ^# b- r8 V. Q0 j7 n
hmmm, 不是特别理解,你的header处的广告位代码样式不是写死固定的么,他是如何溢出来 做成悬浮样式的?
4 F$ z' m, s: J; u0 ~) s" H) B5 n" {6 C' z& b) w2 P& N3 [
如果你单纯不想让JS加载,不用CSP,用沙盒就行, 用iframe包你的广告位,allow的行为都定义下,只要不添加allow-scripts, iframe里面的JS都失效了
: [0 D* W. {+ a$ H7 b7 J& q0 t
* T' C2 _, J3 s. |<iframe src="iframe"
; M# b- A9 Z, b scrolling="no" sandbox="allow-popups allow-same-origin" 2 O! C" g( F4 Q
name="sandbox" style="width: 728; height: 90; border: 0px;"></iframe> , R9 m. |: s: l7 x
$ l: Y$ E4 ?( j0 r5 C& @2 r1 r8 r- E7 Y, ]$ E
! h, @/ ?6 P* B7 r" a& [$ T参考. ^7 d+ X: c ]8 | e
https://blog.dareboost.com/en/20 ... -sandbox-attribute/ |
|