• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    Opera Mini Browser Detection Using Javascript

    Opera Mini
    2
    3
    2003
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Former User
      A Former User last edited by

      I have written a javascript code for my website to detect if its running on an Opera Mini browser on mobile devices. Since Opera Mini has a data saving feature, when it is enabled it sometimes doesn't load the site properly, hence I want to display a message by detecting whether the browser used is Opera Mini.

      The code posted below works perfectly for Opera Mini on iOS but it doesn't work on Android. Any suggestions to make the code also work for Opera Mini on Android?

      <script type="text/javascript">
       function o(){
         var isMobile = {
          Opera: function() {
              return navigator.userAgent.match(/Opera Mini/i);
                            },
                        };
           if( isMobile.Opera() ) alert('If you are using Opera Mini please disable Data Savings Mode to Have a pleasant browsing experience :)');
                   }
       window.onload = o;
      </script>
      
      Reply Quote 1
        A Former User 1 Reply Last reply
      • A Former User
        A Former User @Guest last edited by This post is deleted!
        Reply Quote 0
          1 Reply Last reply
        • kaniolek
          kaniolek last edited by

          Hi @conrick

          In my case the code below does the trick.

          window.onload = function(){
              if (navigator.userAgent.indexOf("Opera Mini") !== -1)
                  alert("blah blah");
          };
          

          Depending on what geographic areas you target, you may want to reconsider adjusting your site's mobile version to Extreme Data Savings limits, though.

          Regards
          Kacper

          Reply Quote 1
            1 Reply Last reply
          • First post
            Last post

          Computer browsers

          • Opera for Windows
          • Opera for Mac
          • Opera for Linux
          • Opera beta version
          • Opera USB

          Mobile browsers

          • Opera for Android
          • Opera Mini
          • Opera Touch
          • Opera for basic phones

          • Add-ons
          • Opera account
          • Wallpapers
          • Opera Ads

          • Help & support
          • Opera blogs
          • Opera forums
          • Dev.Opera

          • Security
          • Privacy
          • Cookies Policy
          • EULA
          • Terms of Service

          • About Opera
          • Press info
          • Jobs
          • Investors
          • Become a partner
          • Contact us

          Follow Opera

          • Opera - Facebook
          • Opera - Twitter
          • Opera - YouTube
          • Opera - LinkedIn
          • Opera - Instagram

          © Opera Software 1995-2025