Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

29
LINES

< > BotCompany Repo | #1019813 // Get tabs from Firefox Spike 2 [OK on Windows & Linux - just lags a few seconds until Firefox writes session to disk]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (6397L/46K).

!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));
      print(tab.get("attributes"));
      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(title);
      print("  " + url);
    }
  }
}

Author comment

Began life as a copy of #1019807

download  show line numbers  debug dex  old transpilations   

Travelled to 10 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019813
Snippet name: Get tabs from Firefox Spike 2 [OK on Windows & Linux - just lags a few seconds until Firefox writes session to disk]
Eternal ID of this version: #1019813/16
Text MD5: 4dbe5051c6d4b96e39b65273a2706a67
Transpilation MD5: af94bce5c51022ef02423916022afcc3
Author: stefan
Category: javax / firefox
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-27 02:41:00
Source code size: 1031 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 298 / 814
Version history: 15 change(s)
Referenced in: [show references]