Automatically show and hide the Bookmark Bar in Chrome and Chrome-based browsers

Post your working scripts, libraries and tools
User avatar
hasantr
Posts: 207
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Automatically show and hide the Bookmark Bar in Chrome and Chrome-based browsers

17 Jul 2019, 07:16

Automatically show and hide the Bookmark Bar in Chrome and Chrome-based browsers
You need to set Control + Shift + B as the Show Address Bar shortcut to work in the Opera.

Code: Select all

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#NoEnv
#Persistent 
#singleinstance, force 
SetTitleMatchMode 2
WinWaitActive, ahk_class Chrome_WidgetWin_1
SetTimer, WatchCursor, 50
DetectHiddenWindows, On ; for special win
CoordMode, Mouse, Screen 
return

WatchCursor:
IfWinActive, ahk_class Chrome_WidgetWin_1
{
	MouseGetPos, Xm, Ym, id, control 
	WinGetTitle, title, ahk_id %id% 
	WinGetClass, class, ahk_id %id% 
	WinGetPos, Xw, Yw,,, %title% 
	Xr := Xm - Xw 
	Yr := Ym - Yw
	Xs := Xm - Xws
	Ys := Ym - Yws
	ControlGetPos, cx, cy, cw, ch, Chrome_RenderWidgetHostHWND1,  ahk_class Chrome_WidgetWin_1
	WinGetPos, pencereX, pencereY, pencereW, pencereH,  ahk_class Chrome_WidgetWin_1
	sonuc := pencereH
	sonuc -= % ch
	if sonuc >= 120
		ch += 33
	IfWinActive, Vivaldi ahk_class Chrome_WidgetWin_1
		return
	pencereW -= 50
	pencereHAzalt := pencereH - 100
	
	if (xs <= pencereW)	
		if (ys <= 80 and if ys >= 49 and xs >= 180 and xs <= pencereW)
		{
			if (ch >= pencereHAzalt)
			{	
				SendInput, ^+{b}
			}
		}
	else
	{
		if (ch <= pencereHAzalt and ys >= 110 )
		{	
			SendInput, ^+{b}
		}
	}
}
return
~LButton::
sleep 100
IfWinActive, ahk_class Chrome_WidgetWin_1
{
	WinGetPos, Xws, Yws,,, A
	return
}
Attachments
ChromeToolbarAutoHide.gif
ChromeToolbarAutoHide.gif (326.23 KiB) Viewed 193 times
Last edited by hasantr on 18 Jul 2019, 03:53, edited 1 time in total.
User avatar
hasantr
Posts: 207
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Automatically show and hide the Bookmark Bar in Chrome and Chrome-based browsers

18 Jul 2019, 03:35

When the download bar came out, it was interfering. Now it is OK.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: robodesign, TheBeginner, tmplinshi and 37 guests