Added support for WebGL Canvas

Canvas uses 2d context by default, it doesn't allow for optional
configuration. This creates conflicts with WebGL (e.g. with three.js
library).