Leave a Reply

2 comments

  1. The code indeed only looks at the TinyMCE editor or the title and content field if the editor is hidden:

    window.onbeforeunload = function(){
        var mce = typeof(tinyMCE) != 'undefined' ? tinyMCE.activeEditor : false, title, content;
    
        if ( mce && !mce.isHidden() ) {
            if ( mce.isDirty() )
                return autosaveL10n.saveAlert;
        } else {
            title = $('#post #title').val(), content = $('#post #content').val();
            if ( ( title || content ) && title + content != autosaveLast )
                return autosaveL10n.saveAlert;
        }
    };
    

    You could replace that onbeforeunload handler with your own (be sure to include the existing functionality of course). Or play with the isDirty() state of the TinyMCE editor and that autosaveLast value?