-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for UI-less extensions #3258
Comments
@RendijsSmukulis Thanks for the post. We are tracking extension related feature request under #191. |
@novac42 , there's a big difference between extensions with UI support, and extensions without. Does it make sense to track both feature requests under one ticket? |
Related: #3259 |
@MarkIngramUK 191 is the overall post for extensions requests but I understand your point. I will add tracked label to generate a separate item in backlog for UI-less extensions specifically. |
Thanks @novac42 , I appreciate the consideration. |
As the Extensions API proposal is now published, as discussed previously we're happy to provide some background how we intend to use the feature. BackgroundWe are currently looking to migrate a subset of our Privacy Essentials Extension functionality to the our WebView2-based browser using the proposed WebView2 Extensions API. As the initial version of this API is understood to be "UI-less", that is, will not provide ways to surface UI elements to the user (such as the extension popup window or the extension's status icon on the address bar), we are looking for ways to host these elements in our application's native components. After the review of the proposed Extensions API, we have two high-level questions to judge the feasibility of what we're trying to achieve:
1. Extension-To-Native CommunicationsTo be able to host the extension's UI in a native control, separate from WebView2, the state of the extension needs to be communicated to the native code in some way. For example, when user modifies a setting in the native app, the setting change needs to be sent to the extension to modify its behaviour. Similarly, when some event happens in the extension (e.g. it has blocked a network request), this information needs to flow through the native code to be presented to the user. Similarly, the two-way communication is also required to fill in API gaps for concepts that exist outside a webview, such as "tabs" and "windows". For example, there is no way for WebView2 to correctly respond to the extensions query of "What tabs exist in the active window" if it has no concept of:
As no API is currently presented to convey these concepts from native app to webview2, a method of communicating between the extension and native code is required to create "polyfill" that can allow the app's native code side to respond to the queries (even if this requires changes to the extension's code to use the polyfill version rather than the "chrome.tabs", "chrome.window" or similar APIs) Apple is currently in the process of adding extension support to their WKWebView, and has published some interfaces that, implemented by the host app, allows to communicate the required information to the WebView:
2. What Extension APIs Will Be Supported?The second open question is what is the set of supported APIs for extensions in the initial release. It's clear that such apis as "chrome.tabs" and "chrome.windows" can't currently be supported, but it is not clear what other APIs might be expected to not be functional. We provide a list of APIs we currently rely on in Appendix A. Appendix AWhat APIs the Privacy Extension currently relies onNote: this list skips UI-specific apis, as the current iteration of WebView2 is not expected to support any UI elements for extensions. webRequest
webNavigation
declarativeNetRequestSame functionality as the webRequest API above, required for when MV2 is no longer supported runtime
tabs
scripting
storage
|
Our browser would benefit from support of webextensions in WebView2:
We realize that some APIs (such as "tabs") don't make sense in the context of WebView2, but since we would control both extension and native code we can make those work (as needed) ourselves. On the WebView2 side of things those could be noops.
Additional notes:
AB#43658387
The text was updated successfully, but these errors were encountered: