Skip to content

Instantly share code, notes, and snippets.

@bhousel
Last active August 29, 2015 14:16
Show Gist options
  • Save bhousel/693172d34b84aaf1a88e to your computer and use it in GitHub Desktop.
Save bhousel/693172d34b84aaf1a88e to your computer and use it in GitHub Desktop.
Browser History Transplant for #iD

##iD history transplant

###Browser 1

  • Open "Help" and start walkthrough

  • Open developer console

  • Change "main frame/top frame" to "id-embed" if necessary, eg. running from openstreetmap.org

  • Run this:

      (function getHistory() {
          function getKey(n) { return 'iD_' + window.location.origin + '_' + n; }
          return id.storage(getKey('saved_history'));
      })();
    
  • Save output someplace. Change outermost " to ' if necessary

###Browser 2:

  • Open "Help" and start walkthrough

  • Open developer console

  • Run this:

      json = 'PASTE YOUR STUFF HERE';
      (function putHistory(json) {
          function getKey(n) { return 'iD_' + window.location.origin + '_' + n; }
          return id.storage(getKey('saved_history'), json);
      })(json);
    
  • Close iD window

  • The next time you open a new iD window, you will be prompted to restore your history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment