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

feat(android)!: Use addDocumentStartJavaScript for injecting javascript #7135

Merged
merged 7 commits into from
Jan 17, 2024

Conversation

jcesarmobile
Copy link
Member

@jcesarmobile jcesarmobile commented Dec 15, 2023

Marking it as breaking because

  • it requires androidx.webkit:webkit 1.9.0 or newer
  • is might cause some behavior changes since the way the javascript is injected changes (I've tested on the capacitor test app without any weird problems so far)

Solves problems like:

  • javascript injection not working on service workers
  • javascript injection not working if using server.url and the certificate has problems
  • javascript being injected in all .html files, even if it's a file being get usin fetch/XHR
  • javascript not being injected if there is no <head> tag

closes #2022
closes #5278

@jcesarmobile jcesarmobile merged commit f5446d8 into main Jan 17, 2024
6 checks passed
@jcesarmobile jcesarmobile deleted the jsdocument branch January 17, 2024 17:09
@martin-braun
Copy link

martin-braun commented Jul 18, 2024

But ... how do I use this? I come from #5278, but none of the solutions work on v6. I believe this should work without a service worker now?

I load a local index.html to do some stuff, then I load a remote website that uses Capacitor plugins. My Android device reports "implementation unavailable" and my platform is "web" despite being on Android. I can, however, control native functionality from the index.html.

Has this been documented?

I think the issue and possible solution is here: #7454

@ionic-team ionic-team locked as resolved and limited conversation to collaborators Jul 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
4 participants