Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Is it possible to disable offline page completely (in the manifold for example)? #61

Closed
gabn88 opened this issue Feb 18, 2016 · 6 comments
Milestone

Comments

@gabn88
Copy link

gabn88 commented Feb 18, 2016

I'm aware of hostedwebapp.disableOfflinePage(), but that only loads after deviceready has fired and I'm afraid that if a device is offline it will go to the offline page, before that this function is called.

@boyofgreen
Copy link
Contributor

Sure, what is the expected behavior if your offline, would you want them to get an error or are you having other content you pointing to?

@gabn88
Copy link
Author

gabn88 commented Feb 18, 2016

The default cordova behaviour is to keep the page the same, and only show an error after a link is clicked (then it finds out that the internet connection is lost and then it ends/kills the application with this error).

I would like to keep the page the same (so no offline page or whatsever, maybe a small

<div>Offline</div> 

on the page) and when a user clicks a link that it shows an alert('No connection!') and stays on the same page. This is ideal. But the cordova default is already better for my application then the offline page.

@gabn88
Copy link
Author

gabn88 commented Feb 22, 2016

I don't want to push, but do you think this would be possible? I have no experience with writing java , but it doesn't seem to hard (I'm looking at the Android code, as I'm only targetting Android anyway).

Just the option to disable it would be enough for me.

@boyofgreen
Copy link
Contributor

Hi @gabn88 let me talk to the guys who focus on android, we should be able to make an easy way to go back

@mattwoberts
Copy link

+1 for this.

I'm having problems getting the offline page to work in ios (#59)

However, using cordova-network-information via the javascript api DOES work fine.. So I can use that to handle the device going off/on-line. BUT - I need to disable the manifold offline page in entirety to get this to work.

Thanks

Matt

@boyofgreen boyofgreen added this to the release-0.3 milestone Apr 13, 2016
vjrantal added a commit to vjrantal/ManifoldCordova that referenced this issue Apr 19, 2016
The feature can be enabled with mjs_offline_feature property in the
manifest.json file.

Fixes pwa-builder#61.
@vjrantal
Copy link
Contributor

I also had a case where I wanted to disable the offline feature and also get rid of the extra WebViews that are created for it. I created #68 as a draft about an option how it could be made optional.

@boyofgreen: I have a feeling that it is somewhat a "no-brainer" to allow optionally getting rid of the offline feature, but probably the biggest discussion point is should it be opt-in or opt-out. In my initial PR above, I changed the feature opt-in, because I feel that it is a ManifoldJS-specific thing that might come as a "surprise" for a regular Web developer unless explicitly turned on.

I am happy to amend my commit based on the discussion and feedback, but just wanted to throw it out there to get a feeling what others think about this.

boyofgreen added a commit that referenced this issue Apr 25, 2016
Allow disabling the offline feature. fixes issue #61
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants