ReDEnergy / SessionSync

SessionSync
Mozilla Public License 2.0
296 stars 31 forks source link

Support AutoHotKey scripts by creating consistent tabindex hierarchy #92

Open JakubKoralewski opened 4 years ago

JakubKoralewski commented 4 years ago

Feature request

Currently the behavior when you open the extension panel (Ctrl+Shift+F) and try pressing TAB is very weird and inconsistent. I propose for the search to be the first element to be highlighted by first tab press; i.e. setting it to tabindex=0.

Why

This would allow scripting with AutoHotKey to open Firefox, then press Ctrl+Shift+F, then TAB, then write the name of the session, then press TAB again to select the first found session, then open the session with something like Ctrl+Enter.

ReDEnergy commented 4 years ago

Now I understand why tab might be important. Not 100% sure how to design it but I will consider this idea.

JakubKoralewski commented 4 years ago

Not 100% sure how to design it

Assuming the cause of #91 is fixed (I dunno why options would open when pressing tab) then, when creating the search element, create it with the attribute tabindex equal to 0, then when filtering results, loop over the sessions and using i as the loop iteration count set the sessions' tabindex value to i+1, and also for each filtered session add a keypress event listener, check if ctrl is pressed and Enter is the value of the key, then open the session. I think that's it.

ReDEnergy commented 4 years ago

Maybe when I do that the problem from #91 will be fixed. Because it seems to be something automatically created by how Firefox handles the HTML i write and certainly not because I handle tab press in any way because I don't do that right now.