I have some user script that runs every about 10 minutes on specific page at opened tab in Safari 8.

The surprise is that safari somehow suspend javascript execution when tab is not active by user for a while.

The question is how to force javascript execution and prevent this behavior?

UPD: actually the same behavior is detected in Opera. I think the problem is related to Yosemite release?

  • 1
    Use another browser? JavaScript execution works fine in background tabs when I use Chrome.
    – tubedogg
    Commented Oct 30, 2014 at 19:17
  • Actually even in the Chrome with prevent app nap checked option, when the tab is not active it not executes javascript properly...
    – FelikZ
    Commented Oct 31, 2014 at 11:41

1 Answer 1


It might be going into "App Nap"

To disable this for Safari go to Finder, hit +I and check "Prevent App Nap": enter image description here

You can check to see if it worked by going opening up Activity Monitor, clicking the Energy tab and seeing if Safari is in sleep mode.

  • Actually I didn't have this option in Yosemite for Safari and iPhoto. It has only Locked checkbox. But this option exists for Chrome which is worked perfect without any changes :-/
    – FelikZ
    Commented Oct 31, 2014 at 6:25
  • No, I missed something. Even with checked option in Chrome, if the tab is not active - it doesn't work.
    – FelikZ
    Commented Oct 31, 2014 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .