Skip to content

Web extension native messaging from content script is broken #220

Open
@sinking-point

Description

@sinking-point

I'm using GeckoView to build a web browser. I'm using a built in extension to interact with web content. I want to use native messaging for communication between the browser and the extension.

let response = await chrome.runtime.sendNativeMessage("browser", { type: "getSquenoAccessToken" });

This works as expected in the background script, and my MessageDelegate's onMessage function runs. However, the same code in the content script never resolves and the onMessage function is never called.

I have the following permissions in the manifest as per the docs:

"nativeMessaging",
"nativeMessagingFromContent",
"geckoViewAddons",

The docs suggest I should be able to do native messaging from the content script, so I'm pretty confident this is a bug in GeckoView.

I'm using version 113.0.20230504192738

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions