Hello,
I'm using Firefox 58.0.2 and i would like to create a toggle on/off shortcut for viewing/hiding sidebar panel.
A button is there ("show sidebars"), but contrary to History or Bookmarks, no shortcut such as CTRL+H or CTRL+B was assigned to Sidebar.
So could someone give me some hint/script to use with AHK to achieve a TOGGLE ON/OFF sidebars ... with Key "F4", that would be perfect.
(F4 was the key used by "All In One Sidebar", a deprecated addon since Firefox use of Web Extension.)
Have a nice day.
Firefox : toggle on/off sidebar - HELP
Re: Firefox : toggle on/off sidebar - HELP
I was able to invoke the button using the Acc library.
Code: Select all
;[Acc functions]
;Acc library (MSAA) and AccViewer download links - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
q:: ;Mozilla Firefox - toggle show/hide Sidebars
WinGet, hWnd, ID, A
;MsgBox, % Clipboard := JEE_AccGetTextAll(hWnd, "`r`n")
oAcc := Acc_Get("Object", "4.25.10", 0, "ahk_id " hWnd)
if (oAcc.accName(0) = "Sidebars")
oAcc.accDoDefaultAction(0)
oAcc := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Firefox : toggle on/off sidebar - HELP
This is very cool! Can it be adapted to invoke the tab history drop-down? (The one that requires right-click on back-forward button.)
Re: Firefox : toggle on/off sidebar - HELP
- This script right-clicks the Backwards button (commented out code specifies the Forwards button instead).
- Note: Acc is only used to locate the button, the rest is done by the MouseXXX commands.
- Acc can be used to invoke a left-click directly (as shown in commented out code), but I don't know if it can invoke a right-click.
- Note: Acc is only used to locate the button, the rest is done by the MouseXXX commands.
- Acc can be used to invoke a left-click directly (as shown in commented out code), but I don't know if it can invoke a right-click.
Code: Select all
;[Acc functions]
;Acc library (MSAA) and AccViewer download links - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
q:: ;firefox - invoke backwards button drop-down list (tested on Firefox v62)
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "4.25.1", 0, "ahk_id " hWnd) ;Backwards
;oAcc := Acc_Get("Object", "4.25.2", 0, "ahk_id " hWnd) ;Forwards
;oAcc.accDoDefaultAction(0) ;left-click
if !(oAcc.accName(0) = "Backwards")
return
oRect := Acc_Location(oAcc)
vPosX := oRect.x + oRect.w/2
vPosY := oRect.y + oRect.h/2
CoordMode, Mouse, Screen
MouseGetPos, vCurX, vCurY
;MouseMove, % vPosX, % vPosY
MouseClick, R, % vPosX, % vPosY, 1, 0
MouseMove, % vCurX, % vCurY
oAcc := oRect := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Firefox : toggle on/off sidebar - HELP
It works! The number is different for me (4.23.8), and the name is "Back", without "…wards".
Who is online
Users browsing this forum: filipemb and 174 guests