Properly detect webGL in example code on the CanvasRenderer documentation page

WebGLRenderingContext may return a truthy value even though WebGL is disabled or when a graphics card is blacklisted. I took the check from Detector.js to properly detect for this and reformatted the code for readability.
Merge pull request #5530 from blaise-io/patch-1

Properly detect webGL in example code in the CanvasRenderer documentation