flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

Any chances flutter_inappwebview supports for Flutter Web in the future ?

Open jpsarda opened this issue 3 years ago • 4 comments

I'm aware that this is not an easy task, because this package is based in the native WKWebview on iOS and WebView on android, but would it be possible to implement web support for this package ? After all it's a web view and it would run on a web platform that already has a web engine. Maybe that could be implemented as an iframe, I'm not sure. I didn't find any discussion on this in the issues, sorry if I didn't search correctly.

jpsarda avatar Jul 05 '22 19:07 jpsarda

👋 @jpsarda

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

github-actions[bot] avatar Jul 05 '22 19:07 github-actions[bot]

Hi @jpsarda, the next version 6.0.0 will have support for Flutter Web. Actually, the "develop" branch of the repository is an unpublished "beta" version that already supports it: https://github.com/pichillilorenzo/flutter_inappwebview/tree/develop However, more work is needed before it can be published.

pichillilorenzo avatar Jul 06 '22 13:07 pichillilorenzo

Wow, I didn't expect that, that's great news. May I ask how are you doing this, using iframes maybe ? I'm also curious about the local web server, that doesn't seem to be possible in javascript, did you find a solution or a workaround for this ?

On my app, I download html and images and I render them offline in the inappwebview using the local web server (because people use the app in locations with poor or no internet, so we ask them to download things before going there). Would it be possible to do something similar when the package supports the web ?

jpsarda avatar Jul 06 '22 15:07 jpsarda

It uses iframes because it's the only way to do something similar to a WebView. However, the iframe has a lot of limitations! In fact, a lot of features simply cannot be implemented or it has very limited support (Cross-origin issues). The local web server feature cannot be implemented on Flutter Web (you are on a Browser and not on an Operating System). Currently on the "dev" branch, to check if a method, a class, or a feature of the plugin is supported by a specific Flutter platform, you can check the docs of the code directly.

pichillilorenzo avatar Jul 07 '22 08:07 pichillilorenzo

@pichillilorenzo is window.flutter_inappwebview.callHandler('channel', message); possible to listen from the flutter web? I'm using the develop branch. Thanks!

yadaniyil avatar Sep 19 '22 18:09 yadaniyil

@jpsarda New version 6 with web support is out right now!

pichillilorenzo avatar Oct 14 '22 07:10 pichillilorenzo

@pichillilorenzo I tried using the beta version 6 of the InAppWebView, it worked on the Android phone, but it didn't work on the web. I am using Linux. So, will it work on Linux or on Windows?

That's what I get:-

Waiting for connection from debug service on Chrome...
This app is linked to the debug service: ws://127.0.0.1:40275/KFdpLOiSTqk=/ws
Debug service listening on ws://127.0.0.1:40275/KFdpLOiSTqk=/ws
Debug service listening on ws://127.0.0.1:40275/KFdpLOiSTqk=/ws
The platformViewRegistry getter is deprecated and will be removed in a future release. Please import it from `dart:ui_web` instead.
TypeError: Cannot set properties of undefined (setting 'nativeCommunication')

Cypher103360 avatar Nov 07 '23 04:11 Cypher103360