偷懒的版本(这个小破站用的):

<script>document.body.style.filter="grayscale(100%)"</script>

兼容性更好的版本:

html {
        filter: gray !important;
        filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
        filter: grayscale(100%);
        -webkit-filter: grayscale(100%);
        -moz-filter: grayscale(100%);
        -ms-filter: grayscale(100%);
        -o-filter: grayscale(100%);
}