duckduckgo / tracker-surrogates

💉 Surrogates are small scripts that our apps and extensions serve in place of trackers that cause site breakage when blocked.
Other
20 stars 11 forks source link

Expand adsbygoogle.js surrogate script #19

Closed kzar closed 1 year ago

kzar commented 1 year ago

(Depends on https://github.com/duckduckgo/tracker-surrogates/pull/18)

While redirecting requests for the adsbygoogle.js script to an effectively empty script does often work, some websites break or detect that the ads were not displayed.

Let's improve on that, by starting with Mozilla's surrogate script[1], and adding some logic to setup the rough element structure that the real script creates.

1 - https://searchfox.org/mozilla-central/source/browser/extensions/webcompat/shims/google-ads.js