[GH-ISSUE #2081] [Feature request] Implement onbeforeunload for script editors #3240

Open
opened 2026-03-14 06:56:33 +03:00 by kerem · 0 comments
Owner

Originally created by @P6g9YHK6 on GitHub (Nov 26, 2024).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/2081

Is your feature request related to a problem? Please describe.
when unsaved changes have been made to a script trmm prompt to save when leaving the script editor.
This does not trigger the builtin browser onbeforeunload api and could very much lead to a loss of work when the event is done on tab/window level rather than trmm

Describe the solution you'd like
when the condition to make the confirmation window appear when leaving are met trigger a beforeunload event
https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event

Describe alternatives you've considered
N/A

Additional context
image

Originally created by @P6g9YHK6 on GitHub (Nov 26, 2024). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/2081 **Is your feature request related to a problem? Please describe.** when unsaved changes have been made to a script trmm prompt to save when leaving the script editor. This does not trigger the builtin browser **onbeforeunload** api and could very much lead to a loss of work when the event is done on tab/window level rather than trmm **Describe the solution you'd like** when the condition to make the confirmation window appear when leaving are met trigger a beforeunload event https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event **Describe alternatives you've considered** N/A **Additional context** ![image](https://github.com/user-attachments/assets/ecb5a980-f6af-46e3-95a3-36dfe0bd55d5)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#3240
No description provided.