Posts: 53
Threads: 18
Joined: Feb 2014
Hello,
I'm trying to set the browse back button on my mouse to do this:
- browse back when this function is active (the current page was opened in the same tab following a link)
- close tab if the current page was opened in a new tab from a link found in another tab (browse back not active in this case) - (in this way return to the page where the link was)
Any ideas?
Thanks
Posts: 12,097
Threads: 142
Joined: Dec 2002
Macro
Chrome back or close tab
Trigger
F7
;find Back button
int w=win("- Google Chrome" "Chrome_WidgetWin_1")
if(!w) ret
Acc a.Find(w "TOOLBAR" "Google Chrome Toolbar|main" "" 0x1082)
a.Find(a.a "BUTTONDROPDOWN" "Back" "" 0x1005)
;is it disabled?
if a.State&STATE_SYSTEM_UNAVAILABLE ;;disabled
,OnScreenDisplay "close" 1
else
,OnScreenDisplay "back" 1
Posts: 53
Threads: 18
Joined: Feb 2014
Posts: 53
Threads: 18
Joined: Feb 2014
Hello
Can you help me again.
The previous code seems to be broken.
Probably a change in chrome.
Also, can you tell me a way to adjust the code by myself? A tool to find the back button identification code and state.
Thank you.
Posts: 12,097
Threads: 142
Joined: Dec 2002
Toolbar name changed to "main". I changed the macro in the first post, now it is compatible with old and new Chrome versions.
The tool is "Find accessible object" dialog. Look in QM floating toolbar.
Posts: 53
Threads: 18
Joined: Feb 2014
Thanks,
My version is slower
find Back button
int w=win("- Google Chrome" "Chrome_WidgetWin_1")
if(!w) ret
Acc a.Find(w "BUTTONDROPDOWN" "Back" "class=Chrome_WidgetWin_1[]state=0x40100000 0" 0x100A)
is it disabled?
if a.State&STATE_SYSTEM_UNAVAILABLE ;;disabled
OnScreenDisplay "close" 1
else
OnScreenDisplay "back" 1