Source code
Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
"use strict";
const CSS_PROPERTIES_DATASET_URL =
"resource://devtools/shared/compatibility/dataset/css-properties.json";
const MOCK_CSS_PROPERTIES_DATASET_URL =
// Preference to enable using the mocked dataset. Defaults to false.
const MOCK_DATASET_PREF = "devtools.compatibility.use-mock-dataset";
/**
* Return the MDN compatibility data for CSS properties, either local snapshot
* mock dataset via devtools.compatibility.use-mock-dataset=true.
*
* @returns {object} The compat data, keyed by CSS property name.
*/
function getCSSPropertiesCompatData() {
return require(
Services.prefs.getBoolPref(MOCK_DATASET_PREF, false)
? MOCK_CSS_PROPERTIES_DATASET_URL
: CSS_PROPERTIES_DATASET_URL
);
}
module.exports = {
getCSSPropertiesCompatData,
};