capacitor-community / proposals

Plugin and platform requests ✋
75 stars 2 forks source link

Capacitor Android GeckoView #183

Open Losses opened 2 years ago

Losses commented 2 years ago

Platform Request

Name: android-geckoview Package: @capacitor-community/android-geckoview

Description

We've successfully implemented an integration of ionic and Geckoview, and would like to contribute the source code to capacitor-community.

hurda21 commented 1 year ago

Would love this as a feature! We're trying to do something similar due to WebGL issues in Chromium.

Losses commented 1 year ago

Would love this as a feature! We're trying to do something similar due to WebGL issues in Chromium.

Try this: https://github.com/recative/recative-system/pkgs/npm/capacitor-geckoview

lincolnthree commented 10 months ago

Does anyone have any results to report back from using Gecko? Interested in if this is actually a viable option.

Losses commented 10 months ago

Does anyone have any results to report back from using Gecko? Interested in if this is actually a viable option.

We used to use it in production, it works well but needs a lot of tricks. If you want to try it, make sure to have enough time to fight with the system you are not familiar w/, good luck.

ewguo commented 10 months ago

Would you mind giving some examples or general direction of the tricks that were needed? E.g. were they mostly to do with tying Native APIs to GeckoView, stuff within GeckoView itself, or something else?

I think this is potentially huge for Capacitor/Android (see https://github.com/ionic-team/capacitor/discussions/3899), especially since WebView appears to be getting slower with newer Android versions.

Losses commented 9 months ago

Would you mind giving some examples or general direction of the tricks that were needed? E.g. were they mostly to do with tying Native APIs to GeckoView, stuff within GeckoView itself, or something else?

I think this is potentially huge for Capacitor/Android (see ionic-team/capacitor#3899), especially since WebView appears to be getting slower with newer Android versions.

Ehhh.... our team members are schedule a meeting to discuss about how to make a detailed document, it will take times to be finished

pjamessteven commented 9 months ago

My app works great on iOS but Android can be really hit or miss. For example with WebView 103 (default on my One Plus Nord device) it's a laggy mess. Loading the SPA in Chrome or installing WebView 122 beta from the play store makes it buttery smooth. I don't really want to release an app where users on older WebView versions have a bad experience. I'm going to have to really strip it down to make it usable on older WebView versions.

I'm really interested in the potential of capacitor-geckoview to solve this problem. I found @Losses repo but it looks like it's for Capacitor v4 (https://www.npmjs.com/package/@web-media/capacitor-geckoview?activeTab=code). Unfortunately I'm using v5. I also can't find any hints on how to actually use it or implement it anywhere. I would be really interested to hear more about how to implement this!

ewguo commented 8 months ago

I've made a simple Capacitor-Geckoview app with Capacitor v5.6 here: https://github.com/imslp/capacitor.geckoview

In addition to using Geckoview it showcases accessing local files and using SQLite. It works well enough but is by no means polished, PRs welcome of course.

gaurav21r commented 3 months ago

@Losses Is this made by you / your team? https://www.npmjs.com/package/@web-media/capacitor-geckoview?activeTab=readme

I can't find the Github repo for this. Is this Open Source? Would love to help if it is. Would still appreciate a reply if it isn't So I can stop searching :)

Losses commented 3 months ago

@Losses Is this made by you / your team? https://www.npmjs.com/package/@web-media/capacitor-geckoview?activeTab=readme

I can't find the Github repo for this. Is this Open Source? Would love to help if it is. Would still appreciate a reply if it isn't So I can stop searching :)

Yeah, it's our work, with a lot of updates, the update repo is here! https://github.com/Web-Media-Foundation/infrastructure

gaurav21r commented 3 months ago

Wow! Thanks a ton @Losses !!!! I believe the latest version is here then?

https://github.com/Web-Media-Foundation/infrastructure/tree/master/packages/capacitor-geckoview

Are you guys at Web Media Foundation open to me trying to open a PR to update it to work with capacitor 6.0+ ?

My plan is to diff capcitor itself between 5.7.0 (as pointed to by your package.json) to 6.1.1 the latest release in Capacitor.

I have no idea of the effort involved but would be great if you could point me in the right direction. Its very important for our company and would love to collaborate if we have a shared vision for this.

Losses commented 3 months ago

Are you guys at Web Media Foundation open to me trying to open a PR to update it to work with capacitor 6.0+ ?

Sure!

I have no idea of the effort involved but would be great if you could point me in the right direction.

We have tried to upgrade a version before, it not a very hard task, good luck!

gaurav21r commented 3 months ago

@Losses Thanks for your prompt replies, will discuss with my team and start work. Hope to run by some minor issues with you 😅

Losses commented 3 months ago

@Losses Thanks for your prompt replies, will discuss with my team and start work. Hope to run by some minor issues with you 😅

Feel free to draft issues in the repo of web-media-foundation if you meet any trouble!