I have an HTML/JavaScript SPA and I want to check whether Offscreen canvas is supported by the Browser or not.
I tried with
var canvasTest = document.createElement('canvas-test');
if(typeof canvasTest.transferControlToOffscreen === "function")
{
return true;
}
else
{
return false;
}
but it doesn't work (i.e. it returns false even though the Browser actually supports it)
I'm using this code to check if the function exists or not: How to check if function exists in JavaScript?