Count the number of open browser tabs in Firefox and Chrome
<p>I want to make a function that counts the number of open tabs in the browser - Chrome or Firefox - using Java or Python. I know Firefox and Chrome tab counters exist, because there are <em>AddOns</em> and <em>Extensions</em> that achieve that, but I cannot export the value to another function like I want. </p>

<p>Does anyone know the API call?</p>

<p>Unless Firefox exposes an API for other programs (not addons nor extensions) to control and query its internal state (a quick Google search suggests that it doesn't), I suspect you'll be out of luck. </p>

python firefox