Skip to Main Content
Spotfire Ideas Portal
Status Future Consideration
Product Spotfire
Categories Visualization
Created by Guest
Created on Apr 13, 2017

Handle situation caused by modern browsers not running scripts in hidden tabs

Safari and Chrome (and presumably other browsers) won't execute JavaScript in tabs that aren't visible to the user. Spotfire relies on background JavaScript processing to send periodic requests to the server that tell the server to keep the analysis open. If a user opens an analysis, navigates to a different tab and then comes back to their analysis several minutes later they find that it has been unloaded by the server. This is particularly a problem with analyses that take a long time to open - it's natural for a user to navigate elsewhere to continue working, but when they navigate back the analysis isn't loaded because the server has timed it out. This isn't anything to do with idle timeouts - it's related to the check for incorrectly closed analyses on web player.

  • Attach files
  • Guest
    Reply
    |
    Jun 13, 2017

    I did a bit more testing and reading. Safari on Mac (and iOS) seems to stop execution of JavaScript on tabs as soon as they're invisible - meaning that you can't use Spotfire effectively in those browsers if you multi-task. Chrome on the other hand has more complex limitations on what can execute, meaning that Spotfire is usually OK although we've had reports from our users of problems in Chrome. I'm less clear what the Microsoft browsers are doing.

    There’s very little direct information about the power saving features in MacOS Safari, just lots of discussions about the impact on JavaScript processing when tabs are put into the background. On the other hand, Chrome has lots of documentation about their handling of background tabs, particularly useful is this one:

    https://developers.google.com/web/updates/2017/03/background_tabs

    Plus this one that talks about their future direction:

    https://docs.google.com/document/d/18_sX-KGRaHcV3xe5Xk_l6NNwXoxm-23IOepgMx4OlE4/pub

    Current version of Chrome allows for background processing, but places limitations on how often timers can fire and how much CPU the background tab can use. I don’t think these restrictions would impact Spotfire particularly, although perhaps the CPU one could kick in if someone has a slow machine and leaves Spotfire in the background as it opens a complex report. The user who originally reported the problem to my team was opening a complex analysis that rendered a couple of maps – so I guess it’s possible that the act of rendering the report when it completed opening may have used lots of CPU on his machine.

     Regardless, there is an easily reproducible problem on Safari on MacOS and a likely increasing problem with other browsers in the future.