Chrome Extension获取在YouTube音乐上播放的音乐的细节
我想创建一个Chrome Extension,我需要获取YouTube音乐中正在播放的音乐的详细信息。有什么办法可以做到这一点(也许使用JS获取音乐的名称或其他方式)。感谢任何帮助
I want to create a Chrome Extension and I need to get the details of the music that is being played on YouTube Music. Is there any way to do that (maybe using JS to get the name of the music or whatever). Any kind of help is appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在YouTube音乐网站上运行内容脚本&应用并解析HTML以获取所需的信息。这是带有懒惰代码的快速脚本。显然,您应该更好地进行检测和错误处理。
清单:
内容脚本:
You can run content scripts on the Youtube Music website & app and parse the HTML to get the info you need. Here's a quick script with lazy code. You should obviously do the detection and error-handling better.
Manifest:
Content Script: