Enable WebGL in the Mac OS application on WebKit

前端 未结 3 984
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 11:00

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

3条回答
  •  野性不改
    2021-02-06 11:51

    In Mavericks, this is the correct code.

    WebPreferences *preferences = [_webview preferences];
    if([preferences respondsToSelector:@selector(setWebGLEnabled:)]){
        [preferences performSelector:@selector(setWebGLEnabled:) withObject:[NSNumber numberWithBool:YES]];
    }
    

    You need to call performSelector otherwise you'll get a compile error.

提交回复
热议问题