AdguardTeam / AdguardTeam/Scriptlets

Improve 'googlesyndication-adsbygoogle' — fails to create iframes when there's no '.adsbygoogle'

未关闭
#525 3 条评论 1 个 reaction 已指派 1 人 已被 @maximtop 认领 在 GitHub 查看
enhancement Priority: P4 Waiting for data
主要语言
JavaScript
星标
195
派生
33
PR 合并指标
30 天内没有已合并 PR

描述

It seems the current `googlesyndication-adsbygoogle` fails to create `iframe#aswift_1` etc. if `.adsbygoogle` does not exist when its executed. This is causing these filters in Base
```
pvpoke-re.com#%#//scriptlet('trusted-create-element', '.adsbygoogle:has(> #aswift_1)', 'div', 'id="aswift_1_host" style="height: 280px; width: 780px;"')
pvpoke-re.com#%#//scriptlet('trusted-create-element', '.adsbygoogle:has(> #aswift_2)', 'div', 'id="aswift_2_host" style="height: 280px; width: 396px;"')
```

to occasionally fail on the initial load, as they depend on existence of the iframes.

Expected fix:
the redirect should handle the case where `.adsbygoogle` elements do not yet exist at script execution time, likely by observing DOM mutations (via `MutationObserver`) and creating the required iframes (`#aswift_1`, etc.) when `.adsbygoogle` elements are inserted.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。