Skip to content

Detect the graphics specs of a device using web APIs

Notifications You must be signed in to change notification settings

amilajack/webgl-specs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webgl-specs

Detect the graphics specs of a device using web APIs

Install

# Yarn
yarn add webgl-specs
# NPM
npm install webgl-specs

Why?

This is useful when you want to render lower quality graphics for low powered devices

Usage

If you have a module loader (webpack or rollup)

import WebglSpecs from 'webgl-specs';

const report = WebglSpecs();
report.unMaskedRenderer // "Intel Iris OpenGL Engine"
report.unMaskedVendor // "Intel Inc."
report.glVersion // "WebGL 1.0 (OpenGL ES 2.0 Chromium)"

If you're not:

<html>
<body>
  <script type="module">
    import WebglSpecs from 'https://unpkg.com/webgl-specs@latest/index.js';

    const report = WebglSpecs();
    report.unMaskedRenderer // "Intel Iris OpenGL Engine"
    report.unMaskedVendor // "Intel Inc."
    report.glVersion // "WebGL 1.0 (OpenGL ES 2.0 Chromium)"
  </script>
</body>
</html>

Testing

yarn start

Prior Art

About

Detect the graphics specs of a device using web APIs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published