Meanwhile, you could use setInterval, or maybe just a loop, to just check whether .getContext (without brackets) is true, and only proceed after it is (with some sensible limit so you don't stall the browser with an infinite loop if something goes wrong or a user doesn't have that feature in their browser.)