Open
Description
I am working on a react native app with a web view that should block ads. The web view offers a way to inject javascript code. What is the correct way to inject your ad blocker?
I tried around but found no solution. It could look similar to the code below:
<WebView
source={{
uri: 'https://website-with-ads.example.com',
}}
javaScriptEnabled={true}
injectedJavaScript={`
var my_script = document.createElement('script');
my_script.setAttribute('src','https://cdn.jsdelivr.net/npm/@cliqz/adblocker-webextension/dist/adblocker.umd.min.js');
document.head.appendChild(my_script);
`}
/>
Thanks for your support!
Metadata
Metadata
Assignees
Labels
No labels