Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Fullscreen mode toggle in UIA_Browser #53

Open
aaronm32 opened this issue Dec 12, 2024 · 0 comments
Open

[Feature Request]: Fullscreen mode toggle in UIA_Browser #53

aaronm32 opened this issue Dec 12, 2024 · 0 comments

Comments

@aaronm32
Copy link

aaronm32 commented Dec 12, 2024

It would be useful if the UIA_Browser had a built in function for toggling the browser's full screen mode. I have a simple custom function that does this, but it would be nice if it was a built in part of UIA. Things like navigate, back, forward, home don't work correctly while in full screen mode because the navigation bar is hidden. UIA_Browser could first check if the browser is in full screen mode prior to navigate and toggle it. This is the function i have been using, which checks if the minimize button exists to know if full screen mode is enabled and hits the f11 key to either enable or disable it based on the desired parameter value.

WinWaitActive("ahk_exe chrome.exe")
global browser_hWnd := "ahk_id " . WinExist()
global wb := UIA_Browser(browser_hWnd)

fsmode(enablefs:=True) {
    loop{
        minimize_element:= wb.WaitElement({Type:"Button", Name:"Minimize"},2000)
        if(minimize_element)
            fsmode:=false
        Else
            fsmode:=True
        if(enablefs != fsmode){
            WinActivate(browser_hWnd)
            wb.GetCurrentDocumentElement().Click()
            wb.ControlSend("{F11}")
            Sleep(1000)
        }    
        Sleep(1000)
    }until enablefs = fsmode
    return fsmode
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant