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

GuillaumeC
Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 5 ☆ 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 !
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
-
@GuillaumeC As mentioned by @wheels, this extra prompt is keeping users from accidently closing the course and is along the lines of a lot of software that prompts "Are you sure you want to do this?". But there is a specific workaround for this feature:
If the author does not like the prompt when the student closes the window by either a reload or by clicking the browser window close button, they can add a JS action at the title level that On Show runs this code:
(window.myTop || window).noPromptOnUnload = true;
Answers
-
wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 685 eLearning ROCKSTAR Admin TeamCan 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 JavaScriptgetDisplayWindow().onbeforeunload = null;
-
GuillaumeC Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 5 ☆ Roadie ☆
-
wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 685 eLearning ROCKSTAR Admin TeamThis is the correct way to disable the prompt:
If the author does not like the prompt when the student closes the window by either a reload or by clicking the browser window close button, they can add a JS action at the title level that On Show runs this code:
(window.myTop || window).noPromptOnUnload = true;
Categories
- 35.9K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 25 ELB Learning Content
- 25 ELB Learning Content Discussions
- 328 CenarioVR®
- 195 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 42 Rockstar Learning Platform®
- 39 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 936 All Things eLearning
- 37 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products