Skip to content

About

Find which Chrome tab is playing audio on macOS. Agent skill + CLI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find-chrome-audio-tab

電腦在播音樂,卻找不到是哪個 Chrome 分頁。

macOS 小工具:找出正在出聲的 Chrome(或 Safari)分頁,也可順便確認其實是 Music / Spotify / QuickTime。附一份 agent skill(SKILL.md),給會讀 skill 的編碼助手使用。

Find which Chrome tab is playing audio on macOS. Also checks Safari and a few native players. Ships as a CLI plus an agent skill.

痛點

Chrome 分頁一多,喇叭圖示很容易被擠出視線。休眠外掛(The Great Suspender 一類)又會讓大半分頁看起來「沒在跑」,只剩那一個 YouTube 長時音樂還活著。

Chrome 的 AppleScript 沒有 audible 屬性;「允許 Apple 事件的 JavaScript」預設是關的。對每個分頁注射 JS 會整排失敗,幫不上忙。

這個工具改看仍然可靠的訊號:

  • 視窗標題尾端的 🔊:代表這個視窗裡有分頁在出聲,不一定是目前那一頁
  • 沒被休眠的 YouTube / Spotify 等媒體網址
  • Safari 原生的 audible
  • Music / Spotify / QuickTime 是否其實才是音源

安裝

git clone https://github.com/fred1357944/find-chrome-audio-tab.git
cd find-chrome-audio-tab
./install.sh

會做兩件事:

  1. 把 scripts/find-chrome-audio-tab 接到 ~/bin(請確保 ~/bin 在 PATH)
  2. 把這個目錄接到本機常見的 agent skill 目錄(~/.claude/skills、~/.grok/skills),方便會讀 SKILL.md 的助手載入

只想手動跑、不裝 skill:

python3 scripts/find-chrome-audio-tab

需要 macOS 與系統自帶的 osascript、Python 3。第一次對 Chrome / Safari 發 Apple Event 時,系統可能跳出自動化權限,按允許即可。

用法

find-chrome-audio-tab              # 印出判定
find-chrome-audio-tab --activate   # 判定後把該分頁拉到最前
find-chrome-audio-tab --json       # 給腳本或 agent 吃

範例輸出:

Verdict: Chrome window 1, tab 148
  Title: (無廣告)全天候音樂療法 - YouTube
  URL:   https://www.youtube.com/watch?v=…
  Why:   window title has speaker mark; live media-site tab

Agent skill

任何會載入 SKILL.md 的助手,在你說「哪個分頁在出聲」時應跑這個 CLI,而不是手寫一輪會失敗的 JavaScript 掃描。

授權

MIT. Copyright (c) 2026 Hung Yi Lai.

About

Find which Chrome tab is playing audio on macOS. Agent skill + CLI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages