Giter VIP home page Giter VIP logo

browser-data's Introduction

Browser data

Check CSS properties support on major browsers

Usage

var bdata =  require('browser-data')

var browser = {name: "Firefox", version: "3"}
console.log(bdata.getEngine(browser)) // {name: 'Gecko', version: '1.9.1'}

console.log(bdata.browserSupport(browser, "border-radius")) // false
console.log(bdata.browserSupport(browser, "border-color")) // true

Database sources

Support database was built from the MDN CSS reference pages, it is the most complete and reliable source of information I've found. Mozilla is working on a project which will give access to this data with an API, no release date have been specified. In the meantime the data is gathered by scrapping the web pages, which unfortunately are not standardized and not complete (this is a collective effort, don't hesitate to contribute to the documentation on MDN Developper Network).

Rebuilding the database

make supportdb

Generates db/mdnDb.json with the following structure :

{
":active":{
  "n":":active",
  "t":[
    "CSS Pseudo-class",
    "Layout"
  ],
  "c":{
    "bs":{
      "c":[
        {"p":"","v":"1.0"}
      ],
      "f":[
        {"p":"","v":"1.0 (1.7 or earlier)"}
      ]
    }
  }
}
}

Main Object has CSS properties as key names

Property object :

  • 'n' (name)
  • 't' (tags)
  • 'c' (compatibilities) : object whith compatibilities name as keys ** 'bs' stands for 'Basic support'

Each compatibility line is an object with browser id as keys :

  • 'c' : Chrome
  • 'f' : Firefox
  • 'e' : Internet Explorer Edge
  • 'ie': Internet Explorer
  • 'o' : Opera
  • 's' : Safari
  • 'a' : Android
  • 'aw': Android Webview
  • 'fo': Firefox OS
  • 'fm': Firefox Mobile
  • 'iem': Internet Explorer Mobile
  • 'om' : Opera Mobile
  • 'sm' : Safari Mobile
  • 'cm' : Chrome for Android

Each browser object is an array of prefix / version tuples :

  • 'p' : prefix
  • 'v' : version

Alternate source

Support database was built from the wikipedia page https://en.wikipedia.org/w/index.php?title=Comparison_of_layout_engines_%28Cascading_Style_Sheets%29 (see tools/wikipediaScraper.js)

Browsers / engines versions matches comes from these sources :

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.