caniuse - speced/respec GitHub Wiki
caniuse
Type: string | CaniuseOptions
Default: undefined
Adds a browser support table to the document header, sourced from caniuse.com.
Basic usage
var respecConfig = {
caniuse: "payment-request",
};
With options
var respecConfig = {
caniuse: {
feature: "payment-request",
browsers: ["chrome", "firefox", "safari", "edge"],
},
};
Options
| Option | Type | Default | Description |
|---|---|---|---|
feature |
string |
required | caniuse.com feature key (the slug from the URL) |
browsers |
string[] |
all major | Browser IDs to include in the table |
removeOnSave |
boolean |
true |
Strip the widget when saving as HTML; replace with a link to caniuse.com |
apiURL |
string |
caniuse data on respec.org | Override the caniuse data endpoint — advanced use, e.g. self-hosted data |
Supported browser IDs
| ID | Browser |
|---|---|
chrome |
Chrome |
edge |
Edge |
firefox |
Firefox |
safari |
Safari |
ios_saf |
Safari on iOS |
and_chr |
Chrome on Android |
and_ff |
Firefox on Android |
and_uc |
UC Browser on Android |
samsung |
Samsung Internet |
op_mob |
Opera Mobile |
opera |
Opera |
Notes
- The caniuse widget requires JavaScript — in saved/exported HTML it is replaced by a plain link to caniuse.com
- The feature key is the slug from the caniuse.com URL:
https://caniuse.com/FEATURE-KEY wf-*prefixed features (Baseline/web-features) are not yet supported — they come from a different data source- To find the right feature key, browse caniuse.com and copy the URL slug