Firefox already has this feature built-in:
[shift] or [ctrl] + click on tabs or just right-clikc a tab and select "select all tabs")As for the JS problem, you can't. JS can only work with the sandbox inside its own window context. It cannot access browser features and it certainly cannot access other tabs. That's a security feature and I am glad it exists (no one wants a malicious site to read all open tab info). If you want to create a tool which is able to work in the browser context and can operate on tabs, you will have to create a browser plugin.