I'm no expert with this code, but I'm wondering why handleAs: "json" was added to the requests - seems like that could be changing behavior, and is unrelated to the fix? IIUC the focus of the fix is the introduction of promiseRef instead of returning a promise from pushData (which is what's causing the popup message, since pushData is hooked on onbeforeunload).

Also, you can remove the now-commented old return statements, no sense keeping them there.