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

fix: Support for older browser versions on Android #27

Open
SamuelLeclerc33 opened this issue Jul 31, 2024 · 4 comments
Open

fix: Support for older browser versions on Android #27

SamuelLeclerc33 opened this issue Jul 31, 2024 · 4 comments

Comments

@SamuelLeclerc33
Copy link

Describe the bug
When starting an app that uses this package on an older android device (with a webview prior to 80), we get an error from the javascript ran in the function setProperty from this library.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new capacitor projet and install this package
  2. Build and run on android on an older device with webview prior to 80.
  3. See that we get an 'Uncaught SyntaxError: Unexpected token .'

Expected behavior
I expect the library to work for all the devices that capacitor supports (unless specified in the readme).

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone

  • Device: Emulator
  • OS: Android 7.0 Nougat
  • Version 69

Additional context
In my opinion, this library should at least support the same versions has capacitor.

The solution is simply to change the js introduced at line 108 in SafeArea.kt to remove the optional chaning operator (?.) and replace it with a simple if.

I already have a fix ready that I'm using internally and I'd be able to make a PR for the changes.

Thanks

@tafelnl
Copy link
Member

tafelnl commented Aug 1, 2024

PRs are welcome

@SamuelLeclerc33
Copy link
Author

Pr created : #28

@SamuelLeclerc33
Copy link
Author

@tafelnl any news ? I'm willing to do changes

@tafelnl
Copy link
Member

tafelnl commented Aug 13, 2024

TBH, I'm a bit hesitant to incorporate this into the library. It feels hackish, and therefore will kinda pollute the code base and bring additional maintenance work. Chrome 70 has been released on October 17, 2018. That's almost 6 years ago. Most users should have updated their browser since then. I doubt that it's worth it to add support for such a minor user base. Even if you wanted to use this plugin and support Chrome versions older than 70, you could still just only initialize this plugin after checking for the chrome version yourself. So unless there appears to be much more demand for this, I will probably not merge it. I'm sorry

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

No branches or pull requests

2 participants