From: Jay Freeman (saurik) Date: Wed, 29 Jan 2014 06:48:00 +0000 (-0800) Subject: Use a UIWebDocumentView to get our shared WebView. X-Git-Tag: v0.9.3915~2 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/0032040f5dc9856880c5c10c67a21c40078d3f8b?ds=inline Use a UIWebDocumentView to get our shared WebView. --- diff --git a/WBMarkup.mm b/WBMarkup.mm index 19cbeaa..ff7c98a 100644 --- a/WBMarkup.mm +++ b/WBMarkup.mm @@ -2,6 +2,8 @@ #include +MSClassHook(UIWebDocumentView) + @class WKView; extern "C" void WebThreadLock(); @@ -61,6 +63,10 @@ static void (*WKViewDisplayRect$)(WKView *, CGRect); - (void) setContentView:(WebView *)view; @end +@interface UIWebDocumentView : NSObject +- (WebView *) webView; +@end + static WBMarkup *SharedMarkup_; @implementation WBMarkup @@ -93,7 +99,11 @@ static WBMarkup *SharedMarkup_; if ((self = [super init]) != nil) { WebThreadLock(); - view_ = [[WebView alloc] initWithFrame:CGRectMake(0, 0, 640, 5000)]; + if ($UIWebDocumentView == Nil) + view_ = [[WebView alloc] initWithFrame:CGRectMake(0, 0, 640, 5000)]; + else + view_ = [[[$UIWebDocumentView alloc] initWithFrame:CGRectMake(0, 0, 640, 5000)] webView]; + [view_ setDrawsBackground:NO]; WebPreferences *preferences([[WebPreferences alloc] initWithIdentifier:@"com.apple.webkit.webmarkup"]);