mozilla/geckoview

How to load a remote extension in geckoview?

baseplate-admin opened this issue · 0 comments

Hi, i have this following kotlin code

  sRuntime.getWebExtensionController().ensureBuiltIn(
            EXTENSION_LOCATION,
            "uBlock0@raymondhill.net"
        ).accept(
            { extension ->
                // Use Log to print information about the installed extension
                Log.i("MessageDelegate", "Extension installed: " + extension)
            },
            { e ->
                // Handle error if registering the WebExtension fails
                Log.e("MessageDelegate", "Error registering WebExtension", e)
            }
        )

and this location.

But this doesn't register and the log has some weird things in it:

E/GeckoConsole( 5168): _g
I/GeckoConsole( 5168): 1716030203919    addons.webextension.uBlock0@raymondhill.net     WARN    Loading extension 'uBlock0@raymondhill.net': Reading manifest: Warning processing permissions: Error processing permissions.2: Value "menus" must either: must either [must either [must either [be one of ["idle"], be one of ["activeTab"], be one of ["cookies"], be one of ["scripting"], or be one of ["webRequest", "webRequestAuthProvider", "webRequestBlocking", "webRequestFilterResponse", "webRequestFilterResponse.serviceWorkerScript"]], must either [be one of ["mozillaAddons"], be one of ["geckoViewAddons", "nativeMessagingFromContent"], be one of ["activityLog"], be one of ["networkStatus"], or be one of ["telemetry"]], be one of ["alarms", "storage", "unlimitedStorage"], be one of ["contextualIdentities"], be one of ["declarativeNetRequestWithHostAccess"], be one of ["dns"], or be one of ["theme"]], must either [must either [be one of ["idle"], be one of ["activeTab"], be one of ["cookies"], be one of ["scripting"], or be one of ["webRequest", "
I/GeckoConsole( 5168): 1716030203920    addons.webextension.uBlock0@raymondhill.net     WARN    Loading extension 'uBlock0@raymondhill.net': Reading manifest: Warning processing commands: An unexpected property was found in the WebExtension manifest.
E/MessageDelegate( 5168): Error registering WebExtension
E/MessageDelegate( 5168): java.lang.Exception: Unexpected error: Error: Extension is invalid
E/MessageDelegate( 5168):       at org.mozilla.geckoview.WebExtensionController$$ExternalSyntheticLambda15.onException(Unknown Source:0)
E/MessageDelegate( 5168):       at org.mozilla.geckoview.GeckoResult.lambda$map$1(GeckoResult.java:419)
E/MessageDelegate( 5168):       at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda9.onException(Unknown Source:2)
E/MessageDelegate( 5168):       at org.mozilla.geckoview.GeckoResult.lambda$thenInternal$6(GeckoResult.java:593)
E/MessageDelegate( 5168):       at org.mozilla.geckoview.GeckoResult.$r8$lambda$nsAzyhhKgAo0Ha3SEAUSdsKADo8(Unknown Source:0)
E/MessageDelegate( 5168):       at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda5.run(Unknown Source:8)
E/MessageDelegate( 5168):       at org.mozilla.geckoview.GeckoResult.lambda$dispatchLocked$7(GeckoResult.java:792)
E/MessageDelegate( 5168):       at org.mozilla.geckoview.GeckoResult$$ExternalSyntheticLambda1.run(Unknown Source:2)
E/MessageDelegate( 5168):       at android.os.Handler.handleCallback(Handler.java:958)
E/MessageDelegate( 5168):       at android.os.Handler.dispatchMessage(Handler.java:99)
E/MessageDelegate( 5168):       at android.os.Looper.loopOnce(Looper.java:205)
E/MessageDelegate( 5168):       at android.os.Looper.loop(Looper.java:294)
E/MessageDelegate( 5168):       at android.app.ActivityThread.main(ActivityThread.java:8177)
E/MessageDelegate( 5168):       at java.lang.reflect.Method.invoke(Native Method)
E/MessageDelegate( 5168):       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/MessageDelegate( 5168):       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:97

Is there any way i can load extensions such as ublock Origin into my android GeckoView?

thanks a lot in advance