Skip to content

imslp/capacitor.geckoview

Repository files navigation

This is a Next.js / Capacitor demo project to test Geckoview with Capacitor.

Getting Started

  1. Initialize packages.
yarn install
  1. Build the nextjs app and export to the out folder.
yarn build
  1. Synchronize the capacitor app.
npx cap sync
  1. In android/capacitor.settings.gradle, replace the line:

project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')

with:

project(':capacitor-android').projectDir = new File('../capacitor-geckoview/capacitor')

  1. Build the app using Android studio.

  2. If Geckoview is successfully being used, the main page should show geckoview_accessing_localhost_port/xxxx at the bottom as the user agent.

Other Platforms & Geckoview Versions

To build for other platforms (default is arm64-v8a), comment out the ndk block in android/app/build.gradle.

The default Geckoview version used is 117 for its balance of performance and size. For a smaller size we can use older versions of Geckoview by modifying the appropriate line in capacitor-geckoview/capacitor/build.gradle.

TODOs

  • Port this to Capacitor 6.0.
  • Complete implementation of unimplemented features.