@redrum notice that UIAViewer doesn't show the tree for the webpage, and in "Window Info" section the title is empty and window class is different. That means that the context menu is a separate window from the main one and you need to use ElementFromHandle for that separately. Try this:
Code: Select all
+F8::
{
discordImage := UIA.GetFocusedElement()
discordImage.Click("R") ; try ShowContextMenu() as well
if (hWnd := WinWait("ahk_class Chrome_WidgetWin_2",, 1000)) {
Sleep 40 ; this might not be necessary if the UIA tree for the context menu is created fast enough by Brave
contextMenu := UIA.ElementFromHandle(hWnd)
contextMenu.FindElement({Name:"Copy link address"}).Highlight()
}
}