Safari Compatibility

PennController for IBEX Forums Support Safari Compatibility

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #5608
    Ncomeau
    Participant

    Hi again,

    Just had a question about whether or not it should be possible to run my experiments in the Safari browser. Everything runs fine in Chrome/Firefox/Edge (barring some of text being formatted differently in different sections of the experiment in Edge/Firefox), but when I have one of my Mac user colleagues try running things in Safari, they say they are not able to get passed the intro trial’s “Start” button press. This was previously the textInput element from the template asking for a username + hitting the enter key, but apparently that return key press didn’t register in Safari either. Other forum posts allude to experiments working fine in Safari, so I’m wondering if there’s anything I might be missing as getting these elements in my trials to work for Mac users goes.

    Thanks for the help!

    Nickolas

    #5609
    Jeremy
    Keymaster

    Hi Nickolas,

    I’m sorry you’re experiencing issues with Safari. PennController’s support of Safari is unfortunately lower, mostly because I don’t really have access to that browser. Do you use fullscreen in your experiment? Or audio playback/recording? Those are features that are known to be problematic with Safari in their current form in PennController. Feel free to send me the link to your experiment so I can take a closer look at it

    Jeremy

    #5615
    Ncomeau
    Participant

    Hi Jeremy,

    It turns out that the fullscreen() function was in fact the culprit. Audio playback seems to work just fine though! Safari is the only browser I’m having fullscreen trouble with so if there isn’t an existing workaround, I will probably just suggest that Mac users use Chrome or Firefox if they can.

    Nickolas

    #5616
    Jeremy
    Keymaster

    Hi Nickolas,

    You can try replacing the fullscreen() command with this:

    newFunction( ()=> {
      if (document.documentElement.requestFullscreen)
        document.documentElement.requestFullscreen();
      else if (document.documentElement.mozRequestFullScreen) /* Firefox */
        document.documentElement.mozRequestFullScreen();
      else if (document.documentElement.webkitRequestFullscreen) /* Chrome, Safari and Opera */
        document.documentElement.webkitRequestFullscreen();
      else if (document.documentElement.msRequestFullscreen) /* IE/Edge */
        document.documentElement.msRequestFullscreen();
    })
    .call()

    Jeremy

    #5625
    Ncomeau
    Participant

    Just wanted to confirm that this fixed the issue. Thanks Jeremy!

    #5758
    Ncomeau
    Participant

    Code that properly exits fullscreen for me (for some reason adding .documentElement breaks it):

    newFunction( ()=> {
    if (document.exitFullscreen)
    document.exitFullscreen();
    else if (document.mozCancelFullScreen) /* Firefox */
    document.mozCancelFullScreen();
    else if (document.webkitExitFullscreen) /* Chrome, Safari and Opera */
    document.webkitExitFullscreen();
    else if (document.msExitFullscreen) /* IE/Edge */
    document.msExitFullscreen();
    }).call()
    #5760
    Jeremy
    Keymaster

    Thank you Nickolas

    The family of exitFullscreen commands indeed must be called directly on document, which is why attempting to call it on documentElement won’t work

    Jeremy

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.