AdguardTeam / AdguardTeam/Scriptlets

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

Ouverte
#525 3 commentaires 1 réaction 1 personne assignée Réclamée par @maximtop Voir sur GitHub
enhancement Priority: P4 Waiting for data
Langage dominant
JavaScript
Étoiles
195
Forks
33
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.