delight-im / Android-AdvancedWebView

Enhanced WebView component for Android that works as intended out of the box
MIT License
2.39k stars 574 forks source link

onPageStarted with old/previous url #234

Open ahar-zz opened 5 years ago

ahar-zz commented 5 years ago

Hello,

We use your lib and it looks fine, except for unnecessary call onPageStarted with previous url, which leads to redirect to this url.

Any workaround?

ocram commented 5 years ago

Thanks!

Any chance you could run the project in Source, with its library and sample modules, and make some modifications for debugging purposes?

We think this is related to https://github.com/delight-im/Android-AdvancedWebView/issues/231 and could be solved in the same way.

ahar-zz commented 5 years ago

Already tried that, does not fix the problem. I copied AdvancedWebViewClient to my sources for debug purposes. Turns out that first appearance of old url is in https://github.com/delight-im/Android-AdvancedWebView/blob/master/Source/library/src/main/java/im/delight/android/webview/AdvancedWebView.java#L469 . To be honest, I don't have any further ideas. May be you have? :)

ocram commented 5 years ago

That’s strange.

Could you check if shouldOverrideUrlLoading is called for these requests and if they are perhaps cancelled via return true?

Apart from that, could you check if you have accidentally implemented both WebViewClient#onPageStarted and AdvancedWebView.Listener#onPageStarted?

ahar-zz commented 5 years ago

1) shouldOverrideUrlLoading - is not called for these requests. 2) I had that, but know I don't implement them in my code. Only onPageStarted from AdvancedWebView.Listener.

Just FYI this bug is not permanent, it has strange nature, it appears and disappears by itself.

ocram commented 5 years ago

Thanks for the additional information – and sorry, for now, we don’t have any solution since we don’t know what may be causing these problems.