4

They are simmilar questions like follow already, with solutions, for older Firefox versions:

What is different on actual Firefox versions like p.e. 82.x and newer:

  • no sessionstore.js located in ~/.mozilla/firefox/*.default/sessionstore.js
  • no recovery.js located in ~/.mozilla/firefox/*.default/sessionstore-backups/recovery.js

How to get the url of actual active Firefox tab from actual active workspace on debian or ubuntu, output by bash like follow ?

echo $actual_url

Remark: "The following files are used to store session data:

sessionstore.jsonlz4 - The state of the browser during the last shut down.
sessionstore-backups/recovery.jsonlz4 - The current state of the browser
sessionstore-backups/recovery.baklz4 - The previous version of recovery.jsonlz4
sessionstore-backups/previous.jsonlz4 - The state of the browser during the second to last shut down.
sessionstore-backups/upgrade.jsonlz4-[timestamp] - The state of the browser before an upgrade"

Source: https://www.foxtonforensics.com/blog/post/analysing-firefox-session-restore-data-mozlz4-jsonlz4

Alfred.37
  • 159

2 Answers2

1

One alternate way to the asked way by bash and the successor of sessionstor.js, to get the actual url of active browser of active browser tab by bash are the follow ( its sometimes echo p.e "c" and one other like about "[[xx" by unknown reasons to terminal, browser or to forms:

# set focus to adress on browser tab
xdotool search --onlyvisible --classname Navigator windowactivate --sync key F6

copy adress from browser tab

xdotool search --onlyvisible --classname Navigator windowactivate --sync key Ctrl+c

get off the focus from adress from browser tab

xdotool search --onlyvisible --classname Navigator windowactivate --sync key F6

delivery of clipboard content to variable

clipboard=xclip -o -selection clipboard

clear clipboard

xsel -bc; xsel -c

echo URL of active tab of active browser

echo $clipboard

Alfred.37
  • 159
0

One other alternate, to the asked way by bash, can be possible by javascript:

The file looks like compressed by (LZ4):

/sessionstore-backups/recovery.jsonlz4

JavaScript

let file = 'pfadZurDatei.jsonlz4';
OS.File.read(file, { compression: 'lz4' }).then(bytes => {
    OS.File.writeAtomic(
        file + '.json',
        JSON.stringify(JSON.parse(new TextDecoder().decode(bytes)), null, 1)
    )
});

Source: https://www.camp-firefox.de/forum/thema/131676-bash-linux-firefox-ermittelung-der-url-der-aktuell-aufgerufenen-webseite/?postID=1159695#post1159697

Alfred.37
  • 159