airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
200 stars 11 forks source link

Linux StageWebview not working #1833

Open myflashlab opened 2 years ago

myflashlab commented 2 years ago

My first tries to package my software for Linux. haven't checked the whole software functionality yet but trying to init StageWebview fails with the following error in Linux. Same code works correctly on Mac and Windows obviously.

Error #1001: The method StageWebView is not implemented.
at flash.media::StageWebView/init()
at flash.media::StageWebView()

My environment:

OS: Ubuntu 20.04.4 LTS
AIR: 33.1.1.795
myflashlab commented 2 years ago

@ajwfrost The other Linux problems, we can live with them but the StageWebView problem is a show stopper! Because without that, there will be no OAuth2 validation which means user cannot do anything with the software :) I wonder if you have a similar issue on your environments? Please let me know how I may be able to help to take this issue forward. Thanks.

ajwfrost commented 2 years ago

Hi @myflashlab - the issue with this is that Linux doesn't really have a 'web view' component like you can get on macOS and on Windows.. so there would need to be some sort of integration with a third party component. Choosing the third party component is then a bit of a minefield and there may be license restrictions on whatever is chosen..

Our approach was going to be to expose some mechanisms that would enable the integration between different apps i.e. where you could have AIR display some user interface elements from a different library or even process. We had this working for a customer a while ago where they were using Wayland and had developed some extensions to allow texture sharing between applications: we got surface updates from another application and just used EGLImage to display these within the AIR rendering pipeline. So, a similar approach can be created that would allow a third party application to be controlled and displayed from within an AIR application.

This could then split things up enough so that a CEF-based or WebKit-based application could be created that AIR then loaded and used as a native StageWebView implementation, with this separate application/process being outside of the "Adobe source code" licensing restrictions i.e. anyone could do it..

myflashlab commented 2 years ago

Thanks for your reply. While I can't say I fully understood what you explained. But how soon do you think we can have something to test?

Something that I experienced with Mac and Win is that using the built-in webview does not really work with OAuth2 for whatever reason. However, passing true when initializing new StageWebView(true) for Mac and then using WebView2 tag in manifest for Windows solved the problem.

So, I guess, an externally loaded WebKit might be a good solution for Linux as well.

myflashlab commented 2 years ago

Wondering if this is something that you have in your plans to support? If yes, Near future? Or far future? @ajwfrost

ajwfrost commented 2 years ago

This sort of extensibility is something I'd hope we could release before the end of this year, it's not on the immediate list but is something I think will help in a number of areas so I would tentatively say it's 4-5 months away..?

thanks

myflashlab commented 2 years ago

5 month is good. look forward to it. Thanks :)

myflashlab commented 2 years ago

A little update for anyone who might find this:

To remove the blocker in our project, and make OAuth2 happen in linux without using StageWebView, we did this:

  1. Created a web server and client sockets using flash.net.ServerSocket so our AIR app can communicate with http://localhost:8080
  2. Created a custom redirectURL in the Google OAuth2 settings. Previously we had used a desktop client but now we had to switch to a web client to be able to modify the redirectURL.
  3. Used flash.desktop.NativeProcess to open default browser in Linux using this commandLine xdg-open "$1" and passed the OAuth2 request with it.

Now when Google Authentication completes, it will be redirected to my custom url http://localhost:8080/oauth2.html and using the server/client sockets I am reading the returned Google code in the address URL.

And using that code, I request for the refreshAccessToken and the accessToken itself.

What a challenge :) but it was better to wait 5 months for the StageWebView to arrive to Linux. However, it will be very nice to have StageWebView as it will reduce complexity big time.