Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SugarCube 2.18.0 & Safari 10.1.1 (macOS 10.12.x) — "Fatal error" on opening HTML file in browser

I rarely ever launch my project in Safari directly so I'm not sure how far back I introduced this problem, but I have noticed on launching Twine's html output file in Safari itself I get the following error as a popup:
Apologies! A fatal error has occurred. Aborting.

Error: SecurityError (DOM Exception 18): The operation is insecure..

Stack Trace:
file:///Users/joshuameadows/Desktop/Alcyone-%20The%20Last%20City.html:6181:18178
file:///Users/joshuameadows/Desktop/Alcyone-%20The%20Last%20City.html:6181:18262
global code@file:///Users/joshuameadows/Desktop/Alcyone-%20The%20Last%20City.html:6186:30734

The game never progresses past the loading reticule. I'm not quite sure what I have done to cause the problem, although it works fine in the web2exe executable I use to package the project as its own app. It would make my life easier to debug if I can use the file occasionally in Safari, so I'm curious about fixing it if I can.

Comments

  • Do you have the safari browser set to allow access to local storage and such?
  • Chapel wrote: »
    Do you have the safari browser set to allow access to local storage and such?

    Hm, I don't know that I don't? I wouldn't have changed any default settings & it worked previously (within the last few months).
  • edited May 18
    Might be worth checking out if you can, if only to rule it out. Some setting like 'Block cookies and data.' An update could have potentially changed the setting or its default state or something. I could also be totally wrong. I had a similar issue a few weeks ago when I was testing some stuff on a friend's mac book, though I don't remember if it was the exact same issue, it was something about security and changing that setting worked.
  • I've had issues with Firefox as well, and only lately, too. Chrome still works, though, but only because I know how to allow local storage access.
  • edited May 18
    Does this happen with a new empty project compiled with SugarCube or only with Alcyone?

    That security error can result from a variety of things, it's not specifically a storage error. In this case, however, a storage error is the most likely source. There was a bug in the 10.1 betas related to storage access from local files, however, it was supposed to have been resolved. Perhaps the fix didn't make it into the version you're using—no idea about that, I'm just speculating.

    Also. IIRC, the setting you want to check is under the Privacy tab as Cookies and website data.
  • Hm yes it happens with a totally empty project as well, although I have that option checked & enabled in my browser. o_o
  • I tried wiping Safari to scratch & testing — still didn't work.
    I created a brand new user account — still didn't work.
    I tested it on a different machine — still didn't work.

    So I don't know if there's been a new setting added that's more restrictive or what, but I'm baffled personally.
  • At this point, I'm getting the impression that the bug made it out of the betas. :(

    Which setting did you do your testing with: Allow from websites I visit, Always allow? I'm assuming you didn't try one of the more restrictive ones.

    Regardless. If possible, I'd prefer for SugarCube to trap that exception and deliver a more on-target error message. Since I do not have access to modern versions of Safari—outside of iOS Safari, which limits my ability to do local file testing—I might ask you to test some builds for me, if you don't mind.
  • Yeah I would be happy to test anything you need. It was on "allow from websites I visit" by default, I think, but "always allow" didn't change it either.
  • I'm having this same error on everything I create with Twine 2.1.3 and Sugarcube 2.18.0, including previously OK files. I'm seeing it on Safari on my desktop (new-ish MacBook Pro) and my iPhone 6. (System software on both is fully up-to-date.)
  • edited May 26
    If you would, could those experiencing the Safari crash try the attached compiled project and report the exact error so I can identify the precise location of the issue.
  • If you would, could those experiencing the Safari crash try the attached compiled project and report the exact error so I can identify the precise location of the issue.

    I get this:
    Apologies! A fatal error has occurred. Aborting.
    
    Error: SecurityError (DOM Exception 18): The operation is insecure..
    
    Stack Trace:
    file:///Users/joshuameadows/Desktop/sc-safari-test.html:3170:66
    file:///Users/joshuameadows/Desktop/sc-safari-test.html:3173:2
    global code@file:///Users/joshuameadows/Desktop/sc-safari-test.html:18806:3
    
  • Thanks. That's got it.

    The exception definitely seems to be caused by the bug I mentioned up thread. Apparently, my feature tests weren't aggressive enough to cope with Safari's inanity—good job breaking it Apple.

    Although there's not much I can do about the bug itself—we'll just have to wait until a fix makes it into a release version—I should be able to trap it and deliver a reasonable error message to the user, now that I know exactly what I'm looking for.
  • Could those experiencing the Safari crash try the attached compiled project. You should now either receive a somewhat better error or actually be able to play—depends on how much they broke.
  • Your browser either lacks or has disabled the Web Storage API, so this game is running in a degraded mode. You may be able to continue, however, some parts may not work properly.
    

    Screen%20Shot%202017-05-27%20at%206.12.04%20pm.png
  • Good. I was worried that the bug affected Cookies too, thankfully not. Most stories/games will play on the Cookie storage adapter just fine, the complaint—which you should only see once a session—is actually a little over the top—I should probably reword it a bit.
Sign In or Register to comment.