WebGL Context "TypeError: Illegal invocation"

37 views
Skip to first unread message

Stuart B

unread,
Aug 25, 2016, 1:48:40 PM8/25/16
to Skulpt
Hello,


I have modified the scripts from:
<script src="../../dist/skulpt.js" type="text/javascript"></script>
<script src="../../dist/builtin.js" type="text/javascript"></script>

To:
<script src="http://www.skulpt.org/static/skulpt.js" type="text/javascript"></script> 
<script src="http://www.skulpt.org/static/builtin.js" type="text/javascript"></script>

But everything else is identical.

When I try to run the code, it fails on the second python line:
gl = webgl.Context("my-canvas")

And returns the error: "TypeError: Illegal invocation"

Could anyone please help identify what I am doing wrong? I see that this example is quite old, so maybe it's no longer compatible.

Thanks,
Stuart

Stuart B

unread,
Aug 26, 2016, 5:12:29 AM8/26/16
to Skulpt
Update...

So, I have found out that this example does indeed work as expected if I open it in Safari. It just doesn't seem to work in Chrome.

I have tried to search for this, but am struggling to understand. If anyone can suggest why this might be, I would be very grateful to hear it.

Thanks,
Stuart
Reply all
Reply to author
Forward
0 new messages