Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

After installed chcp , history.go(-1) become useless? #262

Closed
@neversink

Description

@neversink

history.go(-1) is useless, but location.href="" still work.
Why press back button in the phone, directly exit the app?
Thank you very much

Activity

changed the title [-]After installed chcp , history.go(-1) become userless?[/-] [+]After installed chcp , history.go(-1) become useless?[/+] on Dec 24, 2016
neversink

neversink commented on Dec 24, 2016

@neversink
Author

I found the reason why: when init the chcp plugin, the method call webView.clearHistory(), so can`t go back anymore.

nikDemyankov

nikDemyankov commented on Dec 27, 2016

@nikDemyankov
Member

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.

AnotherJack

AnotherJack commented on Apr 7, 2017

@AnotherJack

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

nordnet-deprecation-bot commented on Sep 19, 2018

@nordnet-deprecation-bot
Contributor

👋 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.

locked and limited conversation to collaborators on Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @neversink@nikDemyankov@AnotherJack@nordnet-deprecation-bot

        Issue actions

          After installed chcp , history.go(-1) become useless? · Issue #262 · nordnet/cordova-hot-code-push