const assert = require('assert')

function createGL (opts) {
  assert(!opts || (typeof opts === 'object'), 'pex-gl: createGL requires opts argument to be null or an object')
  if (!opts) opts = {}

  let canvas = opts.canvas

  if (!canvas) {
    canvas = document.createElement('canvas')
    canvas.width = opts.width || window.innerWidth
    canvas.height = opts.height || window.innerHeight
    if (!opts.width && !opts.height) {
      // fullscreen
      document.body.style.margin = '0px'
    }
    if (document.body) {
      document.body.appendChild(canvas)
    } else {
      // just in case our script is included above <body>
      document.addEventListener('DOMContentLoaded', () => {
        document.body.appendChild(canvas)
      })
    }
  }
  const gl = canvas.getContext('webgl', opts)
  return gl
}

module.exports = createGL

@@ -387,16 +387,52 @@
 rHeight%0A
+%0A    const appendCanvas = () =%3E %7B%0A  
     if (
@@ -468,16 +468,18 @@
 %7B%0A      
+  
 // fulls
@@ -486,24 +486,26 @@
 creen%0A      
+ 
+ 
 document.bod
@@ -527,22 +527,71 @@
 = '0px'%0A
+      %7D%0A      document.body.appendChild(canvas)%0A
     %7D%0A
+%0A
     if (
@@ -617,40 +617,21 @@
     
-document.body.
 appendC
-hild(c
 anvas
+(
 )%0A  
@@ -755,65 +755,20 @@
 d', 
-() =%3E %7B%0A        document.body.appendChild(canvas)%0A      %7D
+appendCanvas
 )%0A  

Change the way properties on document.body are set while loading canvas.