Race condition in embed.js?
I think there's a race condition in embed.js.
What happens is that embed.js calls insertScript to get all the gli code in, but that code is not synchronous.
Later on, embed.js monkey-patches the HTMLCanvasElement prototype's getContext and introduces a reference to the gli variable.
If someone decides to create a context before gli.all.js has loaded, the gli resolves to null, and the block in lines 116--119 will always throw exceptions. No contexts ever created! :(
There doesn't seem to be a simple way to solve this besides. Perhaps getContext should throw a special "come back later" exception?
Fundamentally, it's not enough to assume that embed.js was included before anything else, because script tag insertion is async.
Yep. I also notice this problem. This happens frequently while embed debugging mode.