Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: firefox tabs #107

Open
pinpox opened this issue Mar 27, 2024 · 6 comments
Open

Feature request: firefox tabs #107

pinpox opened this issue Mar 27, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request plugin

Comments

@pinpox
Copy link
Contributor

pinpox commented Mar 27, 2024

It would be awesome to be able to select firefox tabs, since I don't use brave.

@a-kenji a-kenji added enhancement New feature or request plugin labels Mar 27, 2024
@friedow
Copy link
Owner

friedow commented Mar 27, 2024

This is only fitting since we have bookmarks and history in tickets already. The most interesting question for this is: Where are Firefox tabs stored at runtime?

@nettybun
Copy link

Firefox stores all open tabs, history, and bookmarks in the same places.sqlite database file in the Firefox user profile directory. It's partially documented here: https://firefox-source-docs.mozilla.org/browser/places/architecture-overview.html#storage

It should be safe to open the database with a new readonly connection and read out the tabs.

I know there's a risk of needing to keep SQL statements up to date as Firefox updates, but this is also a very old part of the codebase and I'd be surprised if they ever change the tables/columns.

@friedow
Copy link
Owner

friedow commented Mar 28, 2024

Thank you @nettypurr! That should be an easy plugin then. Brave history is also stored in an sqlite database, so it should be mostly copy & past with some adjustments to the file location and query :).

@pinpox
Copy link
Contributor Author

pinpox commented Mar 28, 2024

How does centerpiece make brave focus the correct tab after having selected it from the list of open ones?

@friedow
Copy link
Owner

friedow commented Mar 28, 2024

We don't have an integration for Brave Tabs yet :P. But there is https://github.com/prasmussen/chrome-cli which might give some hints on how to do it because it can chrome-cli open <url> -t <id> (Open url in specific tab).

@friedow
Copy link
Owner

friedow commented May 26, 2024

I've implemented a proof of concept for reading and displaying the firefox tabs on this branch: https://github.com/friedow/centerpiece/blob/feat/firefox-tabs/client/src/plugin/firefox/tabs.rs. This works differently then initially though. Turns out firefox does not save the current session in the places.sqlite file. Instead there is a lz4 compressed json file which needs to be read to get the currently open tabs.

However, I'm now stuck at the problem that there is no way to tell firefox to focus an open tab if a tab with the given url already exists. Any ideas?

@friedow friedow self-assigned this May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin
Projects
None yet
Development

No branches or pull requests

4 participants