!7

p-exp {
  File profile = mozillaDefaultProfileDir();
  if (profile == null) ret with print("No default Mozilla profile found");
  Map data = cast decodeMozillaJSONLZ4File(newFile(profile, "sessionstore-backups/recovery.jsonlz4"));
  if (data == null) ret with print("No session found");
  //pnlStruct(data);
  int iWindow = 0;
  for (Map window : unnull((L<Map>) data.get("windows"))) {
    print("\nWindow " + (++iWindow));
    print(keys(window));
    print("selected: " + window.get("selected"));
    for (Map tab : unnull((L<Map>) window.get("tabs"))) {
      print(keys(tab));
      int index = toInt(tab.get("index"))-1;
      L<Map> entries = cast tab.get("entries");
      //print("entries: " + l(entries) + ", index=" + index);
      //printStruct(tab);
      Map entry = entries.get(index);
      //printStruct(entry);
      S title = cast entry.get("title");
      S url = cast entry.get("url");
      print(entry.get("attributes"));
      print(title);
      print("  " + url);
    }
  }
}