Disable 'Changes you made may not be saved' notification from browser

GuillaumeC
GuillaumeC Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 4 ☆ Roadie ☆
Hello.
When exiting a module from a LMS by closing the content window, a 'Changes you made may not be saved' message may appear.
I have read that this can be disabled with a 'window.onbeforeunload = null' command.
Do you know how this can be implemented in a Lectora title ?

Thank you for your help !

Best Answer

Answers

  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 595 eLearning ROCKSTAR Admin Team
    edited May 12
    Can you tell us a little more about your use case? This prompt should help ensure learners close your course properly, with an exit button. This also prevents the learner from accidentally reloading the content (on mobile if they are swiping down to scroll up and scroll to far). There are a lot of different scenarios and it would be great to hear how you host your course. Is it displayed in it's own window, or in the same window within the LMS?

    If you absolutely need to disable it you would have a project level action:
    Project -> On Show -> Run JavaScript

    getDisplayWindow().onbeforeunload = null;
  • GuillaumeC
    GuillaumeC Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 4 ☆ Roadie ☆
    Thank you for your prompt reply.
    I will inform my client of the "risks" involved.
    Can you please confirm that the enclosed picture is the correct way to implement?
    It doesn't seem to work.