Get browser's active MediaSession data via extension API

277 views Asked by At

Using a Chrome extension, I'd like to log the metadata from media played in the browser from pages that use the MediaSession API.

Is it possible to get the current active MediaSession? If not, is it possible to get the MediaSession for a particular tab/window? (I suppose if I could get that far, I could emulate Chrome's behavior in determining which should be 'active'.)

As far as I can tell, the only way would be to inject code into every page, all the time. I'm quite open to better methods, if this is exposed via an extension API somewhere!

0

There are 0 answers