@@ -16,6 +16,7 @@ extern void callWithWebView(WKWebView *, HsStablePtr);
16HsStablePtr global_willFinishLaunchingWithOptions = 0;
16HsStablePtr global_willFinishLaunchingWithOptions = 0;
17HsStablePtr global_didFinishLaunchingWithOptions = 0;
17HsStablePtr global_didFinishLaunchingWithOptions = 0;
18HsStablePtr global_applicationUniversalLink = 0;
18HsStablePtr global_applicationUniversalLink = 0;
19+uint64_t global_developerExtrasEnabled = 1;
20@implementation AppDelegate
21@implementation AppDelegate
@@ -39,7 +40,9 @@ HsStablePtr global_applicationUniversalLink = 0;
40-(void)applicationWillFinishLaunching:(NSNotification *)notification {
41-(void)applicationWillFinishLaunching:(NSNotification *)notification {
41 WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];
42 WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];
43+ if (global_developerExtrasEnabled) {
42− [theConfiguration.preferences setValue:@YES forKey:@"developerExtrasEnabled"];
44+ [theConfiguration.preferences setValue:@YES forKey:@"developerExtrasEnabled"];
43 WKWebView *webView = [[WKWebView alloc] initWithFrame: [_window.contentView frame] configuration:theConfiguration];
46 WKWebView *webView = [[WKWebView alloc] initWithFrame: [_window.contentView frame] configuration:theConfiguration];
44 [_window setContentView:webView];
47 [_window setContentView:webView];
45 callWithWebView(webView, _handler);
48 callWithWebView(webView, _handler);
@@ -89,11 +92,13 @@ void runInWKWebView(HsStablePtr handler,
89 const uint64_t hs_requestAuthorizationOptionCarPlay,
92 const uint64_t hs_requestAuthorizationOptionCarPlay,
90 const uint64_t hs_registerForRemoteNotifications,
93 const uint64_t hs_registerForRemoteNotifications,
91 HsStablePtr hs_didRegisterForRemoteNotificationsWithDeviceToken,
94 HsStablePtr hs_didRegisterForRemoteNotificationsWithDeviceToken,
92− HsStablePtr hs_didFailToRegisterForRemoteNotificationsWithError) {
95+ HsStablePtr hs_didFailToRegisterForRemoteNotificationsWithError,
96+ const uint64_t hs_developerExtrasEnabled) {
93 @autoreleasepool {
97 @autoreleasepool {
94 global_willFinishLaunchingWithOptions = hs_willFinishLaunchingWithOptions;
98 global_willFinishLaunchingWithOptions = hs_willFinishLaunchingWithOptions;
95 global_didFinishLaunchingWithOptions = hs_didFinishLaunchingWithOptions;
99 global_didFinishLaunchingWithOptions = hs_didFinishLaunchingWithOptions;
96 global_applicationUniversalLink = hs_applicationUniversalLink;
100 global_applicationUniversalLink = hs_applicationUniversalLink;
101+ global_developerExtrasEnabled = hs_developerExtrasEnabled;
97 NSApplication *application = [NSApplication sharedApplication];
102 NSApplication *application = [NSApplication sharedApplication];
98 AppDelegate *appDelegate = [[AppDelegate alloc] initApp:handler progName:[NSString stringWithCString:progName encoding:NSUTF8StringEncoding]];
103 AppDelegate *appDelegate = [[AppDelegate alloc] initApp:handler progName:[NSString stringWithCString:progName encoding:NSUTF8StringEncoding]];
99 [application setDelegate:appDelegate];
104 [application setDelegate:appDelegate];