Edge WebView2: add possibility to create app modules for apps hosting WebView2 interface#16717
Conversation
…hosting WebView2 runtime to display ther interfaces. Re nvaccess#16705. Similar approach to javaw.py: look up the parent process for WebView2 app and return the parent process name for use by NVDA when loading app modules for apps hosting WebView2 runtime.
…is loaded. Re nvaccess#16705. Using module-level __getattr__, load the default app module class if no custom app module is found.
WalkthroughThe changes introduce support for applications using the Microsoft Edge WebView2 runtime interface by allowing NVDA to create app modules for such apps. These modifications include mechanisms to handle the Edge WebView2 runtime, such as identifying parent processes and handling specific features in NVDA's app module interface. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NVDA
participant App
participant WebView2
User->>App: Open App
App->>NVDA: Notification of Interface
NVDA->>WebView2: Identify WebView2 Runtime
WebView2-->>NVDA: Provide Interface Data
NVDA->>NVDA: Load Corresponding App Module
NVDA-->>User: Provide Interaction Interface
Assessment against linked issues
Recent review detailsConfiguration used: .coderabbit.yml Files selected for processing (1)
Additional context usedPath-based instructions (1)
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
Outside diff range and nitpick comments (1)
source/appModules/msedgewebview2.py (1)
13-20: Ensure proper error handling for undefined parent process ID.Consider adding a comment explaining the use of the walrus operator (
:=) for clarity, especially for developers unfamiliar with this newer Python syntax.
| * You can use `scheduleThread.scheduleDailyJobAtStartUp` to automatically schedule a job that happens after NVDA starts, and every 24 hours after that. | ||
| Jobs are scheduled with a delay to avoid conflicts. | ||
| * `scheduleThread.scheduleDailyJob` and `scheduleJob` can be used to schedule jobs at custom times, where a `JobClashError` will be raised on a known job scheduling clash. | ||
| * It is now possible to create app modules for apps hosting Edge WebView2 (msedgewebview2.exe) controls. (#16705, @josephsl) |
There was a problem hiding this comment.
Consider enhancing the clarity and detail of this entry.
- * It is now possible to create app modules for apps hosting Edge WebView2 (msedgewebview2.exe) controls. (#16705, @josephsl)
+ * NVDA now supports the creation of app modules specifically for applications utilizing the Edge WebView2 interface (msedgewebview2.exe). This enhancement facilitates better integration with such applications, enabling custom command sets and improved navigation. Refer to issue #16705 and PR contributor @josephsl for more details.This change provides more context and emphasizes the impact of the new feature, aligning with the detailed style of documentation.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * It is now possible to create app modules for apps hosting Edge WebView2 (msedgewebview2.exe) controls. (#16705, @josephsl) | |
| * NVDA now supports the creation of app modules specifically for applications utilizing the Edge WebView2 interface (msedgewebview2.exe). This enhancement facilitates better integration with such applications, enabling custom command sets and improved navigation. Refer to issue #16705 and PR contributor @josephsl for more details. |
There was a problem hiding this comment.
Almost - perhaps use only the first sentence as per other changes.md entries (remember to put the issue number and GitHub username mentions for third-party contributors).
There was a problem hiding this comment.
@josephsl, based on your feedback, here's the revised entry for the changes.md document:
- * It is now possible to create app modules for apps hosting Edge WebView2 (msedgewebview2.exe) controls. (#16705, @josephsl)
+ * NVDA now supports creating app modules for applications using the Edge WebView2 interface (msedgewebview2.exe). (#16705, @josephsl)This version maintains conciseness and aligns with the style of other entries. Please let me know if this meets your expectations or if further adjustments are needed.
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
|
@coderabbitai, read my initial comment again as the walkthrough is not equal to what I actually wrote. For reference, it does opposite to what you think the PR is doing. |
|
@coderabbitai summarize the pull request based on my latest comment about the walkthrough |
|
I think I'm missing how this appModule ought to be used. May be add an example first, e.g. for Outlook? |
|
Hi, for Outlook and other apps embedding WebView2, one would create app modules just like other apps as is done for apps powered by say, wwahost and javaw. Thanks.
|
|
Hi, One more thing I should have done: add notes about msedgewebview2.exe in dev guide - I'll take care of this soon. Thanks. |
…vaccess#16705. Note from Leonard de Ruijter: give an example of an app hosting WebView2 runtime. For this one, a third app module example is defined to showcase WebView2 and disabling browse mode by default (example: olk.exe for new Outlook).
|
@coderabbitai review |
Link to issue number:
Closes #16705
Summary of the issue:
Apps hosting Edge WebView2 show up as websites. However, in apps such as new Outlook (olk.exe), it is desirable to disable browse mode by default or offer custom commands and workarounds.
Description of user facing changes
NVDA will recognize and work with app modules for apps hosting Edge WebView2 controls such as new Outlook.
Description of development approach
Similar to wwahost and javaw, a new host app module (msedgewebview2) is created to fetch actual names of aps hosting the webview controls. The module borrows heavily from javaw app module except it is limited to fetching parent process information. Instead of importing appModuleHandler.AppModule, module-level getattr is defined to return the default app module.
Testing strategy:
Manual testing:
Known issues with pull request:
None
Code Review Checklist:
Summary by CodeRabbit
New Features
Documentation
Thanks.