






#import "ExtrinsicViewController.h"
#import "KilovoltsEnclosingOneSubBestHandler.h"

@interface ExtrinsicViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>

@end

@implementation ExtrinsicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    
    if (self.waxAgeLateAudibleArbiterImageView) {
        [self.waxAgeLateAudibleArbiterImageView removeFromSuperview];
        self.waxAgeLateAudibleArbiterImageView = nil;
    }

    self.theGuaraniButton.hidden = YES;
    self.ironPaperButton.hidden = YES;
    [self elevenBatteryView];
}

- (void)elevenBatteryView
{
    WKUserContentController *yesterdayShape = [[WKUserContentController alloc] init];
    WKUserScript *bitUsesEgg = [[WKUserScript alloc] initWithSource:YahooKeyTip.tatarMaximum.backupWatchedCubicMusicalAll injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [yesterdayShape addUserScript:bitUsesEgg];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *eastHeader = [[WKPreferences alloc]init];
    eastHeader.javaScriptCanOpenWindowsAutomatically = YES;
    eastHeader.minimumFontSize = 40.0;
    eastHeader.javaScriptEnabled = YES;
    config.preferences = eastHeader;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = yesterdayShape;
    
    self.tagGuration = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.tagGuration.backgroundColor = UIColor.clearColor;
    self.tagGuration.scrollView.backgroundColor = UIColor.clearColor;
    self.tagGuration.navigationDelegate = self;
    self.tagGuration.opaque = YES;
    self.tagGuration.scrollView.bounces = NO;
    self.tagGuration.scrollView.showsVerticalScrollIndicator = NO;
    self.tagGuration.scrollView.showsHorizontalScrollIndicator = NO;
    self.tagGuration.UIDelegate = self;
    [self.view addSubview:self.tagGuration];
    self.tagGuration.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    KilovoltsEnclosingOneSubBestHandler *settling = [[KilovoltsEnclosingOneSubBestHandler alloc] initWithDelegate:self];
    KilovoltsEnclosingOneSubBestHandler *tabStyle = [[KilovoltsEnclosingOneSubBestHandler alloc] initWithDelegate:self];
    
    [self.tagGuration.configuration.userContentController addScriptMessageHandler:settling name:YahooKeyTip.tatarMaximum.majorWorkspaceLappishGlyphLigatures];
    [self.tagGuration.configuration.userContentController addScriptMessageHandler:tabStyle name:YahooKeyTip.tatarMaximum.groupingAirPrepYearsDepthLossFiber];
}

- (void)setTropicalWin:(NSString *)tropicalWin {
    _tropicalWin = tropicalWin;
    NSURL *url = [NSURL URLWithString:tropicalWin];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[YahooKeyTip curveWalkingSubCommonWarningToken] forHTTPHeaderField:YahooKeyTip.tatarMaximum.yetCellularSpanishMarkupShowing];
    [self.tagGuration loadRequest:request];
}

- (void)beginOverflowEngineerAuthorAffiliateNineteenSuggested:(NSURL *)URL {
    if ([self.trashOffSpeed respondsToSelector:@selector(lettersView:theOddGolfAction:men:)]) {
        [self.trashOffSpeed lettersView:self.tagGuration theOddGolfAction:URL.host men:URL];
    }
}



- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
    decisionHandler(WKNavigationResponsePolicyAllow);
}


- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
    NSURL *URL = navigationAction.request.URL;
    
    if ([URL.scheme hasPrefix:YahooKeyTip.tatarMaximum.vitalEgg]) {
        [self beginOverflowEngineerAuthorAffiliateNineteenSuggested:URL];
        decisionHandler(WKNavigationActionPolicyCancel);
        return;
    }
    decisionHandler(WKNavigationActionPolicyAllow);
}


-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{

}


- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{
    

}


-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    
    [webView evaluateJavaScript:YahooKeyTip.tatarMaximum.sentSystolicPositionHectaresPopManual completionHandler:nil];
    
    [webView evaluateJavaScript:YahooKeyTip.tatarMaximum.modifyRuleOutsideEndpointAudioBurst completionHandler:nil];
    [webView evaluateJavaScript:YahooKeyTip.tatarMaximum.sliceTooDependentWrittenOne completionHandler:nil];
    
    [PickMinuteView searchingAbortedFullProducingEscapesView:self.view];
    while (self.tagGuration.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.trashOffSpeed respondsToSelector:@selector(lettersView:theOddGolfAction:men:)]) {
        [self.trashOffSpeed lettersView:self.tagGuration theOddGolfAction:message.name men:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [HasAlertView ringMountRemainingMattingGopherPin:@"" message:message completion:^(NSInteger funMapIndex) {
        completionHandler();
    }];
}



- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures{
    WKFrameInfo *frameInfo = navigationAction.targetFrame;
    if (![frameInfo isMainFrame]) {
        [webView loadRequest:navigationAction.request];
    }
    return nil;
}


- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * __nullable result))completionHandler{
    completionHandler(YahooKeyTip.tatarMaximum.fillBackward);
}


- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler{
    completionHandler(YES);
}

- (void)dealloc {
    self.tagGuration.UIDelegate = nil;
    self.view = nil;
    [self.tagGuration.configuration.userContentController removeAllUserScripts];
}

@end
