{"id":15311,"library":"dom-support","title":"DOM Feature Support Detection","description":"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.","status":"abandoned","version":"0.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/timoxley/dom-support","tags":["javascript"],"install":[{"cmd":"npm install dom-support","lang":"bash","label":"npm"},{"cmd":"yarn add dom-support","lang":"bash","label":"yarn"},{"cmd":"pnpm add dom-support","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and was developed before widespread ESM adoption. Direct ESM `import` statements will not work without a CommonJS-to-ESM transpilation layer.","wrong":"import support from 'dom-support';\nimport * as support from 'dom-support';","symbol":"support","correct":"const support = require('dom-support');"}],"quickstart":{"code":"const support = require('dom-support');\n\nconsole.log('--- DOM Support Features ---');\nconsole.log(`Opacity support: ${support.opacity}`);\nconsole.log(`Leading whitespace stripped by innerHTML (IE quirk): ${support.leadingWhitespace}`);\nconsole.log(`Tbody auto-inserted into empty tables (IE quirk): ${support.tbody}`);\nconsole.log(`HTML5 element cloning works correctly: ${support.html5Clone}`);\nconsole.log(`Box sizing property support: ${support.boxSizing}`);\nconsole.log(`Check for reliable hidden offsets (IE8 quirk): ${support.reliableHiddenOffsets}`);\nconsole.log(`Radio button value maintained after append: ${support.radioValue}`);\nconsole.log(`Cloning nodes copies event handlers (IE quirk): ${support.noCloneEvent}`);\n\n// In a modern browser environment, most of these will be 'true' for standard behavior.","lang":"javascript","description":"Initializes the dom-support library and logs a selection of detected browser quirks. Demonstrates how to access feature flags."},"warnings":[{"fix":"Do not use this package in new projects. For modern feature detection, rely on built-in browser APIs or a maintained, targeted polyfill/feature-detection library (e.g., Modernizr, although even that is less critical today).","message":"This package is effectively abandoned and targets browser quirks from over a decade ago (e.g., IE6-8, older WebKit versions). Its findings are almost entirely irrelevant for modern web development, and including it will only add unnecessary bundle size.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"If you absolutely must use this deprecated package in a modern ESM context, configure your bundler to handle CommonJS modules (e.g., using `@rollup/plugin-commonjs` for Rollup) or use `require()` in a CJS file and then import that CJS file.","message":"The package is CommonJS-only. Attempting to use `import` syntax directly in an ESM module without a transpiler like Webpack or Rollup configured for CJS interop will result in errors.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Thoroughly understand the specific quirk being detected if you are using this library. For contemporary feature detection, prefer `typeof window.CSS.supports === 'function'` or direct property checks (`'property' in document.body.style`).","message":"The properties provided by `dom-support` are boolean flags indicating the *presence* of a quirk or a feature, not necessarily its ideal behavior. For example, `support.opacity` indicates if the `opacity` CSS property exists, not whether an IE `filter` equivalent is needed.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"This package is CommonJS. Use a bundler like Webpack or Rollup configured to handle CJS modules, or rewrite your code to use native ESM imports for modern libraries. This package is not designed for direct ESM usage.","cause":"Attempting to use `require()` in an ECMAScript Module (ESM) environment (e.g., Node.js with `\"type\": \"module\"` or directly in browsers).","error":"ReferenceError: require is not defined"},{"fix":"This package does not export a default or named export for ESM. It only provides a CommonJS `module.exports`. If you must use it, you'll need a CommonJS interop solution in your build pipeline or to stick to `require()` in a CJS context.","cause":"Attempting to `import support from 'dom-support'` or `import { support } from 'dom-support'` in an ESM context.","error":"SyntaxError: Named export 'default' not found. The requested module 'dom-support' does not provide an export named 'default'"}],"ecosystem":"npm","meta_description":null}