Chrome prevents Macbook from sleeping

Chrome prevents my Macbook from sleeping. See screenshot:

img

Some websites say it might be due to a chrome extension, but I've installed no new extensions in the last two weeks (I've only had this problem for two weeks). Neither did I update OSx, Chrome, or the Energy Saver settings. How do I fix this?


Solution 1:

I had the same issue where Chrome was preventing sleep, i.e., Activity Monitor Energy tab showed that. And I discovered that when I would close a tab running "https://web.whatsapp.com/", that the "Preventing Sleep" column would go to No. When I would open that web site again, it would go back to "Yes".

I found this blog discussing it: http://webdiary.com/2015/01/29/whatsappweb/

That correlates with the output of running pmset -g assertions, which shows:

   pid 229(coreaudiod): [0x00066e6300010845] 01:19:47 PreventUserIdleSystemSleep named: "com.apple.audio.e8-07-bf-12-d6-97:output.context.preventuseridlesleep" 
    Created for PID: 2748. 

Solution 2:

I woke up to a hot Macbook Pro with just 34% battery after fully charging it, unplugging it, closing it, and putting it in a briefcase the night before. It was so hot it was uncomfortable to hold, and the fan was working overtime. I've followed the same routine hundreds of times before with no similar problem.

Activity Monitor showed Chrome to be the main culprit, and "prevent sleep" was "yes" for Chrome. I had a dozen tabs open, and closed them one at a time to see what changed the status.

In my case, the problematic website was Forbes.com. I was able to toggle the prevent sleep mode by opening and closing a tab with a typical Forbes article. This site has a heavy ad load, auto-play videos, etc. I'm guessing something in their code cycles new videos on the un-refreshed page and is preventing sleep. One time, their video player failed to load for some reason and the prevent sleep indicator never went to "yes." Not definitive, but suggestive. I'm sure other sites with aggressive ad display methods might have the same effect.

Solution 3:

This is because, chrome detects if any tab is playing any media file either audio or video (this also includes ads with media). If you have any tab that's playing any media, chrome thinks that you are watching some media and doesn't let your laptop to go sleep mode.

----EDIT---- I was working on a project where i wanted to keep users screen and laptop awake all the time. So i used same trick, i put small hidden html video in code and it did the trick. Audio didnt work though.

Solution 4:

Try Chrome Canary. It seems to fix this issue.

Solution 5:

I effectively solved the issue by uninstalling the extension D (disconnect.me) Check if you have it installed and disable it.

Go back to the activity monitor and double check if "preventing sleeping" is still set to YES if so: I suspect you could try disabling other extensions with similar results.