Git Product home page Git Product logo

cordova-plugin-migrate-localstorage's Introduction

Migrate LocalStorage

This plugin can be used in conjunction with cordova-plugin-wkwebview-engine to persist LocalStorage data when migrating from UIWebView to WKWebView. All related files will be copied over automatically during startup so the user can simply pick up where they left of.

How to use

Simply add the plugin to your cordova project via the cli:

cordoa plugin add cordova-plugin-migrate-localstorage

Notes

  • LocalStorage files are only copied over once and only if no LocalStorage data exists for WKWebView yet. This means that if you've run your app with WKWebView before this plugin will likely not work. To test if data is migrated over correctly:

    1. Delete the app from your emulator or device
    2. Remove the cordova-plugin-wkwebview-engine and cordova-plugin-migrate-localstorage plugins
    3. Run your app and store some data in LocalStorage
    4. Add both plugins back
    5. Run your app again. Your data should still be there!
  • Once the data is copied over, it is not being synced back to UIWebView so any changes done in WKWebView will not persist should you ever move back to UIWebView. If you have a problem with this, let us know in the issues section!

Background

One of the drawbacks of migrating Cordova apps to WKWebView is that LocalStorage data does not persist between the two. Unfortunately, cordova-plugin-wkwebview-engine does not offer a solution for this out of the box (see https://issues.apache.org/jira/browse/CB-11974?jql=project%20%3D%20CB%20AND%20labels%20%3D%20wkwebview-known-issues).

cordova-plugin-migrate-localstorage's People

Contributors

maklesoft avatar mhartington avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.