Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

catching JS log on xcode console using web view

can any one help me in catching the JS log message on xcode console, JS has to be run on web view (UIWebView).

like image 770
sudhanshu.swastik Avatar asked May 17 '26 17:05

sudhanshu.swastik


1 Answers

to receive message from one webview use custom url scheme just like "log:yourlogmsg"

js code

window.location = "log:yourlogmsg";

use

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

and return false;

like image 158
adali Avatar answered May 20 '26 07:05

adali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!