Skip to content
Marcos Cáceres edited this page May 3, 2018 · 15 revisions

Adds a Can I Use support table in header (before the copyright message).

Example of usage

// basic example
var respecConfig = {
  caniuse: "payment-request",
};
// example with configuration (see options below)
var respecConfig = {
  caniuse: {
    feature: "payment-request",
    browsers: ["chrome", "safari"],
  },
};

Note: This feature is only available in "live" Editor's Drafts. Because this feature relies on JavaScript, it's not exported out when a document is saved as HTML. In exported document, we replace the table with a link to caniuse.com.

Example output

It renders as:

Can I Use preview for Payment Request api

Configuration Options:

feature
(required) Can I Use feature key
browsers
Array of browsers to show support for.
Default: ["chrome", "firefox", "safari", "edge"]
Supported Values:
  • chrome -- Chrome
  • firefox -- Firefox
  • ie -- IE
  • edge -- Edge
  • android -- Android
  • safari -- Safari
  • opera -- Opera
  • bb -- Blackberry
  • and_uc -- UC (Android)
  • and_ff -- Firefox (Android)
versions
Number of browser versions to show
Default: 4
maxAge
Cache duration (in ms).
Set to 0 to get fresh data each on each request.
Default: 86400000 // 24 hours
apiURL
(For testing) Use a custom URL that returns a JSON response with stats key as the browser data object.
Use {FEATURE} as placeholder in URL to replace it by a value of caniuse.feature

Guides

Configuration options

W3C Configuration options

Linter rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

WebIDL

HTML attributes

CSS Classes

Special properties

Clone this wiki locally