How to get a list of open tabs from chrome? | C#

前端 未结 4 969
抹茶落季
抹茶落季 2020-12-03 16:25

So I want to extract the open tabs from google chrome (title, URL) and list theme out kind of like in the chrome task manager. So far I have tried to filter all the chrome p

4条回答
  •  爱一瞬间的悲伤
    2020-12-03 16:57

    You can try this:

    AutomationElement root = AutomationElement.FromHandle(process.MainWindowHandle);
    Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.TabItem);
    var tabs = root.FindAll(TreeScope.Descendants, condition);
    

提交回复
热议问题