I am writing an application for Mac OS - browser on WebKit to use for the some site on WebGL. All is ready, the application correctly displays normal HTML sites, but WebGL doesn
I figured out how to do this without using an undocumented method. You need to set the user preference WebKitWebGLEnabled
to @YES
for your app. To have the setting apply the first time the app is run, it needs to be set early, before the WebView
is initialized. In my case, the WebView
instance is loaded from the main nib file, so that's very early indeed. I added this code to Supporting Files/main.m
:
[[NSUserDefaults standardUserDefaults] setObject:@YES
forKey:@"WebKitWebGLEnabled"];
Please note, since no undocumented method is called, I assume this code is within app store guidelines, but my app hasn't been reviewed yet!