IntegrationManagerVC: enableDebug is now defined in the kit

This commit is contained in:
manuroe
2018-05-07 09:28:39 +02:00
parent 0d6c7b6c8b
commit ce3f22740f
2 changed files with 1 additions and 15 deletions
@@ -19,8 +19,6 @@
#import "WidgetManager.h"
#import "AppDelegate.h"
#import <JavaScriptCore/JavaScriptCore.h>
NSString *const kIntegrationManagerMainScreen = nil;
NSString *const kIntegrationManagerAddIntegrationScreen = @"add_integ";
@@ -147,18 +145,6 @@ NSString *const kJavascriptSendResponseToModular = @"riotIOS.sendResponse('%@',
return url;
}
- (void)enableDebug
{
// Setup console.log() -> NSLog() route
JSContext *ctx = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
ctx[@"console"][@"log"] = ^(JSValue * msg) {
NSLog(@"-- JavaScript: %@", msg);
};
// Redirect all console.* logging methods to console.log
[webView stringByEvaluatingJavaScriptFromString:@"console.debug = console.log; console.info = console.log; console.warn = console.log; console.error = console.log;"];
}
- (void)showErrorAsAlert:(NSError*)error
{
NSString *title = [error.userInfo valueForKey:NSLocalizedFailureReasonErrorKey];