I used to do that on firefox using a python command, but recently something changed and I can't get the URL anymore!

* What used to work with firefox:

```
#!/bin/bash
current_tab_num () {
    python2 <<< $'import json\nf = open("/home/username/.mozilla/firefox/xxxxx.default/sessionstore.js", "r")\njdata = json.loads(f.read())\nf.close()\nprint str(jdata["windows"][0]["selected"])'
}
current_tab_url () {
    sed -n "$(current_tab_num)p" <(python2 <<< $'import json\nf = open("/home/username/.mozilla/firefox/xxxxx.default/sessionstore.js", "r")\njdata = json.loads(f.read())\nf.close()\nfor win in jdata.get("windows"):\n\tfor tab in win.get("tabs"):\n\t\ti = tab.get("index") - 1\n\t\tprint tab.get("entries")[i].get("url")')
}
current_tab_url

```

Can anyone tell me how to do this in firefox and/or chrome ?

***NOTE*** : I don't understand python, I just found those commands somewhere and used them in bash!