Giter Site home page Giter Site logo

browser_detect.dart's Introduction

Browser Detect

A package that detects the browser being used to view a web page. Useful for blanket browser detection. If possible, try to use feature detection over this approach.

Usage

Import the Browser Detect package.

import 'package:browser_detect/browser_detect.dart';

Use the library's browser field to query for information about the detected browser. This field contains properties for checking the browser type and version.

if (browser.isIe && browser.version <= "9") {
  // Do something.
}

browser_detect.dart's People

Contributors

ardevelop avatar astashov avatar danschultz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

browser_detect.dart's Issues

IE 11

Thank you for your perfect package! It has only one bug:
It could not detect IE 11. I tried it on a lot of devices with Microsoft Windows 7/8/8.1, but with no success. Could you please fix it? I don't know if this bug is caused by changing the user agent string and other navigator values in IE 11 (now it isn't MSIE, but only IE and sometimes only "Trident/7.0 rv:11.0" - but I don't know it exactly) or if the bug is caused by moving Dart to stable version 1.0 (probably not, but it should be inspected too). Please repair it.

Browser detect simply fails on Chrome on iOS

This is the code in src/browser.dart:

  BrowserVersion get version {
    if (_version == null) {
      var value = _versionMatchers.map((matcher) => matcher())
          // vvvv This is the offending line vvvv
          .firstWhere((match) => match != null)
          .group(1);
      _version = new BrowserVersion(value);
    }
    return _version;
  }

If no match is found, then this simply throws

Detect platform

It would be useful to support detecting the operating system and version with getters such as os, osVersion, isWindows, isLinux, isIOS.

This would likely involve browser sniffing, but perhaps with a growing Dart community the detection rules can be kept up-to-date to provide decent coverage?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.