@indranil I know you have no plans to support this, however upon testing, passing logs constantly from the WebView layer back to the UXP layer causes a few issues, one major one with Premiere being that it can interrupt the Modal state of any dialogs such as alert() which causes the entire app to freeze until relaunching.
I would instead think to setup a WebSocket server and pass the logs that way to not interrupt the postMessage() stream, however there’s no way to setup a WS server in UXP without a Hybrid Plugin function, and setting up a Hybrid Plugin function for a WS server just to save WebView logs seems like severe overkill.
Alternatively we could just store logs on the WebView side and then save them to disk when a user presses a “Save Logs” button, but in a lot of cases where errors cause a plugin to crash, there won’t be time for this operation, we would need to see every last log up until the plugin crashed.
Having standard logging for WebView is just going to be a pretty essential requirement for lots of complex UXP plugins.
Upon doing further research, it seems enabling logs in UXP would be as simple as passing a path argument to the Webview constructor for Windows:
(assuming UXP source is C++)
Webview2 on Windows with CreateCoreWebView2EnvironmentWithOptions()
If your team is able to review this, myself and the whole community would greatly appreciate it as more and more of us are migrating to UXP with WebView for more complex projects.
Happy to help your team in research or testing to get this feature implemented.
That looks to be a well-thought-out option @justin2taylor.
I hope it becomes a standard with UXP. My team’s project has started using WebView for some things, and since all our users are remote, having adequate logs makes support possible.
jsw
Hello @justin2taylor . Thank you for the detailed proposal. I am not committing to timelines, but we shall definitely take a look at this. I think it adds value to the UXP ecosystem.