Created
August 11, 2023 18:08
-
-
Save wbamberg/3ef0ac22a874a9e98d9243512bcb71f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bcd from "@mdn/browser-compat-data" assert { type: "json" }; | |
const support = bcd.webextensions.api; | |
function checkSupport(api, browser) { | |
let total = Object.keys(support[api]).length; | |
let supported = 0; | |
for (const feature of Object.keys(support[api])) { | |
if (support[api][feature]["__compat"]) { | |
if ( | |
support[api][feature]["__compat"]["support"][browser][ | |
"version_added" | |
] !== false | |
) { | |
supported++; | |
} | |
} | |
} | |
return { | |
supported, | |
total, | |
}; | |
} | |
for (const api of Object.keys(support)) { | |
const { supported, total } = checkSupport(api, "firefox_android"); | |
console.log(`${api}: | |
${supported} out of ${total}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment