Skip to content

Instantly share code, notes, and snippets.

@koenbok
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save koenbok/fd66be1bff6098a9c8ff to your computer and use it in GitHub Desktop.

Select an option

Save koenbok/fd66be1bff6098a9c8ff to your computer and use it in GitHub Desktop.
//
// AppDelegate.m
// Webkit2Test
//
// Created by Koen Bok on 08/08/14.
// Copyright (c) 2014 Koen Bok. All rights reserved.
//
#import "AppDelegate.h"
@interface AppDelegate ()
@property (weak) IBOutlet NSWindow *window;
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSView *contentView = self.window.contentView;
WKWebView *webView = [[WKWebView alloc] initWithFrame:contentView.frame];
NSString *path = @"/Users/koen/Desktop/Poop.framer";
NSURL *pathUrl = [NSURL fileURLWithPath:path isDirectory:YES];
NSString *indexPath = [path stringByAppendingPathComponent:@"index.html"];
[webView loadHTMLString:[NSString stringWithContentsOfFile:indexPath encoding:NSUTF8StringEncoding error:nil] baseURL:pathUrl];
[contentView addSubview:webView];
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
}
@end
08/08/14 00:22:51,000 kernel[0]: Sandbox: com.apple.WebKit(4702) deny file-issue-extension <path>/my-script.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment