XertDev / gecko_view_flutter

GeckoView plugin for flutter (WIP, Android only)
MIT License
1 stars 2 forks source link

Regarding the issue of flutter calling js methods in geckoview, can you add and improve this demo? #2

Closed aihanjiao closed 5 months ago

aihanjiao commented 6 months ago

as title

aihanjiao commented 6 months ago

I read the geckoview tutorial about how to communicate with native devices. https://firefox-source-docs.mozilla.org/mobile/android/geckoview/consumer/web-extensions.html But it's too messy, and I don't know how to deal with the relationship between flutter, kotlin, and geckoview. Please help me. Thank you.

XertDev commented 6 months ago

Hi! I'm planning to implement both support for js invocation and webextensions to some extent so that I can manipulate cookies (from my current understanding, there's probably no other way to access this API). I'll probably get around to it next week.

I'm using this project as a way to explore the capabilities of GeckoView, so it might not be a 100% implementation of all functionality, but I'll do my best!

aihanjiao commented 6 months ago

Thanks. I'll let you know if I have any good news

XertDev commented 5 months ago

@aihanjiao I have implemented the functionality to execute JS code in the specified tab. Please check if this meets your expectations

XertDev commented 5 months ago

I couldn't find an easy way to retrieve the tabId for a given GeckoSession, so I used the content script trick. TabId is needed so that the background script knows which tab to run the code in