Mobile/GeckoView

From MozillaWiki
Jump to: navigation, search

What is GeckoView

GeckoView is an Android library project that allows third-party developers to use Gecko as an Android View in their own applications. GeckoView is similar to Android's built in WebView, but it is not a drop in replacement for WebView.

Note that GeckoView is NOT ready to be used in a production environment. It is currently possible to load pages and do some basic stuff, but features are limited.

Current API documentation can be viewed here: https://mozilla.github.io/geckoview/javadoc/mozilla-central/

Using GeckoView

Add Nightly taskcluster repo to your build.gradle

repositories {
    maven {
       url 'https://index.taskcluster.net/v1/task/gecko.v2.mozilla-central.nightly.latest.mobile.android-api-16-opt/artifacts/public/android/maven'
    }
}

Add geckoview to dependencies

Again, in build.gradle

dependencies {
    compile 'org.mozilla:geckoview-nightly-armeabi-v7a:+'
}

This will always use the latest Nightly in the repository. As GeckoView development continues, we will have Beta and Release repositories that have the expected version names (61.0.0, etc).


Loading a page in GeckoView

You can now use GeckoView your app by including the following in a layout XML file:

<org.mozilla.gecko.GeckoView
  android:id="@+id/geckoview"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content" />

You can then load a page in your Activity with:

onCreate(...) {
    // Find the GeckoView in our layout
    GeckoView geckoView = (GeckoView) findViewById(R.id.geckoview);

    // Attach the GeckoView to a new GeckoSession
    GeckoSession session = new GeckoSession();
    geckoView.setSession(session);

    // Load a URL
    session.loadUri("http://mozilla.com");
}

Example App

Firefox Focus has a build variant that uses Gecko. To build, check out the Focus code from https://github.com/mozilla-mobile/focus-android and follow the instructions. The only difference is you need to select one of the Gecko build variants from the Android Studio 'Build' menu.

The Gecko-related code for Focus lives in WebViewProvider.java

Bugs

Klar Blockers

Full Query
ID Priority Summary Whiteboard Assigned to
927831 P1 [geckoview] Support running without special permissions [geckoview:klar] James Willcox (:snorp) (jwillcox@mozilla.com)
1433968 P1 Figure out GeckoView crash reporting (Sentry and/or Breakpad?) [geckoview:klar] James Willcox (:snorp) (jwillcox@mozilla.com)
1437551 P1 Add GeckoView API for Telemetry [geckoview:klar] Eugen Sawin [:esawin]
1439013 P1 Add gesture information to NavigationDelegate.onLoadRequest() [geckoview:klar] Eugen Sawin [:esawin]
1441059 P1 onLoadRequest can change the order of loads Dylan Roeh (:droeh)
1441810 P1 GeckoView: Save and restore state [geckoview:klar] Dylan Roeh (:droeh)
1450856 P1 ContentDelegate.onExternalResponse doesn't work under non-e10s [geckoview:klar] James Willcox (:snorp) (jwillcox@mozilla.com)

7 Total; 7 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Klar Blockers: Unassigned

Full Query
ID Priority Summary Whiteboard Assigned to
1442176 P1 GeckoView: Do not scroll while moving text selection handles [geckoview:klar]
1454474 P1 Nimbledroid page load performance difference between Webview and Geckoview
1454477 P1 Investigate progressbar behavior difference between geckoview and webview

3 Total; 3 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Klar Bugs: Unprioritized

Full Query
ID Priority Summary Whiteboard Assigned to
1455740 -- Make GeckoView example app more useful
1455788 -- Hover events where the source is touch get filtered.

2 Total; 2 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Klar Bugs: Backlog

Full Query
ID Priority Summary Whiteboard Assigned to
1316241 P2 [geckoview] Make WebRTC work with GeckoView [geckoview:crow][geckoview:klar]
1445285 P2 Animating GeckoView [geckoview:klar]
1448056 P2 Put BasicPromptDelegate in GeckoView AAR [geckoview:klar]
1433198 P2 Publish GeckoView Maven repo on Bintray/JCenter or S3 [geckoview:klar] Chris AtLee [:catlee]
1447390 P2 Add method to control blocking cookies [geckoview:klar]
1451476 P2 Add a page load error API to GeckoView [geckoview:klar]
1380316 P3 Improve APZ fling scroll physics values on Android [geckoview:klar][gfx-noted] Carol Huang [:Carol]
1425739 P3 Scrolling in Android has a distinct hitch when releasing finger [gfx-noted][geckoview:klar]
1448439 P3 Copy Chrome's fling behavior on Android [geckoview:klar][gfx-noted] Botond Ballo [:botond]
1230176 P3 Weirdness at end of Fennec fling. Don't send duplicate DOM 'scroll' event for sub-pixel scrolling [apz-evangelism] [sitewait] [geckoview:klar][gfx-noted]
1343317 P3 Investigate making GeckoView accessible on UiAutomator (DOM Tree visible) [geckoview:klar] Eitan Isaacson [:eeejay]
1421644 P3 Slow flinging on Android [gfx-noted][geckoview:klar] Carol Huang [:Carol]
1445286 P3 Does GeckoView come with fonts and hyphenation dictionaries? [geckoview:klar]
1448921 P3 GeckoView Accessibility Support [geckoview:klar] Eitan Isaacson [:eeejay]
1309021 P3 Cancel flywheel if the user scrolls slowly between the two fast flings [geckoview:klar][gfx-noted]

15 Total; 15 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Crow Bugs

  • All [geckoview:crow] bugs:
Full Query
ID Priority Summary Whiteboard Assigned to
1446239 -- Images turn black while scrolling twitch.tv on Android [gfx-noted][geckoview:crow]
1447850 P1 Move Gamepad support from GeckoView to GeckoSession. [geckoview:crow] Randall Barker [:rbarker]
1316241 P2 [geckoview] Make WebRTC work with GeckoView [geckoview:crow][geckoview:klar]
1439570 P3 Run JS test suite on ARM64 hardware [geckoview:crow]
1446898 P3 [meta] ARM64 JS baseline failures [geckoview:crow]
1453501 P3 When the compositor is restarted after a page has been loaded, the page is not rendered. [geckoview:crow][gfx-noted]
1437547 P3 Bring back Fennec's error pages for GeckoView in apps that don't show their own error pages [geckoview:crow] James Willcox (:snorp) (jwillcox@mozilla.com)

7 Total; 7 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Other Bug Queries