0

I used the information provided in Best way to detect that HTML5 <canvas> is not supported and the javascript snippet to check whether a browser supports canvas element. However, all the browsers I have access to support canvas element, so the check always succeeds and the code in the "canvas not supported" part never gets executed. Is there anyway to simulate "canvas not supported" condition in Chrome (v82+), Fire Fox (v76+), or MS Edge(v44+)/IE(v11+) or Safari? I want to save the hassle of downloading a browser to test this if I can disable canvas or somehow simulate it. Thanks in advance for any information.

BReddy
  • 407
  • 3
  • 13
  • 2
    Take a step back. If browsers that don't support `canvas` are so hard to come by that you can't find one, why do you need to support it? If the answer is that some specific device that a customer needs doesn't have it, then you should be testing on that device. – Joseph Sible-Reinstate Monica Jun 14 '20 at 00:30
  • @JosephSible-ReinstateMonica I am not very knowledgeable about browsers and support for different features. I simply want to plug the potential hole as that is a distinct possibility in this case. How probable someone accesses my page with a browser that does not support canvas is not known. If there are not that many browsers like that in use, I could probably ignore that part of the code, but want to do best I can before going to production. – BReddy Jun 14 '20 at 00:39
  • 2
    The last browser that didn't support `canvas` was IE 8. It has 0.07% market share, and no longer runs on any version of Windows that Microsoft still supports. – Joseph Sible-Reinstate Monica Jun 14 '20 at 00:45
  • 1
    @BReddy Generally speaking, it's good to support as many browsers/devices as you can as long as it doesn't cause a detriment to others. That is, if you can use graceful progressive enhancement or fallbacks, it's often worth doing. But if your site requires a certain capability, use it. Next, use your analytics to determine what *your users* actually attempt to use your site with, and determine who to target from there. As others have said, most everything supports ``, so if you follow this methodology you'll undoubtedly decide it's not a problem. – Brad Jun 14 '20 at 03:49

0 Answers0