public static interface WebExtensionController.TabDelegate
|Modifier and Type||Method and Description|
Called when tabs.remove is invoked, this method decides if WebExtension can close the tab.
Called when tabs.create is invoked, this method returns a *newly-created* session that GeckoView will use to load the requested page on.
@UiThread @Nullable default GeckoResult<GeckoSession> onNewTab(@Nullable WebExtension source, @Nullable String uri)
source- An instance of
WebExtensionor null if extension was not registered with GeckoRuntime.registerWebextension
uri- The URI to be loaded. This is provided for informational purposes only, do not call
GeckoResultwhich holds the returned GeckoSession. May be null, in which case the request for a new tab by the extension will fail. The implementation of onNewTab is responsible for maintaining a reference to the returned object, to prevent it from being garbage collected.
@UiThread @NonNull default GeckoResult<AllowOrDeny> onCloseTab(@Nullable WebExtension source, @NonNull GeckoSession session)