-
Notifications
You must be signed in to change notification settings - Fork 31
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
Incorrectly detecting chrome on android as an InApp browser #52
Comments
Same here, it's detecting android's chrome as inApp. I tested this UA against the isInApp regex rules, and it does return FALSE, so not sure why it's returning TRUE for our users. |
That's because https://chat.openai.com/share/98549886-db01-4c4c-8c9c-5c3bce26ea42 I guess what could be done is to use the |
here are some user agent strings I got from my own testing. Notice Facebook in-app browser is the only one that contains
|
one more interesting thing to notice is that on linux browsers even though I am on a Wayland session they still report the string |
Here's what I did: master...shalanah:detect-inapp:shalanah-build
Feel free to use this in your packages: I'm also created a debugging page to help test on my devices. |
I actually ended up removing this package and using a custom solution because none of the other alternative solutions on npm worked properly. Below is the full code. It also works with SSR. This is production tested with a large user base.
This is obviously only checking against Facebook and Instagram at the moment but it works reliably across iOS and Android, old and new versions. |
If you are planning to use this to remove users from in app browsers, the following implementation below works on Android. I am still to find an alternative iOS version for that.
This will open a browser dialog telling users the site is trying to open an app and if they accept. The app is their default browser. You can aggressively run it on a loop, or first show a full screen modal that cant be closed saying the browser is not supported and make a button with that as a link, either will work and force users out of the in app browsers. |
@brunofin I think a pared down in-app detection is a great idea! Like you noted, I'd need more detection like linkedin, tiktok, etc. |
Also interesting --- would love if Bowser took this on since I'm using it anyway: bowser-js/bowser#452 |
@brunofin + all . I just pushed a fork (with API changes) and created an npm package. I hope to continue the legacy of To install:
To use (slightly different API) import InAppSpy from 'inapp-spy';
const {isInApp, appName, appKey} = InAppSpy() Link to repo: https://github.com/shalanah/inapp-spy I removed the is mobile, desktop, tablet along with common browsers like "Safari" and "Chrome". I'd recommend |
Please look into this, seems like being on android and chrome I'm getting it as an inapp browser. Thank you
The text was updated successfully, but these errors were encountered: