<(common.inc.plp)><: use 5.010; Html({ title => 'browser compatibility cheat sheet', version => 'v1.0', description => "caniuse.", keywords => [qw'html css browser feature'], stylesheet => [qw'light dark circus mono red'], data => ['caniuse.js'], }); :>

Browser compatibility

Alternate view of Fyrd's when can I use... site.

<: use JSON; use File::Slurp 'read_file'; my $source = read_file('caniuse.js'); for ($source) { # cleanup # convert seperate variables to hash keys s/\A/{/; s/^caniuse\.(\w+) = /"$1":/gm; s/;$/,/gm; s/,\s*\Z/\n}/; # fractions not supported by barekey s/(?<=[,{]) (\d*\.\d) (?=:')/"$1"/gx; # escapes not supported in singlequote s{'((?:[^\\']+|\\.)*)'}{ my $_ = $1; s/"/\\"/g; s/\\'/'/g; qq("$_"); }ge; } my $caniuse = from_json($source, { # allow_singlequote => 1, allow_barekey => 1, }); my %CSTATS = ( n => 'di-b', y => 'di-a', a => 'di-d', j => 'di-prop', p => 'di-prop', 'y x' => 'di-a', ); my %CSTATUS = ( unoff => 'di-rare', # unofficial wd => 'di-b', # draft pr => 'di-prop', # proposed cr => 'di-d', # candidate rec => 'di-a', # recommendation ietf => 'di-a', # standard ); my @browsers = qw(trident gecko webkit_saf presto); unshift @{ $caniuse->{agents}->{gecko}->{versions} }, 2; print ''; print '' x 2; printf '', scalar @{ $caniuse->{agents}->{$_}->{versions} } for @browsers; print "\n"; print ''; print "\n"; for my $id (keys %{ $caniuse->{data} }) { my $row = $caniuse->{data}->{$id}; my $data = $row->{stats} or next; # skip metadata [summary] printf '', $id; printf '
$_" for qw(feature status); printf '%s', scalar @{ $_->{versions} }, $_->{browser} for map { $caniuse->{agents}->{$_} } @browsers; print "
%s', $row->{description}, $row->{title}; printf '%s', $caniuse->{statuses}->{$_}, $CSTATUS{$_} // '', $_ for $row->{status}; for my $browser (@browsers) { printf '%s', $CSTATS{ $data->{$browser}->{$_} }, $_ for @{ $caniuse->{agents}->{$browser}->{versions} }; } } print '
'; :>
yes almost plugin or js no