Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NJKWebViewProgress/NJKWebViewProgress.m
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView
BOOL interactive = [readyState isEqualToString:@"interactive"];
if (interactive) {
_interactive = YES;
NSString *waitForCompleteJS = [NSString stringWithFormat:@"window.addEventListener('load',function() { var iframe = document.createElement('iframe'); iframe.style.display = 'none'; iframe.src = '%@://%@%@'; document.body.appendChild(iframe); }, false);", webView.request.mainDocumentURL.scheme, webView.request.mainDocumentURL.host, completeRPCURLPath];
NSString *waitForCompleteJS = [NSString stringWithFormat:@"function notifyLoading(){ var iframe = document.createElement('iframe'); iframe.style.display = 'none'; iframe.src = '%@://%@%@'; document.body.appendChild(iframe); }; var whenReady = function(callback) { if (document.readyState === 'complete') { callback(); } else if (document.addEventListener) { document.addEventListener('DOMContentLoaded', callback); } }; whenReady(notifyLoading());", webView.request.mainDocumentURL.scheme, webView.request.mainDocumentURL.host, completeRPCURLPath];
[webView stringByEvaluatingJavaScriptFromString:waitForCompleteJS];
}

Expand Down