5

I was editing a Stack Snippet and the page froze and I lost all my work (it was a lot).

Could there be some kind of autosave when editing code snippets? (the ones with HTML, CSS, and JS that you can run).

5
  • the page froze?
    – akuzminykh
    May 22, 2021 at 18:09
  • 2
    I wrote a for-loop with a console.log, but I made a mistake and it printed infinite undefineds to the console... and it froze
    – LuisAFK
    May 22, 2021 at 18:35
  • 2
    I think that answer tag is not needed. Beacause code snippets is in both questions and answers. May 22, 2021 at 18:51
  • 2
    The snippet editor itself should not go unresponsive - if you run expensive code inside the snippet, it'll be in an iframe, which is a separate environment. The outer editor should remain as usable as ever. I've done this many times with infinite loops - "Save and insert into post" and then opening up the snippet again with "edit the above snippet" always works May 22, 2021 at 19:52
  • 5
    @CertainPerformance It depends on which browser and what ends up actually happening within the browser's code. The browser may, or may not, run the iframe in a different/same process. That may, or may not, allow the user to continue to interact with the containing page. The browser may, or may not, offer to stop the currently executing script after it has been executing for X amount of time (potentially configurable by the user). The browser stopping the script may, or may not, result in completely disabling JavaScript in the page. All of the above happen depending on browser/config.
    – Makyen Mod
    May 22, 2021 at 20:08

0

You must log in to answer this question.

Browse other questions tagged .