MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Feature] [Extensions]: Native/Extension communication
@Lakshmisha-KS is already working on this.
Since Feb 12, 2025.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Describe the feature/enhancement you need
To allow any UI interaction with the extensions in our app, or to shim (modify) some of the chrome extension APIs, we first had to establish a way to communicate between our app and the extension. The currently selected method is to:
- attach a chrome devtools session to the extension through "
Target.attachToTarget" - for extension-to-app communication, "
Runtime.bindingCalled" is called to create a method on the extension JS side, calling which will invoke the "Runtime.bindingCalled" event on app side - for app-to-extension communication, we have multiple approaches, e.g. directly calling JS code from app through "
Runtime.evaluate"
However, it would significantly ease any interop work if WebView2 provided same message exchange API for extensions as it does for webpages (https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/communicate-btwn-web-native)
The scenario/use case where you would use this feature
As we're building a browser with intention to host extensions, some amount of app-to-extension communication needs to happen as we need to re-implement some of the chrome extension APIs, e.g. chrome.tabs.query
How important is this request to you?
Nice to have. There are other ways to tackle this, but having official API support would be beneficial.
Suggested implementation
No response
What does your app do? Is there a pending deadline for this request?
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.