3

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?

Vahid
  • 3,384
  • 2
  • 35
  • 69
  • Maybe this helps: https://stackoverflow.com/questions/32950326/is-it-possible-to-detect-the-android-captive-portal-browser – xOneca Sep 25 '19 at 15:32

1 Answers1

1

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';
    }
Xavier Maroñas
  • 3,124
  • 1
  • 14
  • 7
  • Thank you for the answer. I will check that. +1 for iOS. If other devices available, the answer is this. – Vahid May 05 '15 at 05:40