Get the currently focused pane

21 views
Skip to first unread message

Marie-Jean THORAVAL

unread,
Feb 11, 2026, 9:57:42 AM (7 days ago) Feb 11
to zotero-dev
I would like to make a shortcut behave differently depending on which pane is currently focused, for example the libraries and collections pane or the items tree or the PDF Reader.

How can I get which pane is currently focused?

Abe Jellinek

unread,
Feb 11, 2026, 3:00:43 PM (7 days ago) Feb 11
to zoter...@googlegroups.com
I don’t believe there’s a single state variable that tells you which of these you’re in, but you can use separate checks for each:

document.getElementById('zotero-collections-tree').contains(document.activeElement)
document.getElementById('zotero-items-tree').contains(document.activeElement)
window.location.href === 'chrome://zotero/content/reader.xhtml' || window.Zotero_Tabs?.selectedType === 'reader'

On Feb 11, 2026, at 9:35 AM, Marie-Jean THORAVAL <mjtho...@gmail.com> wrote:

I would like to make a shortcut behave differently depending on which pane is currently focused, for example the libraries and collections pane or the items tree or the PDF Reader.

How can I get which pane is currently focused?

--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/zotero-dev/e71c1363-ebdf-449e-ab3f-8e84e2339ceen%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages