You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac系统下借助虚拟键盘实现Chrome扩展下拉滚动的脚本问询

适用于Mac的Chrome/Firefox扩展弹窗滚动脚本方案

注意:运行脚本前需要先点击扩展图标,让扩展弹窗处于可见激活状态,首次运行需要给脚本运行工具开启「系统设置→隐私与安全性→辅助功能」权限。

Chrome 扩展滚动脚本(AppleScript)

直接复制以下代码使用,滚动幅度可自行调整数值:

tell application "System Events"
	tell application process "Google Chrome"
		set frontmost to true
		set extPopup to first window whose subrole is "AXUnknown" and description is "dialog"
		tell extPopup
            -- 向下滚动150像素,数值可自定义,向上滚动替换为scroll up
			scroll down by 150
            -- 如需直接滚动到底部,替换上面一行为 scroll to bottom
		end tell
	end tell
end tell

Firefox 扩展滚动脚本(AppleScript)

仅需修改进程名即可适配Firefox:

tell application "System Events"
	tell application process "Firefox"
		set frontmost to true
		set extPopup to first window whose subrole is "AXUnknown" and description is "dialog"
		tell extPopup
			scroll down by 150
		end tell
	end tell
end tell

绑定到虚拟功能键的方法

  • 打开Mac自带「自动操作(Automator)」,新建类型为「快速操作」的项目
  • 左侧搜索「运行AppleScript」动作,拖拽到右侧编辑区域,替换默认内容为上面的对应脚本
  • 保存项目,自定义命名比如「Chrome扩展滚动」
  • 打开「系统设置→键盘→快捷键→服务」,找到刚才保存的快速操作,直接绑定到你需要的虚拟键盘功能键即可
  • 也可以直接将脚本导入你正在使用的虚拟键盘工具的自定义动作库,关联对应功能按键触发

内容的提问来源于stack exchange,提问作者Александр Брайловский

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.25 23:54:03