You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.js 495B

12345678910111213141516171819202122
  1. // @flow
  2. let filterSupport;
  3. /**
  4. * Checks context filter support.
  5. *
  6. * @returns {boolean} True if the filter is supported and false if the filter is not supported by the browser.
  7. */
  8. export function checkBlurSupport() {
  9. if (typeof filterSupport === 'undefined') {
  10. const canvas = document.createElement('canvas');
  11. const ctx = canvas.getContext('2d');
  12. filterSupport = typeof ctx.filter !== 'undefined';
  13. canvas.remove();
  14. }
  15. return filterSupport;
  16. }