Registry / serialization / webvr-polyfill-dpdb

webvr-polyfill-dpdb

JSON →
library1.0.18jsnpmunverified

webvr-polyfill-dpdb is a JSON dataset containing device parameters crucial for the webvr-polyfill. It provides information like screen DPI, bezel width, and device identification rules (User-Agent, resolution, etc.) for various Android and iOS devices. This data is essential for the webvr-polyfill to accurately render stereoscopic scenes by correcting lens distortion on mobile devices, bridging the gap where web applications lack direct access to physical device characteristics. The package is currently at version 1.0.18, with its last recorded update in December 2020. Given that the underlying WebVR API has been deprecated in favor of WebXR, this database is largely superseded and serves a legacy purpose.

npm install webvr-polyfill-dpdb
INSTALL
IMPORT
SIG · WEBVR-POLYFILL-DPD
W
webvr-polyfill-dpdb
serializationjavascriptv1.0.18
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dpdb.json
✓ import dpdb from 'webvr-polyfill-dpdb/dpdb.json';
✗ import { dpdb } from 'webvr-polyfill-dpdb';
This package is a data source. The primary 'import' is to directly access the JSON file containing the device parameter database. Modern bundlers (Webpack, Rollup, Parcel) can handle direct JSON imports. For Node.js, `require()` can load JSON directly.
dpdb-formatted.json
✓ import formattedDpdb from 'webvr-polyfill-dpdb/dpdb-formatted.json';
✗ import { formattedDpdb } from 'webvr-polyfill-dpdb';
The raw, human-editable version of the DPDB is `dpdb-formatted.json`. This is typically used for development or custom builds, while `dpdb.json` is the generated output. Ensure your build system supports JSON imports.

Demonstrates how to import the `dpdb.json` data and programmatically access device parameters. This package primarily provides data, not executable functions.

import dpdb from 'webvr-polyfill-dpdb/dpdb.json'; // In a real application, you would pass this data to the webvr-polyfill // for its configuration. This example demonstrates accessing the data directly. console.log('Total devices in DPDB:', dpdb.devices.length); // Find a specific device entry, for example, based on a User-Agent rule const searchUA = 'ASUS_Z00AD'; const asusDevice = dpdb.devices.find(device => device.rules.some(rule => rule.ua && rule.ua.includes(searchUA)) ); if (asusDevice) { console.log(`Found device: ASUS_Z00AD with DPI ${asusDevice.dpi} and bezel width ${asusDevice.bw}mm.`); } else { console.log(`Device with UA '${searchUA}' not found in DPDB.`); } // Example of accessing a device from the raw formatted JSON (if available/desired) // This would typically involve a separate build step or direct file access for customization /* fetch('node_modules/webvr-polyfill-dpdb/dpdb-formatted.json') .then(response => response.json()) .then(formattedData => { console.log('Example from formatted DPDB:', formattedData.devices[0]); }); */
Debug
Known issues
breakingThe underlying WebVR API for which this database was designed has been deprecated and largely replaced by the WebXR Device API. Modern immersive web experiences should target WebXR.
fix
Migrate immersive web projects to the WebXR Device API and use `webxr-polyfill` if polyfilling is needed. The `webvr-polyfill-dpdb` is not compatible with WebXR directly.
affects: >=1.0.0
gotchaThe device parameter database (`dpdb.json`) may be outdated. The last known update to this repository was in December 2020. Newer mobile VR devices released after this date might not be included or have inaccurate parameters, potentially leading to incorrect rendering with `webvr-polyfill`.
fix
For `webvr-polyfill` applications, if you need to support newer devices, you would need to fork this repository, add the device parameters to `dpdb-formatted.json`, run `npm run build`, and use your custom-built `dpdb.json`. However, it's strongly recommended to migrate to WebXR.
affects: <=1.0.18
deprecatedThis package primarily serves as a data source for the `webvr-polyfill`, which itself is considered deprecated. It is unlikely to receive further updates or new device entries.
fix
Plan to transition any existing WebVR content to WebXR. This package provides data for a legacy polyfill and should not be relied upon for new development or long-term maintenance.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'webvr-polyfill-dpdb'
Attempting to import the package as a JavaScript module that exports symbols, or importing it in a Node.js environment without a bundler correctly resolving the JSON file.
fix
Import the specific JSON file directly: `import dpdb from 'webvr-polyfill-dpdb/dpdb.json';` or `const dpdb = require('webvr-polyfill-dpdb/dpdb.json');`. Ensure your build tool is configured to handle JSON imports.
dpdb.devices is undefined (or similar error when accessing data)
The JSON file might not have been loaded correctly, or the structure of the data accessed is incorrect.
fix
Verify the import path is correct and that the JSON data is parsed. Ensure you are accessing `dpdb.devices` as an array, as indicated in the package's structure. Confirm the JSON itself is valid.
Upgrade
Version history
1.0.18latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
webvr-polyfill-dpdb — npm install webvr-polyfill-dpdb · libregistry