Comments (3)
Can anyone point me if I'm on the right track?
In handleNetworkConnectionChange in cordova-plugin-hostedwebapp\src\android\HostedWebApp.java change
if (this.isConnectionError) {
this.activity.runOnUiThread(new Runnable() {
@Override
public void run() {
String currentUrl = me.webView.getUrl();
me.webView.loadUrlIntoView(currentUrl, false);
}
});
to:
if (this.isConnectionError) {
this.activity.runOnUiThread(new Runnable() {
// try reload the start page every 5 minutes
}
});
( I only need Android)
from manifoldcordova.
Thanks for the post! If I understand correctly, you don't want to show the offline page, you just want cancel the navigation and stay on the page until your online?
from manifoldcordova.
Thank you @boyofgreen for your response.
First, HTTP 5xx responses do not show the offline page. The offline page is for when the device itself is offline (and maybe when a page cannot be reached at all? I should check this to be sure).
Also this issue is not related with the offline page issue/enhancement and for me this issue has higher priority.
The issue is that I have (Android) devices that continually show some webpage. And people using those devices do all kinds of things on that webpage, among which refresh/navigate. But if, at the same moment that they navigate/refresh, I do a server update that fails (I know it should never happen, but...) and my server responses with a HTTP 500 page or maybe a HTTP 502 gateway error or even a HTTP 504 Gateway Timeout, they people are stuck with a page that shows the error.
Because I have hidden the navigation bar, those people have no other option then to restart the device, which is lame. I don't want to show the navigation bar, because I like the extra space on the displays and the navigation bar is also not needed.
By catching the 5xx responses, it would be possible to automatically to retry to load the page, or maybe go to the start_page. (whichever is easier to implement is fine with me) and keep doing this every X minutes untill the page has loaded correctly.
EDIT: Maybe it helps to say that I use the crosswalk plugin. I think it might change the behaviour of the loadUrl function.
from manifoldcordova.
Related Issues (20)
- Cookies cleared on app restart in Android release build HOT 3
- Release version with fix for #82
- HostedWebApp Plugin not working for iOS HOT 1
- Visual studio process
- cordova-plugin-file doesn't work with ManifoldCordova on Windows 10
- Is there a soon coming update? HOT 6
- Error: Cannot find module '../../node_modules/elementtree' HOT 7
- can't been installed in visual studio 2015, character '<' is illegal
- Ho do I handle no Internet case on application start? HOT 1
- missing cordova.js HOT 1
- How to deal with downloads?
- View doesn't shrink when soft keyboard is shown on Android
- Support android v 8.0.0. HOT 1
- Add platform: Invalid or unexpected token HOT 2
- iOS App - Opens safari - Incase url redirections from http to https Web URL HOT 1
- ErrorUrl not working / whitelist issue HOT 2
- Webview cache not being used (iOS) HOT 4
- Superfluous injection into child iframes (iOS) HOT 2
- Does not work with the latest cordova-ios version HOT 6
- Support for WKWebView on iOS HOT 6
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 manifoldcordova.