function getCanvas() {
  // TODO: Read the project settings use the right ID
  var canvas = window.document.getElementById('gesso-target');

  if (!canvas) {
    var canvases = window.document.getElementsByTagName('canvas');
    if (canvases.length === 1) {
      canvas = canvases[0];
    }
  }

  if (!canvas) {
    throw new Error('Canvas not found.');
  }

  return canvas;
}


module.exports = {
  getCanvas: getCanvas
};

@@ -379,49 +379,259 @@
 %7D%0A%0A%0A
-module.exports = %7B%0A  getCanvas: getCanvas
+function getContext2D() %7B%0A  return getCanvas().getContext('2d');%0A%7D%0A%0A%0Afunction getWebGLContext() %7B%0A  return getCanvas().getContext('webgl');%0A%7D%0A%0A%0Amodule.exports = %7B%0A  getCanvas: getCanvas,%0A  getContext2D: getContext2D,%0A  getWebGLContext: getWebGLContext
 %0A%7D;%0A

Add getContext2D and getWebGLContext.