Skip to content
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 Flutter Desktop #460

Open
d0mmi opened this issue Jul 20, 2020 · 71 comments
Open

Support for Flutter Desktop #460

d0mmi opened this issue Jul 20, 2020 · 71 comments
Labels
enhancement New feature or request

Comments

@d0mmi
Copy link

d0mmi commented Jul 20, 2020

Environment

Flutter version: newest
Plugin version: newest
Android version: -
iOS version: -
Xcode version: -
Device information: Windows / Linux / MacOS Desktop

Description

What you'd like to happen: I would like to have this to be compatible with the Flutter Desktop version. Most important for me would be the Flutter Desktop for Windows.

@pichillilorenzo pichillilorenzo added the enhancement New feature or request label Jul 27, 2020
@nmcain
Copy link

nmcain commented Jul 28, 2020

I would love this too, is it possible?

@nmcain
Copy link

nmcain commented Jul 28, 2020

I dont even know where to begin, what language would you use on Linux?

@pichillilorenzo
Copy link
Owner

For macOS, it should be easy, as WKWebView is the same as iOS.
For Linux, I think we can use something like this: https://webkitgtk.org/.
For Windows, we can use Microsoft Edge WebView2 (https://docs.microsoft.com/en-us/microsoft-edge/webview2/).

@breebee
Copy link

breebee commented Dec 11, 2020

Hey guys whats the progress here with desktop targets? Where can I follow the progress, if there isnt much work left to do I want to hire someone to finish the job.

@CodeDoctorDE
Copy link

I need it too :)

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Feb 23, 2021

To follow Flutter PlatformView API availability for Desktop, see:

The only thing I can do now, probably, is to implement only the InAppBrowser class (so, no Flutter widget integrated to the flutter widgets tree at the moment!) for these platforms.
For Linux and Windows platforms, it is also more difficult because I need to write native C++ code, so probably it will take more time (especially because I have zero experience with C++).

@devilAPI
Copy link

please implement this, that would be great

@pichillilorenzo
Copy link
Owner

I think that MacOS will be the first platform to be supported because it should be the easiest one, using the same code of iOS

@ghost
Copy link

ghost commented Mar 8, 2021

It'd be great to support macos & windows.

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Apr 15, 2021

Here is an update:

Starting from plugin version 5.4.0, there will be a lot of deprecation that will help me to initialize the work for Desktop Support. It means that every event/class/method/property/etc. that starts with the "android" or "ios" keyword will be renamed without that keyword unless for specific reasons.

For example, events such as androidShouldInterceptRequest and iosOnNavigationResponse will be renamed to shouldInterceptRequest and onNavigationResponse (or something like this). So, androidShouldInterceptRequest, iosOnNavigationResponse, etc... will not be deleted, just deprecated respect to the new counterpart.
It doesn't mean that the particular event/class/method/property/etc. will be supported by all platforms. The list of platforms supported of an API will be documented on the specific Docs of it.

Also, consider to support this project making a donation: https://inappwebview.dev/donate/

@acx70
Copy link

acx70 commented May 4, 2021

I look forward for some news too ... (good job by the way)

@CaptainDario
Copy link

CaptainDario commented May 17, 2021

This plugin is absolutely amazing!
I would love to port my app which uses WebView to desktop.
@pichillilorenzo Therefore I am curious if desktop support can only be achieved once the flutter team adds PlatformView support to flutter on MacOS, Windows and Linux? All of them are tagged with "P4" and will sadly take a long time to be implemented...

@CaptainDario
Copy link

CaptainDario commented Jun 12, 2021

While researching about WebView and desktop platforms in Flutter I found a package which makes a WebView available for windows.
@pichillilorenzo Maybe this can be used for this package on windows?

@epvbergen
Copy link

epvbergen commented Mar 29, 2022

The desktop_webview plugin supports all 3 desktop platforms. Can that effort help inapp_webview?

It would be fine for inapp_webview to initially offer limited support only and open a separate window on desktop platforms. But it would be great if Flutter applications would only need one API, not two (inapp_webview on mobile and desktop_webview_window on desktop). One of the biggest pluses of Flutter is that it allows a single code base that works everywhere and offers good performance and good native bindings.

I'd rather use a desktop capable inapp_webview, as that produces support for SFSafariViewController on iOS. desktop_webview only does WKWebview, which is a bit of a second class citizen in the kingdom of Apple. uche WebRTC uche.

@marco-1988
Copy link

Hello

Is there any news about a plugin update with Linux platform support?

I can't find any webview plugins that work on Linux. I had read that from version 5.4.0 some actions would be initiated that would lead to a start of support towards the desktop.

Do you know anything about it? A roadmap of when it will also be supported by Linux? Around I find plugins that work for Windows, for macOS, for the web, except for Linux, which the only one is dekstop_webview_window but it's not good because it opens in a new window and I need it integrated into the app.

Thanks

@liaoxuewei
Copy link

It'd be great to support macos & windows.

Yeah, I think so. This will take flutter to the next level.

@CaptainDario
Copy link

@pichillilorenzo recently I found the webview_cef package. Maybe until platform views are ready this could be a great alternative?

@pichillilorenzo
Copy link
Owner

@CaptainDario I'm currently working on the macOS implementation (without platform views but using a separate Window such as the plugin you mentioned).
It should be available with 6.0.0-beta.3 soon.

@CaptainDario
Copy link

CaptainDario commented Oct 16, 2022

The desktop_webview plugin supports all 3 desktop platforms. Can that effort help inapp_webview?

I guess you mean this package that opens a separate window.
But the plugin I mentioned does not open a separate window (if i am not mistaken), it uses chromium embedded framework to render as a normal flutter widget.

@pichillilorenzo
Copy link
Owner

Ah wow, I didn't notice it. Also, just checked platform view support for macOS and it seems it is already available in a certain way. I will try it

@CaptainDario
Copy link

Ah wow, I didn't notice it. Also, just checked platform view support for macOS and it seems it is already available in a certain way. I will try it

Windows also already has some progress on the platform view problem.

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Oct 19, 2022

Version 6.0.0-beta.3 with MacOS support is released now!

Unfortunately, I tried the current platform view implementation for MacOS but it still not working, so we need to wait for the Flutter team to fix it.

The current MacOS WebView implementations are the InAppBrowser and HeadlessWebView classes!
Check Setup MacOS

ps9310 pushed a commit to mayank4741/flutter_inappwebview that referenced this issue Feb 24, 2024
Klim-Karma added a commit to Shoptagr/flutter_inappwebview that referenced this issue Mar 19, 2024
* pichillilorenzo-master: (162 commits)
  added APPLINK_BLOCK to NavigationActionPolicy
  windows: removed not wanted debug log in in_app_webview.cpp
  initial windows implementation pichillilorenzo#460
  added InAppWebViewControllerKeepAliveProps constructor parameters default value
  fix pichillilorenzo#1981
  windows: added openDevTools, callDevToolsProtocolMethod, addDevToolsProtocolEventListener and removeDevToolsProtocolEventListener methods, added some more inappwebview and inappbrowser basic settings
  windows: completed CookieManager implementation, added WebViewEnvironment getAvailableVersion and compareBrowserVersions methods
  windows: updated webview environment docs, updated cookie manager to support webview environment
  windows: added WebViewEnvironment support for headlessinappwebview and inappbrowser
  windows: fixed some c++ include
  windows: fixed dealloc webviews logic, implemented takeScreenshot, added WebViewEnvironment and WebViewEnvironmentSettings classes
  windows: added headless inappwebview initial implementation
  windows: fixed javascript evaluation, added callAsyncJavaScript implementation, call DestroyWindow(parentWindow) on InAppWebView dealloc
  windows: fixed custom platform view context menu and window position
  windows: added content world support for user scripts and javascript evaluation
  windows: updated webview and browser creation params, added support for openWithSystemBrowser
  windows: completed initial javascript handler communication and user scripts support, added support for loadFile and loadData
  windows: implemented some other methods and events, initial implementation work for UserScripts and JavaScript handlers
  windows: added c++ nlohmann.json dependency, added getCopyBackForwardList implementation
  windows: added inappwebview widget support, added some other methods
  ...
@raymeskhoury
Copy link

Any further update on Windows? Anything I can help with?

@bryanjorgeflores
Copy link

Any update on this?

@OlegNovosad
Copy link

Any updates?

@PedroFerreiraBento
Copy link

Any updates about Windows support?

@DomingoMG
Copy link

Please avoid comments asking for updates.

We know that if there is no response, it means there is no new information. Instead, let's focus on how we can help meet current needs.

Nikoo00o added a commit to Nikoo00o/flutter_inappwebview that referenced this issue Aug 19, 2024
@pichillilorenzo
Copy link
Owner

With the next version 6.1.0 I'm going to release the initial Windows implementation.
In the meantime, thanks for the support.

@rchavik
Copy link

rchavik commented Sep 21, 2024

With the next version 6.1.0 I'm going to release the initial Windows implementation.
In the meantime, thanks for the support.

Macos now has webview support with flutter 3.24 iirc. Will this be included too?

@pichillilorenzo
Copy link
Owner

@rchavik My latest commit 2ff7e88 contains the code to support also the InAppWebView widget on MacOS 👍

@pichillilorenzo
Copy link
Owner

Released new version 6.1.0 with Windows initial support and MacOS InAppWebView support

@pichillilorenzo
Copy link
Owner

I will try to update the plugin website docs for Windows as soon as possible.

@pichillilorenzo
Copy link
Owner

Updated plugin docs:

@CaptainDario
Copy link

This is awesome!
I currently use your plugin in my app which works on all native platforms. Therefore, I am very keen to know if you plan to support Linux platforms soon.

@pichillilorenzo
Copy link
Owner

@CaptainDario Probably, for Linux platform, I would wait for the next major release.
That’s because I’m planning to rework the API (both dart and native code) in order to simplify the general development.

@CaptainDario
Copy link

I see. Thank you for the confirmation that this is still planned!

@TheLastFlame
Copy link

@pichillilorenzo, on my device it required running
nuget sources Add -Name nuget.org -Source https://api.nuget.org/v3/index.json
Might be worth adding this to the documentation

@augustresende
Copy link

augustresende commented Oct 22, 2024

@pichillilorenzo is there any way to customize the scroll behavior of the inapp webview when using on Windows? The scroll, by default, is scrolling large chunks of the page, i want more smoother like browser

Edit: Created issue #2364
Changing the value to 1 returns to smooth scrolling like browser

@pichillilorenzo
Copy link
Owner

Here is an update about Windows:

Unfortunately, the current Microsoft WebView2 doesn't have an API to really have a correct offscreen rendering inside a Flutter texture.

This is causing issues such as blur and focus events to be dispatched incorrectly (#2341).
Check more info on the issue I opened on the official Microsoft WebView2 repo: MicrosoftEdge/WebView2Feedback#4944

Also, GPU usage is impacted (#2387).

Until WebView2 has that API, I think there isn't much else to do about it (MicrosoftEdge/WebView2Feedback#20, MicrosoftEdge/WebView2Feedback#547).

Probably, for Windows, another possibility would be to support another implementation using the CEF Framework instead of WebView2, as it has an offscreen rendering API.
This would require to develop another plugin for Windows with that implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests