DOM Feature Support Detection

0.0.2 · abandoned · verified Tue Apr 21

dom-support is a JavaScript library originally extracted from jQuery, designed to detect various browser rendering and styling quirks. It provides a simple object where properties (e.g., `opacity`, `leadingWhitespace`, `boxSizing`) are booleans indicating support or specific browser behaviors that deviate from standards. The package version 0.0.2 was last published over a decade ago. It addresses issues prevalent in browsers like IE6/7/8, older WebKit, and pre-standard implementations. This library is now largely obsolete as modern browsers have converged on standards, making its checks mostly irrelevant for contemporary web development. It has no discernible release cadence and is no longer actively maintained. Its primary differentiator was its comprehensive set of quirk detections based on extensive real-world testing from a major library like jQuery.

Common errors

Warnings

Install

Imports

Quickstart

Initializes the dom-support library and logs a selection of detected browser quirks. Demonstrates how to access feature flags.

const support = require('dom-support');

console.log('--- DOM Support Features ---');
console.log(`Opacity support: ${support.opacity}`);
console.log(`Leading whitespace stripped by innerHTML (IE quirk): ${support.leadingWhitespace}`);
console.log(`Tbody auto-inserted into empty tables (IE quirk): ${support.tbody}`);
console.log(`HTML5 element cloning works correctly: ${support.html5Clone}`);
console.log(`Box sizing property support: ${support.boxSizing}`);
console.log(`Check for reliable hidden offsets (IE8 quirk): ${support.reliableHiddenOffsets}`);
console.log(`Radio button value maintained after append: ${support.radioValue}`);
console.log(`Cloning nodes copies event handlers (IE quirk): ${support.noCloneEvent}`);

// In a modern browser environment, most of these will be 'true' for standard behavior.

view raw JSON →