Name Description Size
AllowOrDeny.java This represents a decision to allow or deny a request. 504
Autocomplete.java The Autocomplete API provides a way to leverage Gecko's input form handling for autocompletion. <p>The API is split into two parts: 1. Storage-level delegates. 2. User-prompt delegates. <p>The storage-level delegates connect Gecko mechanics to the app's storage, e.g., retrieving and storing of login entries. <p>The user-prompt delegates propagate decisions to the app that could require user choice, e.g., saving or updating of login entries or the selection of a login entry out of multiple options. <p>Throughout the documentation, we will refer to the filling out of input forms using two terms: 1. Autofill: automatic filling without user interaction. 2. Autocomplete: semi-automatic filling that requires user prompting for the selection. <h2>Examples</h2> <h3>Autocomplete/Fetch API</h3> <p>GeckoView loads <code>https://example.com</code> which contains (for the purpose of this example) elements resembling a login form, e.g., <pre><code> &lt;form&gt; &lt;input type=&quot;text&quot; placeholder=&quot;username&quot;&gt; &lt;input type=&quot;password&quot; placeholder=&quot;password&quot;&gt; &lt;input type=&quot;submit&quot; value=&quot;submit&quot;&gt; &lt;/form&gt; </code></pre> <p>With the document parsed and the login input fields identified, GeckoView dispatches a <code> StorageDelegate.onLoginFetch(&quot;example.com&quot;)</code> request to fetch logins for the given domain. <p>Based on the provided login entries, GeckoView will attempt to autofill the login input fields, if there is only one suitable login entry option. <p>In the case of multiple valid login entry options, GeckoView dispatches a <code> GeckoSession.PromptDelegate.onLoginSelect</code> request, which allows for user-choice delegation. <p>Based on the returned login entries, GeckoView will attempt to autofill/autocomplete the login input fields. <h3>Update API</h3> <p>When the user submits some login input fields, GeckoView dispatches another <code> StorageDelegate.onLoginFetch(&quot;example.com&quot;)</code> request to check whether the submitted login exists or whether it's a new or updated login entry. <p>If the submitted login is already contained as-is in the collection returned by <code> onLoginFetch</code>, then GeckoView dispatches <code>StorageDelegate.onLoginUsed</code> with the submitted login entry. <p>If the submitted login is a new or updated entry, GeckoView dispatches a sequence of requests to save/update the login entry, see the Save API example. <h3>Save API</h3> <p>The user enters new or updated (password) login credentials in some login input fields and submits explicitely (submit action) or by navigation. GeckoView identifies the entered credentials and dispatches a <code>GeckoSession.PromptDelegate.onLoginSave(session, request) </code> with the provided credentials. <p>The app may dismiss the prompt request via <code> return GeckoResult.fromValue(prompt.dismiss())</code> which terminates this saving request, or confirm it via <code>return GeckoResult.fromValue(prompt.confirm(login))</code> where <code>login </code> either holds the credentials originally provided by the prompt request (<code> prompt.logins[0]</code>) or a new or modified login entry. <p>The login entry returned in a confirmed save prompt is used to request for saving in the runtime delegate via <code>StorageDelegate.onLoginSave(login)</code>. If the app has already stored the entry during the prompt request handling, it may ignore this storage saving request. <br> @see GeckoRuntime#setAutocompleteStorageDelegate <br> @see GeckoSession#setPromptDelegate <br> @see GeckoSession.PromptDelegate#onLoginSave <br> @see GeckoSession.PromptDelegate#onLoginSelect 48696
Autofill.java Hint indicating that no special handling is required. 36454
Base64Utils.java This class exposes the Base64 URL encode/decode functions from Gecko. They are different from android.util.Base64 in that they always use URL encoding, no padding, and are constant time. The last bit is important when dealing with values that might be secret as we do with Web Push. 766
BasicSelectionActionDelegate.java Class that implements a basic SelectionActionDelegate. This class is used by GeckoView by default if the consumer does not explicitly set a SelectionActionDelegate. <p>To provide custom actions, extend this class and override the following methods, <p>1) Override {@link #getAllActions} to include custom action IDs in the returned array. This array must include all actions, available or not, and must not change over the class lifetime. <p>2) Override {@link #isActionAvailable} to return whether a custom action is currently available. <p>3) Override {@link #prepareAction} to set custom title and/or icon for a custom action. <p>4) Override {@link #performAction} to perform a custom action when used. 22275
CallbackResult.java package 560
CompositorController.java package 3558
ContentBlocking.java Content Blocking API to hold and control anti-tracking, cookie and Safe Browsing settings. 71560
ContentBlockingController.java ContentBlockingController is used to manage and modify the content blocking exception list. This list is shared across all sessions. 8655
ContentInputStream.java This class provides an {@link OutputStream} wrapper for a Gecko nsIOutputStream (or really, nsIRequest). 5770
CrashHandler.java Get the root exception from the 'cause' chain of an exception. @param exc An exception @return The root exception 18297
CrashReporter.java Sends a crash report to the Mozilla <a href="https://wiki.mozilla.org/Socorro">Socorro</a> crash report server. 15237
DeprecationSchedule.java Additional metadata about a deprecation notice. 1331
doc-files
ExperimentDelegate.java This delegate is used to pass experiment information between the embedding application and GeckoView. <p>An experiment is used to give users different application behavior in order to learn and improve upon what features users prefer the most. This is accomplished by providing users different application experiences and collecting data about how the differing experiences impacted user behavior. 7347
GeckoDisplay.java Applications use a GeckoDisplay instance to provide {@link GeckoSession} with a {@link Surface} for displaying content. To ensure drawing only happens on a valid {@link Surface}, {@link GeckoSession} will only use the provided {@link Surface} after {@link #surfaceChanged(SurfaceInfo)} is called and before {@link #surfaceDestroyed()} returns. 18408
GeckoEditable.java GeckoEditable implements only some functions of Editable The field mText contains the actual underlying SpannableStringBuilder/Editable that contains our text. 96159
GeckoFontScaleListener.java A class that automatically adjusts font size settings for web content in Gecko in accordance with the device's OS font scale setting. @see android.provider.Settings.System#FONT_SCALE 5109
GeckoInputConnection.java package 30356
GeckoInputStream.java This class provides an {@link InputStream} wrapper for a Gecko nsIChannel (or really, nsIRequest). 5873
GeckoResult.java 38422
GeckoRuntime.java Intent action sent to the crash handler when a crash is encountered. @see GeckoRuntimeSettings.Builder#crashHandler(Class) 38059
GeckoRuntimeSettings.java Settings builder used to construct the settings object. 60487
GeckoSession.java 298225
GeckoSessionHandler.java package 3086
GeckoSessionSettings.java Settings builder used to construct the settings object. 23280
GeckoView.java 41209
GeckoViewInputStream.java This class provides a Gecko nsIInputStream wrapper for a Java {@link InputStream}. 4174
GeckoViewPrintDocumentAdapter.java Default GeckoView PrintDocumentAdapter to be used with a PrintManager to print documents using the default Android print functionality. Will make a temporary PDF file from InputStream. @param pdfInputStream an input stream containing a PDF @param context context that should be used for making a temporary file 8455
GeckoVRManager.java Interface for registering the external VR context with WebVR. The context must be registered before Gecko is started. This API is not intended for external consumption. To see an example of how it is used please see the <a href="https://github.com/MozillaReality/FirefoxReality" target="_blank">Firefox Reality browser</a>. @see <a href="https://searchfox.org/mozilla-central/source/gfx/vr/external_api/moz_external_vr.h" target="_blank">External VR Context</a> 1561
GeckoWebExecutor.java GeckoWebExecutor is responsible for fetching a {@link WebRequest} and delivering a {@link WebResponse} to the caller via {@link #fetch(WebRequest)}. Example: <pre> final GeckoWebExecutor executor = new GeckoWebExecutor(); final GeckoResult&lt;WebResponse&gt; result = executor.fetch( new WebRequest.Builder("https://example.org/json") .header("Accept", "application/json") .build()); result.then(response -&gt; { // Do something with response }); </pre> 6946
Image.java Represents an Web API image resource as used in web app manifests and media session metadata. 1943
MediaSession.java The MediaSession API provides media controls and events for a GeckoSession. This includes support for the DOM Media Session API and regular HTML media content. @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaSession">Media Session API</a> 22072
OrientationController.java Sets the {@link OrientationDelegate} for this instance. @param delegate The {@link OrientationDelegate} instance. 1821
OverscrollEdgeEffect.java package 7032
package-info.java This package contains the public interfaces for the library. <ul> <li>{@link org.mozilla.geckoview.GeckoRuntime} is the entry point for starting and initializing Gecko. You can use this to preload Gecko before you need to load a page or to configure features such as crash reporting. <li>{@link org.mozilla.geckoview.GeckoSession} is where most interesting work happens, such as loading pages. It relies on {@link org.mozilla.geckoview.GeckoRuntime} to talk to Gecko. <li>{@link org.mozilla.geckoview.GeckoView} is the embeddable {@link android.view.View}. This is the most common way of getting a {@link org.mozilla.geckoview.GeckoSession} onto the screen. </ul> <p><strong>Permissions</strong> <p>This library does not request any dangerous permissions in the manifest, though it's possible that some web features may require them. For instance, WebRTC video calls would need the {@link android.Manifest.permission#CAMERA} and {@link android.Manifest.permission#RECORD_AUDIO} permissions. Declaring these are at the application's discretion. If you want full web functionality, the following permissions should be declared: <ul> <li>{@link android.Manifest.permission#ACCESS_COARSE_LOCATION} <li>{@link android.Manifest.permission#ACCESS_FINE_LOCATION} <li>{@link android.Manifest.permission#READ_EXTERNAL_STORAGE} <li>{@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} <li>{@link android.Manifest.permission#CAMERA} <li>{@link android.Manifest.permission#RECORD_AUDIO} </ul> For a detailed change log of the API see: <a href="./doc-files/CHANGELOG" target="_blank">CHANGELOG</a>. 2060
PanZoomController.java Specifies smooth scrolling which animates content to the desired scroll position. 33982
ParcelableUtils.java 617
ProfilerController.java ProfilerController is used to manage GeckoProfiler related features. <p>If you want to add a profiler marker to mark a point in time (without a duration) you can directly use <code>profilerController.addMarker("marker name")</code>. Or if you want to provide more information, you can use <code> profilerController.addMarker("marker name", "extra information")</code> If you want to add a profiler marker with a duration (with start and end time) you can use it like this: <code> Double startTime = profilerController.getProfilerTime(); ...some code you want to measure... profilerController.addMarker("name", startTime); </code> Or you can capture start and end time in somewhere, then add the marker in somewhere else: <code> Double startTime = profilerController.getProfilerTime(); ...some code you want to measure (or end time can be collected in a callback)... Double endTime = profilerController.getProfilerTime(); ...somewhere else in the codebase... profilerController.addMarker("name", startTime, endTime); </code> Here's an <code>addMarker</code> example with all the possible parameters: <code> Double startTime = profilerController.getProfilerTime(); ...some code you want to measure... Double endTime = profilerController.getProfilerTime(); ...somewhere else in the codebase... profilerController.addMarker("name", startTime, endTime, "extra information"); </code> <code>isProfilerActive</code> method is handy when you want to get more information to add inside the marker, but you think it's going to be computationally heavy (and useless) when profiler is not running: <pre> <code> Double startTime = profilerController.getProfilerTime(); ...some code you want to measure... if (profilerController.isProfilerActive()) { String info = aFunctionYouDoNotWantToCallWhenProfilerIsNotActive(); profilerController.addMarker("name", startTime, info); } </code> </pre> FIXME(bug 1618560): Currently only works in the main thread. 8114
PromptController.java package 27625
RuntimeSettings.java Base class for (nested) runtime settings. <p>Handles pref-based settings. Please extend this class when adding nested settings for GeckoRuntimeSettings. 9310
RuntimeTelemetry.java The telemetry API gives access to telemetry data of the Gecko runtime. 5038
ScreenLength.java ScreenLength is a class that represents a length on the screen using different units. The default unit is a pixel. However lengths may be also represented by a dimension of the visual viewport or of the full scroll size of the root document. 5448
SessionAccessibility.java 32661
SessionFinder.java {@code SessionFinder} instances returned by {@link GeckoSession#getFinder()} performs find-in-page operations. 4619
SessionPdfFileSaver.java {@code PdfFileSaver} instances returned by {@link GeckoSession#getPdfFileSaver()} performs save operation. 3698
SessionTextInput.java {@code SessionTextInput} handles text input for {@code GeckoSession} through key events or input methods. It is typically used to implement certain methods in {@link android.view.View} such as {@link android.view.View#onCreateInputConnection}, by forwarding such calls to corresponding methods in {@code SessionTextInput}. <p>For full functionality, {@code SessionTextInput} requires a {@link android.view.View} to be set first through {@link #setView}. When a {@link android.view.View} is not set or set to null, {@code SessionTextInput} will operate in a reduced functionality mode. See {@link #onCreateInputConnection} and methods in {@link GeckoSession.TextInputDelegate} for changes in behavior in this viewless mode. 16373
SlowScriptResponse.java Used by a ContentDelegate to indicate what action to take on a slow script event. @see GeckoSession.ContentDelegate#onSlowScript(GeckoSession,String) 619
StorageController.java Manage runtime storage data. <p>Retrieve an instance via {@link GeckoRuntime#getStorageController}. 16456
TranslationsController.java The translations controller coordinates the session and runtime messaging between GeckoView and the translations toolkit. 50263
WebAuthnTokenManager.java package 27201
WebExtension.java Represents a WebExtension that may be used by GeckoView. 106501
WebExtensionController.java This event is fired every time a new extension object is created by the store. @param extension the newly-created extension object 68136
WebMessage.java This is an abstract base class for HTTP request and response types. 4062
WebNotification.java This class represents a single <a href="https://developer.mozilla.org/en-US/docs/Web/API/Notification">Web Notification</a>. These can be received by connecting a {@link WebNotificationDelegate} to {@link GeckoRuntime} via {@link GeckoRuntime#setWebNotificationDelegate(WebNotificationDelegate)}. 7971
WebNotificationDelegate.java This is called when a new notification is created. @param notification The WebNotification received. 887
WebPushController.java package 5246
WebPushDelegate.java Creates a push subscription for the given service worker scope. A scope uniquely identifies a service worker. `appServerKey` optionally creates a restricted subscription. <p>Applications will likely want to persist the returned {@link WebPushSubscription} in order to support {@link #onGetSubscription(String)}. @param scope The Service Worker scope. @param appServerKey An optional application server key. @return A {@link GeckoResult} which resolves to a {@link WebPushSubscription} @see <a href="http://w3c.github.io/push-api/#dom-pushmanager-subscribe">subscribe()</a> @see <a href="http://w3c.github.io/push-api/#dom-pushsubscriptionoptionsinit-applicationserverkey">Application server key</a> 2485
WebPushSubscription.java This class represents a single Web Push subscription, as described in the <a href="https://www.w3.org/TR/push-api/">Web Push API</a> specification. <p>This is a low-level interface, allowing applications to do all of the heavy lifting themselves. It is recommended that consumers have a thorough understanding of the Web Push API, especially <a href="https://tools.ietf.org/html/rfc8291">RFC 8291</a>. <p>Only trivial sanity checks are performed on the values held here. The application must ensure it is generating compliant keys/secrets itself. 6358
WebRequest.java WebRequest represents an HTTP[S] request. The typical pattern is to create instances of this class via {@link WebRequest.Builder}, and fetch responses via {@link GeckoWebExecutor#fetch(WebRequest)}. 7695
WebRequestError.java WebRequestError is simply a container for error codes and categories used by {@link GeckoSession.NavigationDelegate#onLoadError(GeckoSession, String, WebRequestError)}. 12902
WebResponse.java WebResponse represents an HTTP[S] response. It is normally created by {@link GeckoWebExecutor#fetch(WebRequest)}. 7817