I have a MikroTik HotSpot.
In mobile browsers (Android, iOS, WP), when a user is connecting to HotSpot, the captive portal browser (or embedded browser) pops up.
If we want to disable this embedded browser we have to open (walled garden) some URLs (about 10 or more for all phones) and I don't want to open these URLs for all in my HotSpot.
So, Is there a way to detect these browsers with JavaScript (user-agents maybe) or something?
For iOS devices, I've found this code in php:
if ((strpos($userAgent, 'iphone') || strpos($userAgent, 'ipad')) &&
(strpos($userAgent, 'mozilla/') !== false) &&
(strpos($userAgent, 'applewebkit/') !== false) &&
(strpos($userAgent, 'mobile/') !== false) &&
(strpos($userAgent, 'safari') === false))
{
echo 'CONNECTS FROM CAPTIVE';
} else {
echo 'CONNECTS FORM SAFARI';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With