Forked from react-native-geckoview
Based on GeckoView.
run yarn add https://github.com/filipef101/react-native-geckowebview-and-adblock
Not published on npm
Android only
Autolinking
-
$ yarn add react-native-geckoview
-
Add the following to your
build.gradle
's repositories section. (android/build.gradle)
allprojects {
repositories {
// ...
// ...
// ADD THIS
maven {
url "https://maven.mozilla.org/maven2/"
}
}
}
$ yarn android
This adds arround 50 mb to your app size,
This doesn't support builds with aab right now, it's an issue with gecko.
To avoid 200mb increase in your app you should set the gradle setting enableSeparateBuildPerCPUArchitecture to true
import GeckoView from 'react-native-geckoview';
<GeckoView source={{ uri: 'https://www.google.com' }} />;
Download a "firefox.signed.xpi " from here , rename it to zip, and extract it. place the contents in android/app/src/main/assets/signed, so that the manifest.json ends up in android/app/src/main/assets/signed/manifest.json.
You should ocasionally update this so you get all the latest adblocking goodness.
on android/app/build.gradle
add the following under defaultConfig {
. | This is because the adblock folder contains folders starting with underscore that are removed if we don't put this.
aaptOptions {
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
}
Make your gradle.properties look like the following:
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
And add the following in your app/build.gradle under the android task:
android {
dexOptions {
javaMaxHeapSize "4g"
}
}
No! This means a website cannot detect that it is a webview by looking for that header (will look to add custom UA if requested).