Script Editor - Unsaved Changes [Added]

When you edit a script and accidentally go to another script without having saved your changes, the edits are lost. Could you add a warning in this case?

The simplest way would be the standard “do you really want to navigate away from this page?”, more elaborate would be “save or discard your changes”.

It happened again :frowning:
The following Tampermonkey/Greasemonkey script will take care of it:

// ==UserScript==
// @name         VoiceMap Save Changes
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  make sure I do not forget to save my changes
// @author       Kian
// @match        https://voicemap.me/tour/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=voicemap.me
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.onload = protectMyChanges;
})();

function protectMyChanges()
{
    $('textarea.sound_bite_text').bind('input propertychange', function()
    {
        $(window).on("beforeunload", function() { return true; });
    });
}

Sorry @kian.vm! This is really frustrating, I know.

We’ll add a dialogue to confirm that you’d like to leave the page without saving ASAP.

This is done @kian.vm:

Thanks for suggesting it!

Great news. Thanks a lot for getting this done so quickly!