You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2018. It is now read-only.
changed the title [-]After installed chcp , history.go(-1) become userless?[/-][+]After installed chcp , history.go(-1) become useless?[/+]on Dec 24, 2016
You probably already saw a description in the comments, why this is done. But anyways:
When we launch the app - it points to the index.html in the assets folder. But we want it to work with the content from the external storage (where our updated code is placed). So we redirect user to that "external" index.html. But browser (WebView) tracks that in it's history. Without webView.clearHistory() when user clicks back button on the device - he will return to the index page from the assets, and we don't want that.
Same thing will happen if we downloaded new content from the server, installed it and reloaded the page. Again, we are changing the directory and the page. And if user clicks on back button - he will return to the old page.
That's why we clear history when page is initialised. But this might be an issue if you'r app is multy-page application: if for each navigation you load new page in the WebView - then plugin is re-initialised and history get cleaned.
Could we call webView.clearHistory() when HotCodePushPlugin.onEvent(UpdateInstalledEvent event) or onEvent(AssetsInstalledEvent event) fired instead of when init the plugin? @nikDemyankov
😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.
Activity
[-]After installed chcp , history.go(-1) become userless?[/-][+]After installed chcp , history.go(-1) become useless?[/+]neversink commentedon Dec 24, 2016
I found the reason why: when init the chcp plugin, the method call webView.clearHistory(), so can`t go back anymore.
nikDemyankov commentedon Dec 27, 2016
You probably already saw a description in the comments, why this is done. But anyways:
When we launch the app - it points to the
index.html
in theassets
folder. But we want it to work with the content from the external storage (where our updated code is placed). So we redirect user to that "external"index.html
. But browser (WebView) tracks that in it's history. WithoutwebView.clearHistory()
when user clicks back button on the device - he will return to the index page from the assets, and we don't want that.Same thing will happen if we downloaded new content from the server, installed it and reloaded the page. Again, we are changing the directory and the page. And if user clicks on back button - he will return to the old page.
That's why we clear history when page is initialised. But this might be an issue if you'r app is multy-page application: if for each navigation you load new page in the WebView - then plugin is re-initialised and history get cleaned.
AnotherJack commentedon Apr 7, 2017
Could we call webView.clearHistory() when HotCodePushPlugin.onEvent(UpdateInstalledEvent event) or onEvent(AssetsInstalledEvent event) fired instead of when init the plugin? @nikDemyankov
nordnet-deprecation-bot commentedon Sep 19, 2018
👋 Hi! Thank you for your interest in this repo.
😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.
🔒 This will now be closed & locked.
ℹ️ Please see #371 for more information.