Skip to content

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

@aaronm32

Description

@aaronm32

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions