可以使用鼠标触发右键来运行组合动作实现,最好把浏览器设置白名单,
组合动作里有个“获取鼠标指针位置控件信息”能检测到选项卡,这样应该比像素定位要好,
简单测试了下,应该可以满足你的需求,右键单击选项卡关闭,网页浏览界面右键不影响,
用那个Xpath,来定位应该更好,但那个我不会整,就用的ControlType来定位的,测试了三个浏览器,EDGE,360,傲游,
每个浏览器的ControlType定义都不一样,我就把三个的ControlType都写进判断了,可以用停运的第二个步骤组,来检测一下你自己的浏览器ControlType的定义,
性能虽然比较差,权当提供一点思路吧。
换成json,然后导入一下。
{
"Row": 2,
"Col": 3,
"ActionType": 24,
"Title": "测试2",
"Description": "",
"Icon": "fa:Light_PageBreak",
"Path": null,
"DelayMs": 0,
"Data": "{\"LimitSingleInstance\":false,\"SummaryExpression\":\"$$\",\"SubPrograms\":[],\"Variables\":[{\"Key\":\"controlType\",\"Type\":0,\"Desc\":\"\",\"DefaultValue\":\"\",\"SaveState\":false,\"IsInput\":false,\"IsOutput\":false,\"ParamName\":\"\",\"InputParamInfo\":null,\"OutputParamInfo\":null},{\"Key\":\"element\",\"Type\":99,\"Desc\":\"\",\"DefaultValue\":\"\",\"SaveState\":false,\"IsInput\":false,\"IsOutput\":false,\"ParamName\":\"\",\"InputParamInfo\":null,\"OutputParamInfo\":null}],\"Steps\":[{\"StepRunnerKey\":\"sys:group\",\"InputParams\":{},\"OutputParams\":{},\"IfSteps\":[{\"StepRunnerKey\":\"sys:flauiautomation\",\"InputParams\":{\"type\":{\"VarKey\":null,\"Value\":\"GetCursorPointControlInfo\"},\"stopIfFail\":{\"VarKey\":null,\"Value\":\"1\"}},\"OutputParams\":{\"isSuccess\":null,\"value\":null,\"rect\":null,\"controlName\":null,\"controlType\":\"controlType\",\"controlXPath\":null,\"controlTypeId\":null,\"controlInfo\":null,\"element\":null},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false},{\"StepRunnerKey\":\"sys:if\",\"InputParams\":{\"condition\":{\"VarKey\":null,\"Value\":\"$= {controlType}.Contains(\\\"TabItem\\\") || {controlType}.Contains(\\\"Text\\\") || {controlType}.Contains(\\\"Window\\\")\"}},\"OutputParams\":{},\"IfSteps\":[{\"StepRunnerKey\":\"sys:keyInput\",\"InputParams\":{\"keys\":{\"VarKey\":null,\"Value\":\"{\\\"CtrlKeys\\\":[17],\\\"Keys\\\":[87]}\"}},\"OutputParams\":{},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false}],\"ElseSteps\":[{\"StepRunnerKey\":\"sys:mouse\",\"InputParams\":{\"type\":{\"VarKey\":null,\"Value\":\"click\"},\"btn\":{\"VarKey\":null,\"Value\":\"right\"}},\"OutputParams\":{},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false},{\"StepRunnerKey\":\"sys:quickeroperations\",\"InputParams\":{\"type\":{\"VarKey\":null,\"Value\":\"reinstallMouseHook\"}},\"OutputParams\":{},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false}],\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false}],\"ElseSteps\":[],\"Note\":null,\"Disabled\":false,\"Collapsed\":false},{\"StepRunnerKey\":\"sys:group\",\"InputParams\":{},\"OutputParams\":{},\"IfSteps\":[{\"StepRunnerKey\":\"sys:flauiautomation\",\"InputParams\":{\"type\":{\"VarKey\":null,\"Value\":\"GetCursorPointControlInfo\"},\"stopIfFail\":{\"VarKey\":null,\"Value\":\"1\"}},\"OutputParams\":{\"isSuccess\":null,\"value\":null,\"rect\":null,\"controlName\":null,\"controlType\":\"controlType\",\"controlXPath\":null,\"controlTypeId\":null,\"controlInfo\":null,\"element\":\"element\"},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false},{\"StepRunnerKey\":\"sys:showText\",\"InputParams\":{\"type\":{\"VarKey\":null,\"Value\":\"NO_WAIT\"},\"text\":{\"VarKey\":\"element\",\"Value\":null},\"title\":{\"VarKey\":null,\"Value\":\"结果内容\"},\"topMost\":{\"VarKey\":null,\"Value\":\"false\"},\"operations\":{\"VarKey\":null,\"Value\":\"\"},\"autoCloseKey\":{\"VarKey\":null,\"Value\":\"\"},\"winLocation\":{\"VarKey\":null,\"Value\":\"CenterScreen\"},\"winSize\":{\"VarKey\":null,\"Value\":\"\"},\"fontsize\":{\"VarKey\":null,\"Value\":\"14\"},\"fontfamily\":{\"VarKey\":null,\"Value\":\"\"},\"bgColor\":{\"VarKey\":null,\"Value\":\"\"},\"textColor\":{\"VarKey\":null,\"Value\":\"\"},\"highlight\":{\"VarKey\":null,\"Value\":\"\"},\"autoSaveToState\":{\"VarKey\":null,\"Value\":\"\"},\"closeWhenLostFocus\":{\"VarKey\":null,\"Value\":\"false\"},\"showLineNum\":{\"VarKey\":null,\"Value\":\"true\"},\"autoWrap\":{\"VarKey\":null,\"Value\":\"true\"},\"showBuildInToolbar\":{\"VarKey\":null,\"Value\":\"true\"},\"copyWholeLine\":{\"VarKey\":null,\"Value\":\"false\"}},\"OutputParams\":{},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false}],\"ElseSteps\":[],\"Note\":null,\"Disabled\":true,\"Collapsed\":false}]}",
"Data2": null,
"Data3": null,
"Children": null,
"Id": "3eab70e1-b857-44a0-b7d6-10a05c93e0a2",
"TemplateId": null,
"TemplateRevision": 0,
"UseTemplate": false,
"LastEditTimeUtc": "2021-10-05T16:09:26.9672646+08:00",
"SharedActionId": "",
"ShareTimeUtc": null,
"CreateTimeUtc": "2021-10-05T13:24:32.2314769Z",
"AsSubProgram": false,
"SkipWhenStopRunningActions": false,
"SkipCheckUpdate": false,
"AutoUpdate": false,
"KeepInfoWhenUpdate": false,
"MinQuickerVersion": "",
"ContextMenuData": "",
"AllowScrollTrigger": false,
"EnableEvaluateVariable": false,
"IsTextProcessor": false,
"IsImageProcessor": false,
"Association": {
"MatchProcess": null,
"IsImageProcessor": false,
"ReturnImageFromFirstScreenShotStep": true,
"IsTextProcessor": false,
"ReturnTextFromGetSelectedTextStep": true,
"TextMatchExpression": "",
"TextMinLength": 0,
"TextMaxLength": 0,
"IsHtmlProcessor": false,
"IsFileProcessor": false,
"FileMinCount": 0,
"FileMaxCount": 0,
"AllowedFileExtensions": "",
"RequireAllFileMatchExt": false,
"SearchBoxPlaceholder": "",
"IsWindowProcessor": false,
"EnableRealtimeSearch": false
},
"DoNotClosePanel": false
}