Closed Bug 1634961 Opened 6 years ago Closed 1 year ago

Add option to list/switch to open tabs in gnome shell search provider

Categories

(Firefox :: Shell Integration, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: ed.bowler, Assigned: msirringhaus)

References

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

Enter the Gnome Shell overview and type the name of an open tab.

Actual results:

The Firefox search provider lists entries from it's browsing history, and when one is selected opens a new tab.

Expected results:

I would like the Firefox search provider to list open tabs and switch to that tab when I select an entry.

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0

Hi,

I will move this enhancement over to a component so developers can take a look over it. If this is not the correct component please feel free to change it to an appropriate one.

Thanks for the suggestion.

Status: UNCONFIRMED → NEW
Component: Untriaged → Widget: Gtk
Ever confirmed: true
Product: Firefox → Core
Version: 75 Branch → Trunk
Component: Widget: Gtk → Shell Integration
Product: Core → Firefox

That involves changes in search mechanism at:
https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/browser/components/shell/nsGNOMEShellSearchProvider.cpp#185

Marco, is there a way how to search opened tabs and switch to them like URL bar does?
Thanks.

Flags: needinfo?(mak)

UrlbarProviderOpenTabs.jsm manages a temp table that is part of the urlbar database connection, it provides a startQuery method that we don't use currently, but could likely be used to query open tabs with a few changes.
Actually, long term you could also just reuse the urlbar model, building an appropriate queryContext and using UrlbarProvidersManager, you could pretty much reproduce the urlbar results where you wish. If we fix 1628016, then you should just create your own manager and query through it...

Unfortunately, all of that is nice for js consumers, but not much for cpp consumers, for which you would have to add some xpcom wrappers.

Flags: needinfo?(mak)

Of course, you could also add your tracking in UrlbarProviderOpenTabs.registerOpenTab and unregisterOpenTab and create your own cache through some xpidl, but it would certainly take up additional memory, so it should be done only when the feature is used.

If you went with adding your own tracking to UrlbarProviderOpenTabs.registerOpenTab and unregisterOpenTab would that mean that when you turn on the option you'd need to build the cache by running a query using the first suggested method, right? Otherwise the cache would only contain tabs opened after the option was enabled. Unless I'm misunderstanding something (which is totally possible, I'm not in anyway familiar with the code), or this is acceptable behaviour ;)

Well, register/unregister happen regardless in the browser, what I meant is mostly that if the additional tracking is only used on Gnome and maybe even just for certain versions, of if a certain Gnome feature is installed, then you should keep a cache only in those cases (not for Mac/Windows or other cases on Linux). That's something you should be able to detect on first call and decide whether to activate your cache or not. It's a memory VS feature decision to take.

I'd like to see this built in as well, would certainly be useful in some situations.

Severity: normal → S3
Attachment #9382807 - Attachment is obsolete: true

I'd be interested to work on this. Marco, is your outline about how it could be implemented still valid? Or is there some better way to do this, these days?

Flags: needinfo?(mak)

The code is pretty much in the same shape. Whether to reuse the existing sqlite temp table, or create a new cpp store (and add/remove through calls from registerOpenTab and unregisterOpenTab) is what should be figured out, I don't know the specifics for the shell side.
I imagine one would create an XPCOM component exposing an api to search, and then use let conn = await lazy.PlacesUtils.promiseLargeCacheDBConnection(); to query the moz_openpages_temp table directly.

Flags: needinfo?(mak)
Assignee: nobody → msirringhaus
Status: NEW → ASSIGNED
Attachment #9421768 - Attachment description: Bug 1634961 - Add option to list/switch to open tabs in gnome shell search provider (r=mak) → WIP: Bug 1634961 - Add option to list/switch to open tabs in gnome shell search provider
Attachment #9421768 - Attachment description: WIP: Bug 1634961 - Add option to list/switch to open tabs in gnome shell search provider → Bug 1634961 - Add option to list/switch to open tabs in gnome shell search provider. r=emilio,stransky
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/3c37521a2e3a Add option to list/switch to open tabs in gnome shell search provider. r=emilio,stransky
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: