Comments (14)
@SPopenko Thanks reporting. I'll check that website.
from njkwebviewprogress.
@SPopenko I've tried several times to access Toysrus site, and problem happened only one time. I'm looking for condition what caused this problem. Do you know how to represent it?
from njkwebviewprogress.
@ninjinkun I think that it happens when page has error in load and system trigger didFailLoadWithError
Most probably it could be when block executed twice for the same page. On error and on start load triggers.
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);", completeRPCURL];
[webView stringByEvaluatingJavaScriptFromString:waitForCompleteJS];
}
from njkwebviewprogress.
@SPopenko Thanks to your suggestion. It represented under bad network with Network Link Conditioner. I'll try to solve it.
from njkwebviewprogress.
I'm noticing an issue like this as well where sometimes a page doesn't reach 100%. Some will get about half way, some will only reach 10%.
If you attempt to view a github.com page, this can happen. Could this be related to history API?
from njkwebviewprogress.
I can confirm the problem for me is related to your JS on load event listener. The iframe never loads so the completeRPCURL is never requested.
A small change I made that is looking reliable, instead of using an iframe, just using a window.location:
[NSString stringWithFormat:@"window.addEventListener('load',function() { window.location = '%@'; }, false);", completeRPCURL];
from njkwebviewprogress.
Hey @ninjinkun, do you think solution suggested by @stevemckenzie good enough to integrate it in the new release? :)
from njkwebviewprogress.
@stevemckenzie window.location =
causes to override UIWebView referred URL.
But your suggestion was big hint. I found incomplete problem is caused by Content Security Policy. They refused iframe from other domain.
I'm planning that fall back to window.location
when iframe is refused, or change PRC URL scheme and domain to content URL.
from njkwebviewprogress.
@ninjinkun this sounds like a good plan. Could you let us know please when you make new release?
from njkwebviewprogress.
@ninjinkun but because you return NO in the shouldStartLoadWithRequest delegate method, isn't it fine? I've used this method to relay info back to the delegate before.
from njkwebviewprogress.
@stevemckenzie You are right. I even thought window.location
affects current URL. But I can't find any problem with shouldStartLoadWithRequest
returns NO as your suggestion.
I research two methods again.
window.location
orlocation.href
- can handle single request
- IFrame
- can handle multiple request
- used Cordova, WebViewJavascriptBridge
- NJKWebViewProgress original design is inspired by Cordova
NJKWebViewProgress can use both two methods for single complete request.
However, I don't want to change method for conservative reason. Currently IFrame works fine without the site using Content Security Policy. And this CSP problem can avoid with #27. I want to go using proven IFrame method.
Do you have any reason to use window.location
?
@SPopenko I made pull request with new RPC URL for avoid Content Security Policy. Please try this version. #27
from njkwebviewprogress.
@ninjinkun thanks for this pull, it looks like it works for me!
from njkwebviewprogress.
@SPopenko Thank you!
from njkwebviewprogress.
@ninjinkun
I'm sorry so long time for issue.
I use new source NJKWebViewProgress on GIT. but this issue still happen. Can you support me how to fix it. thanks!
from njkwebviewprogress.
Related Issues (20)
- when I start up my App ,it's crash? HOT 1
- Swift Alternative HOT 1
- Can't load complete on iOS8
- why I entry controller first show the whole progressBar?
- isFragmentJump In the FirstLoad Maybe has something wrong
- 为什么不能自己写进度条的颜色 HOT 1
- It seems to have conflict with the rich text loaded with WebView
- It seems to have conflict with WebViewJavascriptBridge HOT 2
- 为什么增加waitForCompleteJS
- loadlocalHTML,have a Fragment#0, but cant show
- Add maintainers? HOT 1
- Why can't write their own progress bar color?
- bug (click a link and then go back and then click the link again, it may cause progress never complete )
- Expand unit tests
- How to use in WKWebView ? HOT 1
- 还更新吗? HOT 3
- the progress never finish! HOT 1
- 有些链接进度条一直卡到一半不动了
- bug(njkwebviewprogressproxy/complete)404
- Updating Apps that Use Web Views HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from njkwebviewprogress.