Search code examples
google-chromegmailmp3content-security-policy

Gmail not playing mp3s on Google Chrome 91.0.4472.77 (64 bit)


We receive mp3 voicemails in Gmail. Starting today, all computers using Google Chrome can't play mp3s found in Gmail. This doesn't affect other sites that host mp3s.

Upon further inspection, the console reports:

Refused to load media from 'https://mail.google.com/mail/u/...' because it violates the following Content Security Policy directive: "media-src https://*.googlevideo.com/videoplayback/".

Is Gmail not following its new CSP policies? Is any work around other than simply downloading and playing the files?


Solution

  • In the end, I created a Chrome Extension with XMLHTTPRequest to get around CSP and to play the mp3 without a direct download.

    I released a Chrome Extension called GPlayer. Waiting on Google to approve. I believe the future link is https://chrome.google.com/webstore/detail/obdmmgdlafadeehmbmcmoggnaokehnaj


    Github link - https://github.com/TriStarGod/GPlayer